利用jupyter命令,将该notebook插件文档复制到Jupyter数据目录。
运行juypter notebook, 然后去设置页面激活Table of Contents(TOC)插件。
以下步骤中的第1和第2步可以使用 conda install -c conda-forge jupyter_contrib_nbextensions命令替换。
以下命令均在cmd终端运行。
1. 安装pip包
Install the python package
pip install jupyter_contrib_nbextensions
2. 安装js和css文件
Install javascript and css files
jupyter contrib nbextension install –user
Once installed, you’ll need to restart the notebook server.
3. 启用插件
Enabling/Disabling extensions
jupyter nbextension enable
为codefolding\main所在位置,比如我的位置:F:\Anaconda3\Lib\site-packages\jupyter_contrib_nbextensions\nbextensions\codefolding\main
jupyter nbextension enable F:\Anaconda3\Lib\site-packages\jupyter_contrib_nbextensions\nbextensions\codefolding\main
4. 在jupyter notebooke里激活
activate
then you just need to go to http://localhost:8888/nbextensions (assuming a default configuration) and select “Table of contents” and “activate” to get a new “Table of contents” button at the top of your notebooks.
jupyter notebook
http://localhost:8888/nbextensions
进入插件设置页面 :
勾选Table of Contents选项
Parameters参数设置:
Automatically number notebook’s sections 对TOC的序号自动编号
Add a Table of Contents cell at the top of the notebook 在notebook的顶行添加一个TOC
Display toc window/sidebar at startup 在启动时显示TOC浮动条
Display Table of Contents as a sidebar (otherwise as a floating window) 选中则在浏览器侧边显示TOC,否则以浮动窗口形式存在。
Display Table of Contents as a navigation menu 在notebook菜单栏显示navigation菜单按钮
Move notebook’s title and menu on the left instead of being centered — This provides a better look when the toc/sidebar is present