Can I collapse/fold cells in the exported HTML file from a notebook?

It seems like a have to see all the cell outputs unfolded in an exported HTML file from a notebook.
However, because some cells contain long outputs, I would like them to be collapsible for readability.

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 configuratorpackage. This provides an extra tab in your Notebook interface from where you can easily (de)activate all installed extensions.


pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

@takefive Is what you are describing for the traditional notebook interface or JupyterLab? Or both? JupyterLab has better inherent support for code-folding that even survives to reopening later. However, I don’t now about saving it as HTML.

The original poster didn’t provide any detail of what they were using. And no version information about the interface either.

Is there a good solution for this? jiofi.local.html bitlife pc