diff --git a/IPython/frontend/html/notebook/static/css/codemirror-ipython.css b/IPython/frontend/html/notebook/static/css/codemirror-ipython.css deleted file mode 100644 index c8caa24..0000000 --- a/IPython/frontend/html/notebook/static/css/codemirror-ipython.css +++ /dev/null @@ -1,40 +0,0 @@ - - -.cm-s-ipython span.cm-keyword {color: #008000; font-weight: bold;} -.cm-s-ipython span.cm-number {color: #000080;} -.cm-s-ipython span.cm-operator {color: #AA22FF; font-weight: bold;} -.cm-s-ipython span.cm-meta {color: #AA22FF;} -.cm-s-ipython span.cm-comment {color: #408080; font-style: italic;} -.cm-s-ipython span.cm-string {color: #BA2121;} -.cm-s-ipython span.cm-error {color: #f00;} -.cm-s-ipython span.cm-builtin {color: #008000;} -.cm-s-ipython span.cm-variable {color: #000000;} - -/* These classes are not currently used in the python.js mode */ - -/*.cm-s-ipython span.cm-atom {color: #219;}*/ -/*.cm-s-ipython span.cm-def {color: #00f;}*/ -/*.cm-s-ipython span.cm-variable-2 {color: #05a;}*/ -/*.cm-s-ipython span.cm-variable-3 {color: #0a5;}*/ -/*.cm-s-ipython span.cm-property {color: black;}*/ -/*.cm-s-ipython span.cm-qualifier {color: #555;}*/ -/*.cm-s-ipython span.cm-bracket {color: #cc7;}*/ -/*.cm-s-ipython span.cm-tag {color: #170;}*/ -/*.cm-s-ipython span.cm-attribute {color: #00c;}*/ - -/* These are the old styles for our pre-themed version */ - -/*span.py-delimiter {color: #666666;}*/ -/*span.py-special {color: #666666;}*/ -/*span.py-operator {color: #AA22FF; font-weight: bold;}*/ -/*span.py-keyword {color: #008000; font-weight: bold;}*/ -/*span.py-number {color: #666666;}*/ -/*span.py-identifier {color: #000000;}*/ -/*span.py-func {color: #000000;}*/ -/*span.py-type {color: #008000;}*/ -/*span.py-decorator {color: #AA22FF;}*/ -/*span.py-comment {color: #408080; font-style: italic;}*/ -/*span.py-string {color: #BA2121;}*/ -/*span.py-bytes {color: #BA2121;}*/ -/*span.py-raw {color: #BA2121;}*/ -/*span.py-unicode {color: #BA2121;}*/ diff --git a/IPython/frontend/html/notebook/static/css/style.min.css b/IPython/frontend/html/notebook/static/css/style.min.css index 03e9366..9228ea1 100644 --- a/IPython/frontend/html/notebook/static/css/style.min.css +++ b/IPython/frontend/html/notebook/static/css/style.min.css @@ -866,6 +866,26 @@ a.label:hover,a.label:focus,a.badge:hover,a.badge:focus{color:#ffffff;text-decor .end{-webkit-box-pack:end;-moz-box-pack:end;box-pack:end;} .center{-webkit-box-pack:center;-moz-box-pack:center;box-pack:center;} .corner-all{border-radius:4px;} +pre code{display:block;padding:0.5em;} +.highlight-base,pre code,pre .subst,pre .tag .title,pre .lisp .title,pre .clojure .built_in,pre .nginx .title{color:black;} +.highlight-string,pre .string,pre .constant,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .tex .special,pre .erlang_repl .function_or_atom,pre .markdown .header{color:#BA2121;} +.highlight-comment,pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk,pre .markdown .blockquote{color:#408080;font-style:italic;} +.highlight-number,pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char,pre .go .constant,pre .change,pre .markdown .bullet,pre .markdown .link_url{color:#080;} +pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .important,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .erlang_repl .reserved,pre .prompt,pre .markdown .link_label,pre .vhdl .attribute,pre .clojure .attribute,pre .coffeescript .property{color:#8888ff;} +.highlight-keyword,pre .keyword,pre .id,pre .phpdoc,pre .aggregate,pre .css .tag,pre .javadoctag,pre .phpdoc,pre .yardoctag,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .go .typename,pre .tex .command,pre .markdown .strong,pre .request,pre .status{color:#008000;font-weight:bold;} +.highlight-builtin,pre .built_in{color:#008000;} +pre .markdown .emphasis{font-style:italic;} +pre .nginx .built_in{font-weight:normal;} +pre .coffeescript .javascript,pre .javascript .xml,pre .tex .formula,pre .xml .javascript,pre .xml .vbscript,pre .xml .css,pre .xml .cdata{opacity:0.5;} +.cm-s-ipython span.cm-variable{color:black;} +.cm-s-ipython span.cm-keyword{color:#008000;font-weight:bold;} +.cm-s-ipython span.cm-number{color:#080;} +.cm-s-ipython span.cm-comment{color:#408080;font-style:italic;} +.cm-s-ipython span.cm-string{color:#BA2121;} +.cm-s-ipython span.cm-builtin{color:#008000;} +.cm-s-ipython span.cm-error{color:#f00;} +.cm-s-ipython span.cm-operator{color:#AA22FF;font-weight:bold;} +.cm-s-ipython span.cm-meta{color:#AA22FF;} body{background-color:#ffffff;} body.notebook_app{overflow:hidden;} blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777;} diff --git a/IPython/frontend/html/notebook/static/js/notebookmain.js b/IPython/frontend/html/notebook/static/js/notebookmain.js index 58e3036..45e9c1f 100644 --- a/IPython/frontend/html/notebook/static/js/notebookmain.js +++ b/IPython/frontend/html/notebook/static/js/notebookmain.js @@ -100,7 +100,6 @@ $(document).ready(function () { tables: true, langPrefix: "language-", highlight: function(code, lang) { - console.log(lang, code); var highlighted; if (lang) { highlighted = hljs.highlight(lang, code, false); diff --git a/IPython/frontend/html/notebook/static/less/highlight.less b/IPython/frontend/html/notebook/static/less/highlight.less new file mode 100644 index 0000000..aff553c --- /dev/null +++ b/IPython/frontend/html/notebook/static/less/highlight.less @@ -0,0 +1,157 @@ +/* + +Original style from softwaremaniacs.org (c) Ivan Sagalaev +Adapted from GitHub theme + +*/ + +pre code { + display: block; + padding: 0.5em; +} + +.highlight-base, +pre code, +pre .subst, +pre .tag .title, +pre .lisp .title, +pre .clojure .built_in, +pre .nginx .title { + color: black; +} + +.highlight-string, +pre .string, +pre .constant, +pre .parent, +pre .tag .value, +pre .rules .value, +pre .rules .value .number, +pre .preprocessor, +pre .ruby .symbol, +pre .ruby .symbol .string, +pre .aggregate, +pre .template_tag, +pre .django .variable, +pre .smalltalk .class, +pre .addition, +pre .flow, +pre .stream, +pre .bash .variable, +pre .apache .tag, +pre .apache .cbracket, +pre .tex .command, +pre .tex .special, +pre .erlang_repl .function_or_atom, +pre .markdown .header { + color: #BA2121; +} + +.highlight-comment, +pre .comment, +pre .annotation, +pre .template_comment, +pre .diff .header, +pre .chunk, +pre .markdown .blockquote { + color: #408080; + font-style: italic; +} + +.highlight-number, +pre .number, +pre .date, +pre .regexp, +pre .literal, +pre .smalltalk .symbol, +pre .smalltalk .char, +pre .go .constant, +pre .change, +pre .markdown .bullet, +pre .markdown .link_url { + color: #080; +} + +pre .label, +pre .javadoc, +pre .ruby .string, +pre .decorator, +pre .filter .argument, +pre .localvars, +pre .array, +pre .attr_selector, +pre .important, +pre .pseudo, +pre .pi, +pre .doctype, +pre .deletion, +pre .envvar, +pre .shebang, +pre .apache .sqbracket, +pre .nginx .built_in, +pre .tex .formula, +pre .erlang_repl .reserved, +pre .prompt, +pre .markdown .link_label, +pre .vhdl .attribute, +pre .clojure .attribute, +pre .coffeescript .property { + color: #88F +} + +.highlight-keyword, +pre .keyword, +pre .id, +pre .phpdoc, +pre .aggregate, +pre .css .tag, +pre .javadoctag, +pre .phpdoc, +pre .yardoctag, +pre .smalltalk .class, +pre .winutils, +pre .bash .variable, +pre .apache .tag, +pre .go .typename, +pre .tex .command, +pre .markdown .strong, +pre .request, +pre .status { + color: #008000; + font-weight: bold; +} + +.highlight-builtin, +pre .built_in { + color: #008000; +} + +pre .markdown .emphasis { + font-style: italic; +} + +pre .nginx .built_in { + font-weight: normal; +} + +pre .coffeescript .javascript, +pre .javascript .xml, +pre .tex .formula, +pre .xml .javascript, +pre .xml .vbscript, +pre .xml .css, +pre .xml .cdata { + opacity: 0.5; +} + +/* apply the same style to codemirror */ + +.cm-s-ipython span.cm-variable { .highlight-base()} +.cm-s-ipython span.cm-keyword { .highlight-keyword() } +.cm-s-ipython span.cm-number { .highlight-number() } +.cm-s-ipython span.cm-comment { .highlight-comment() } +.cm-s-ipython span.cm-string { .highlight-string()} +.cm-s-ipython span.cm-builtin { .highlight-builtin() } +.cm-s-ipython span.cm-error { color: #f00; } +.cm-s-ipython span.cm-operator {color: #AA22FF; font-weight: bold;} +.cm-s-ipython span.cm-meta {color: #AA22FF;} diff --git a/IPython/frontend/html/notebook/static/less/notebook.less b/IPython/frontend/html/notebook/static/less/notebook.less index 0c93134..82d837d 100644 --- a/IPython/frontend/html/notebook/static/less/notebook.less +++ b/IPython/frontend/html/notebook/static/less/notebook.less @@ -5,7 +5,7 @@ */ @import "variables.less"; - +@import "highlight.less"; body { background-color:@notebook_background; diff --git a/IPython/frontend/html/notebook/templates/notebook.html b/IPython/frontend/html/notebook/templates/notebook.html index 73e941d..c7c1bab 100644 --- a/IPython/frontend/html/notebook/templates/notebook.html +++ b/IPython/frontend/html/notebook/templates/notebook.html @@ -12,9 +12,6 @@ window.mathjax_url = "{{mathjax_url}}"; - - -