在Jupyter笔记本上显示错误

时间:2017-04-11 20:22:45

标签: python css anaconda jupyter-notebook

我试图将外观更改为我的jupyter笔记本的深色主题,并使用下面的代码在三个不同的文件夹中替换三个custom.css,而我的笔记本现在看起来像这个Notebook Appearance没有顶级菜单显示。请帮忙!

环境:Anaconda 4.2.0,python 3.5 这是我提到的指令: http://sherifsoliman.com/2016/01/11/theming-ipython-jupyter-notebook/

文件夹中: ~\Anaconda3\Lib\site-packages\notebook\static\custom ~\Anaconda3\Lib\site-packages\jupyter_core\tests\dotipython_empty\profile_default\static\custom ~\Anaconda3\Lib\site-packages\jupyter_core\tests\dotipython\profile_default\static

代码:

/*

    Name:       Base16 Flat Dark
    Author:     Chris Kempson (http://chriskempson.com)

    CodeMirror template adapted for IPython Notebook by Nikhil Sonnad (https://github.com/nsonnad/base16-ipython-notebook)
    CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
    Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

/* Uncomment to use a custom font
div#notebook, div.CodeMirror, div.output_area pre, div.output_wrapper, div.prompt {
  font-family: 'Custom Font Name', monospace !important;
}
*/

/* GLOBALS */
body {background-color: #2C3E50;}
a {color: #3498DB;}

/* INTRO PAGE */
.toolbar_info, .list_container {color: #f5f5f5;}

/* NOTEBOOK */

/* comment out this line to bring the toolbar back */
div#maintoolbar, div#header {display: none !important;}

div#notebook {border-top: none;}

div.input_prompt {color: #be643c;}
div.output_prompt {color: #9B59B6;}
div.input_area {
  border-radius: 0px;
  border: 1px solid #7F8C8D;
}
div.output_area pre {font-weight: normal; color: #e0e0e0;}
div.output_subarea {font-weight: normal; color: #e0e0e0;}

.rendered_html table, .rendered_html th, .rendered_html tr, .rendered_html td {
  border: 1px  #e0e0e0 solid;
  color: #e0e0e0;
}
div.output_html { font-family: sans-serif; }
table.dataframe tr {border: 1px #e0e0e0;}

div.cell.selected {border-radius: 0px;}
div.cell.edit_mode {border-radius: 0px; border: thin solid #9B59B6;}
div.text_cell_render, div.output_html {color: #e0e0e0;}

span.ansiblack {color: #34495E;}
span.ansiblue {color: #1ABC9C;}
span.ansigray {color: #BDC3C7;}
span.ansigreen {color: #2ECC71;}
span.ansipurple {color: #9B59B6;}
span.ansired {color: #E74C3C;}
span.ansiyellow {color: #F1C40F;}

div.output_stderr {background-color: #E74C3C;}
div.output_stderr pre {color: #f5f5f5;}

.cm-s-ipython.CodeMirror {background: #2C3E50; color: #f5f5f5;}
.cm-s-ipython div.CodeMirror-selected {background: #34495E !important;}
.cm-s-ipython .CodeMirror-gutters {background: #2C3E50; border-right: 0px;}
.cm-s-ipython .CodeMirror-linenumber {color: #95A5A6;}
.cm-s-ipython .CodeMirror-cursor {border-left: 1px solid #BDC3C7 !important;}

.cm-s-ipython span.cm-comment {color: #be643c;}
.cm-s-ipython span.cm-atom {color: #9B59B6;}
.cm-s-ipython span.cm-number {color: #9B59B6;}

.cm-s-ipython span.cm-property, .cm-s-ipython span.cm-attribute {color: #2ECC71;}
.cm-s-ipython span.cm-keyword {color: #E74C3C;}
.cm-s-ipython span.cm-string {color: #F1C40F;}
.cm-s-ipython span.cm-operator {color: #be643c;}
.cm-s-ipython span.cm-builtin {color: #9B59B6;}

.cm-s-ipython span.cm-variable {color: #2ECC71;}
.cm-s-ipython span.cm-variable-2 {color: #3498DB;}
.cm-s-ipython span.cm-def {color: #E67E22;}
.cm-s-ipython span.cm-error {background: #E74C3C; color: #BDC3C7;}
.cm-s-ipython span.cm-bracket {color: #e0e0e0;}
.cm-s-ipython span.cm-tag {color: #E74C3C;}
.cm-s-ipython span.cm-link {color: #9B59B6;}

.cm-s-ipython .CodeMirror-matchingbracket { text-decoration: underline; color: #f5f5f5 !important;}

1 个答案:

答案 0 :(得分:0)

我通过在github.github.com/dunovank/jupyter-themes

中使用另一个python包修复了这个问题