Answers:
使用jupyter-themes
Kyle Dunovan 的软件包可以很容易地做到这一点。您可能可以使用安装它conda
。否则,您将需要使用pip
。
使用conda安装它:
conda install jupyterthemes
或点子
pip install jupyterthemes
然后使用
jt -t chesterish
加载切斯特主题或其他主题。最后,重新加载页面。文档和源代码在这里:https : //github.com/dunovank/jupyter-themes
jupyter notebook
才能正常工作,但是下一次,只需jt -t <themes>
在终端上更改并重新加载笔记本页面即可。对我来说,它的行为类似于这样。
jupyterthemes
不在conda上,也不在conda- pip
conda config --add channels conda-forge
jupyterthemes
在conda-forge上,答案应该conda install jupyterthemes -c conda-forge
是必需的,或者建议不要使用conda进行安装。
跟着这些步骤:-
pip安装主题。
pip install jupyterthemes
然后从下面选择主题,并使用以下命令进行设置:成功安装后,我们许多人认为我们需要再次启动jupyter服务器,只需刷新页面即可。设置主题。
jt -t <theme-name>
主题名称列表
更改主题后,它的表现很奇怪。字体很小,看不到工具栏,我真的不喜欢新外观。
对于那些想要还原原始主题的人,可以按以下步骤进行:
jt -r
您需要在第一次执行时重新启动Jupyter,稍后刷新足以启用新主题。
或直接从笔记本内部
!jt -r
相反,安装内Jupyter库的,我会建议你使用'暗读者扩展- https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh在Chrome(你可以找到'黑暗读者扩展在其他浏览器(例如Firefox)中。你可以玩;过滤您想要使用深色主题的网址,甚至过滤自己的深色主题。以下是几个示例:
希望对您有所帮助。贝鲁兹
Jupyter字体大小以及内部和外部背景颜色的简单全局更改(此更改将影响所有笔记本电脑)。
在Windows中,通过运行以下命令找到config目录:
jupyter --config-dir
在Linux中是 ~/.jupyter
在此目录中创建子custom
文件夹“ 创建文件” custom.css
并粘贴:
/* Change outer background and make the notebook take all available width */
.container {
width: 99% !important;
background: #DDC !important;
}
/* Change inner background (CODE) */
div.input_area {
background: #F4F4E2 !important;
font-size: 16px !important;
}
/* Change global font size (CODE) */
.CodeMirror {
font-size: 16px !important;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode */
div.cell.selected {
border-left-width: 1px !important;
}
最后-重新启动Jupyter。结果:
我已经使用Raleway字体进行样式设置
到C:\ User \ UserName \ .jupyter \ custom \ custom.css文件
附加给定的样式,这是专门针对jupyter笔记本的深色模式...
这应该是您当前的custom.css文件:-
/* This file contains any manual css for this page that needs to override the global styles.
This is only required when different pages style the same element differently. This is just
a hack to deal with our current css styles and no new styling should be added in this file.*/
#ipython-main-app {
position: relative;
}
#jupyter-main-app {
position: relative;
}
现在要添加的内容开始
.header-bar {
display: none;
}
#header-container img {
display: none;
}
#notebook_name {
margin-left: 0px !important;
}
#header-container {
padding-left: 0px !important
}
html,
body {
overflow: hidden;
font-family: OpenSans;
}
#header {
background-color: #212121 !important;
color: #fff;
padding-top: 20px;
padding-bottom: 50px;
}
.navbar-collapse {
background-color: #212121 !important;
color: #fff;
border: none !important
}
#menus {
border: none !important;
color: white !important;
}
#menus .dropdown-toggle {
color: white !important;
}
#filelink {
color: white !important;
text-align: centerimportant;
padding-left: 7px;
text-decoration: none !important;
}
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus {
background-color: #191919 !important;
color: #eee !important;
text-align: left !important;
}
.dropdown-menu,
.dropdown-menu a,
.dropdown-submenu a {
background-color: #191919;
color: #fff !important;
}
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus,
.dropdown-submenu>a:after {
background-color: #212121;
color: #fff !important;
}
.btn-default {
color: #fff !important;
background-color: #212121 !important;
border: none !important;
}
.dropdown {
text-align: left !important;
}
.form-control.select-xs {
background-color: #191919 !important;
color: #eee !important;
border: none;
outline: none;
}
#modal_indicator {
display: none;
}
#kernel_indicator {
color: #fff;
}
#notification_trusted,
#notification_notebook {
background-color: #212121;
color: #eee !important;
border: none;
border-bottom: 1px solid #eee;
}
#logout {
background-color: #191919;
color: #eee;
}
#maintoolbar-container {
padding-top: 0px !important;
}
.notebook_app {
background-color: #222222;
}
::-webkit-scrollbar {
display: none;
}
#notebook-container {
background-color: #212121;
}
div.cell.selected,
div.cell.selected.jupyter-soft-selected {
border: none !important;
}
.cm-keyword {
color: orange !important;
}
.input_area {
background-color: #212121 !important;
color: white !important;
border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.cm-def {
color: #5bc0de !important;
}
.cm-variable {
color: yellow !important;
}
.output_subarea.output_text.output_result pre,
.output_subarea.output_text.output_stream.output_stdout pre {
color: white !important;
}
.CodeMirror-line {
color: white !important;
}
.cm-operator {
color: white !important;
}
.cm-number {
color: lightblue !important;
}
.inner_cell {
border: 1px thin #eee;
border-radius: 50px !important;
}
.CodeMirror-lines {
border-radius: 20px;
}
.prompt.input_prompt {
color: #5cb85c !important;
}
.prompt.output_prompt {
color: lightblue;
}
.cm-string {
color: #6872ac !important;
}
.cm-builtin {
color: #f0ad4e !important;
}
.run_this_cell {
color: lightblue !important;
}
.input_area {
border-radius: 20px;
}
.output_png {
background-color: white;
}
.CodeMirror-cursor {
border-left: 1.4px solid white;
}
.box-flex1.output_subarea.raw_input_container {
color: white;
}
input.raw_input {
color: black !important;
}
div.output_area pre {
color: white
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: white !important;
font-weight: bolder !important;
}
.CodeMirror-gutter.CodeMirror-linenumber,
.CodeMirror-gutters {
background-color: #212121 !important;
}
span.filename:hover {
color: #191919 !important;
height: auto !important;
}
#site {
background-color: #191919 !important;
color: white !important;
}
#tabs li.active a {
background-color: #212121 !important;
color: white !important;
}
#tabs li {
background-color: #191919 !important;
color: white !important;
border-top: 1px thin #eee;
}
#notebook_list_header {
background-color: #212121 !important;
color: white !important;
}
#running .panel-group .panel {
background-color: #212121 !important;
color: white !important;
}
#accordion.panel-heading {
background-color: #212121 !important;
}
#running .panel-group .panel .panel-heading {
background-color: #212121;
color: white
}
.item_name {
color: white !important;
cursor: pointer !important;
}
.list_item:hover {
background-color: #212121 !important;
}
.item_icon.icon-fixed-width {
color: white !important;
}
#texteditor-backdrop {
background-color: #191919 !important;
border-top: 1px solid #eee;
}
.CodeMirror {
background-color: #212121 !important;
}
#texteditor-backdrop #texteditor-container .CodeMirror-gutter,
#texteditor-backdrop #texteditor-container .CodeMirror-gutters {
background-color: #212121 !important;
}
.celltoolbar {
background-color: #212121 !important;
border: none !important;
}