Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine 'toc' and 'hide input' when using nbconvert html export

I would like to export my Jupyter notebook to html displaying the table of contents (toc2) AND hiding the input cells at the same time in the export.

I use a template to hide the code (https://github.com/ihuston/jupyter-hide-code-html), which works fine for itself.

For displaying the table of contents I run the command jupyter nbconvert --to html_toc FILE.ipynb, which works as well.

As soon as I try to combine both by jupyter nbconvert --to html_toc --template HIDE_CELL FILE.ipynb, only cells are hidden, but the toc is not shown anymore. Has anyone found a solution to combine both functions?

Thank you for your help!

like image 649
Zoe_89 Avatar asked Apr 19 '18 16:04

Zoe_89


1 Answers

I tried this command below and it hides the code and generates table of contents:

jupyter nbconvert /path/filename --to=html_toc --TemplateExporter.exclude_input=True

The above worked for: Ubuntu 18.10 and jupyter lab.

like image 55
user2919106 Avatar answered Nov 13 '22 23:11

user2919106