Jupyter Notebook 是一個(gè)算法工程師友好的工具,但仍有許多拓展的空間,比如:當(dāng)你的文件中包含大量的代碼和 Markdown 混排時(shí),你可能需要一個(gè)目錄來幫助你更好的對(duì)文件結(jié)構(gòu)進(jìn)行可視化,nbextensions 可以幫我們實(shí)現(xiàn)。
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 指令進(jìn)行安裝:
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 選項(xiàng),點(diǎn)擊可以展開拓展程序選項(xiàng):

每個(gè)拓展程序均可以單擊后查看介紹與使用方法,我們以拓展目錄為例。勾選紅框中的 Table of Contets (2) 項(xiàng)目。然后新建一個(gè)項(xiàng)目,點(diǎn)擊菜單欄的最右邊新增的目錄符號(hào),即可顯示文件目錄。更多的設(shè)置可以點(diǎn)擊左側(cè)目錄的設(shè)置按鈕。

