As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.
What is nbextensions?
The nbextensions contains a collection of extensions that add functionality to your Jupyter notebook.
For example, just to cite a few extensions:
Table of Contents
Collapsible headings
The installation can be done through Conda or PIP
# If conda:
conda install -c conda-forge jupyter_contrib_nbextensions
# or with pip:
pip install jupyter_contrib_nbextensions
You will see the new tab Nbextensions
in the jupyter notebook menu. Uncheck the checkbox at the top disable configuration for nbextensions without explicit compatibility (they may break your notebook environment, but can be useful to show for nbextension development)
and then check Table of Contents(2)
. That is all. Screenshot:
To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:
jupyter contrib nbextension install --user
Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)
You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:
jupyter nbextension enable <nbextension require path>
Concretely, to enable the ToC (Table of Contents) extension, do:
jupyter nbextension enable toc2/main
As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.
To install it if you use conda:
conda install -c conda-forge jupyter_nbextensions_configurator
If you don't have Conda or don't want to install through Conda, then do the following 2 steps:
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user