Jupyter Notebook 是一个算法工程师友好的工具,但仍有许多拓展的空间,比如:当你的文件中包含大量的代码和 Markdown 混排时,你可能需要一个目录来帮助你更好的对文件结构进行可视化,nbextensions 可以帮我们实现。
1. 概览
Nbextensions is a collection of various notebook extensions for Jupyter.
This repository contains a collection of extensions that add functionality to the Jupyter notebook. These extensions are mostly written in Javascript and will be loaded locally in your browser.
The IPython-contrib repository is maintained independently by a group of users and developers and not officially related to the IPython development team.
2. 安装
2.1 Install the python package
建议直接使用 Conda
指令进行安装:
Conda
conda install -c conda-forge jupyter_contrib_nbextensions
PIP
pip install jupyter_contrib_nbextensions
或者:
pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
2.2 Install javascript and css files
jupyter contrib nbextension install --user
3. 配置
打开 Jupyter Notebook,可以看到主界面餐单栏多出了 Nbextensions
选项,点击可以展开拓展程序选项:
每个拓展程序均可以单击后查看介绍与使用方法,我们以拓展目录为例。勾选红框中的 Table of Contets (2)
项目。然后新建一个项目,点击菜单栏的最右边新增的目录符号,即可显示文件目录。更多的设置可以点击左侧目录的设置按钮。