Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter notebook: Is there a way to fold sections while exporting to html

I am using Jupyter notebooks with jupyter-contrib-nbextensions and I can fold sections as well as code blocks in them. I want to know if there is a way to preserve the folding feature when the notebook is exported to html. Currently when I export to html, I can't fold anything. The notebook becomes cumbersome to handle if it's long, even if there's a table of contents. I'll appreciate any ideas in this regard. Thanks!

like image 673
blehblehblecksheep Avatar asked Oct 20 '25 16:10

blehblehblecksheep


1 Answers

According to the docs for the "Collapsible Headings"-extension in nbextensions, you should be able to export a foldable html-file by using the html_ch format:

jupyter nbconvert --to html_ch FILE.ipynb
like image 61
Janus Avatar answered Oct 23 '25 05:10

Janus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!