python -- Jupyter Notebook 添加目录索引、更换主题、解决工具栏隐藏问题

一、添加目录索引

步骤一:安装扩展包 jupyter_contrib_nbextensions

pip install jupyter_contrib_nbextensions 

步骤二:配置 nbextensions

jupyter contrib nbextension install --user

步骤三:启动Jupyter Notebook ,点选nbextensions,勾选Table of Contents

完成效果图:


二、更换主题

步骤一:安装扩展包 

(C:\Users\Lenovo\Anaconda3) C:\Users\Lenovo>pip install --upgrade jupyterthemes

步骤二:查看主题列表

(C:\Users\Lenovo\Anaconda3) C:\Users\Lenovo>jt -l

步骤三:选择主题

(C:\Users\Lenovo\Anaconda3) C:\Users\Lenovo>jt -t oceans16   #可以将oceans16换成上面列表里面的任何一个

步骤四:重启Jupyter Notebook即可

完成效果图(几种示例):

默认样式:

oceans16:这里写图片描述

grades3:

这里写图片描述

onedork:

这里写图片描述

chesterish: 

这里写图片描述

三、 解决更改主题后工具栏ToolBar隐藏问题

步骤一:命令行设置toolbar可见

(C:\Users\Lenovo\Anaconda3) C:\Users\Lenovo>jt -t oceans16 -N -T

步骤二:重启Jupyter Notebook,进入脚本界面,点选View下的Toggle Header 和 Toggle Toolbar即可

完成效果展示:


附加:jupyter-themes中命令行选项的描述:

cl options arg default
Usage help -h --
List Themes -l --
Theme Name to Install -t --
Code Font -f --
Code Font-Size -fs 11
Notebook Font -nf --
Notebook Font Size -nfs 13
Text/MD Cell Font -tf --
Text/MD Cell Fontsize -tfs 13
Pandas DF Fontsize -dfs 9
Output Area Fontsize -ofs 8.5
Mathjax Fontsize (%) -mathfs 100
Intro Page Margins -m auto
Cell Width -cellw 980
Line Height -lineh 170
Cursor Width -cursw 2
Cursor Color -cursc --
Alt Prompt Layout -altp --
Alt Markdown BG Color -altmd --
Alt Output BG Color -altout --
Style Vim NBExt* -vim --
Toolbar Visible -T --
Name & Logo Visible -N --
Reset Default Theme -r --
Force Default Fonts -dfonts --

参考:

[1] ipython notebook主题背景颜色更改

[2] Jupyter Notebook 添加目录

[3] Jupyter notebook 更换主题后工具栏被隐藏解决方法

[4] GitHub : dunovank/jupyter-themes

(仅供个人学习,不负任何其他责任哈!~~~~~~~~~~~~~~~)


猜你喜欢

转载自blog.csdn.net/august1226/article/details/80762632