UPDATE:
The newer jupyter-lab
is a more modern and feature-rich interface which supports cell folding by default. See @intsco's answer below
UPDATE 2
Since jupyter-lab
now also supports extensions, you can extend the built-in cell-folding functionality with the Collapsible_Headings
extension.
Original answer:
The jupyter contrib nbextensions
Python package contains a code-folding extension that can be enabled within the notebook. Follow the link (Github) for documentation.
To install using command line:
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
To make life easier in managing them, I'd also recommend the jupyter nbextensions configurator
package. This provides an extra tab in your Notebook interface from where you can easily (de)activate all installed extensions.
Installation:
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…