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

允我心安 提交于 2020-06-27 09:07:50

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/49926287/combine-toc-and-hide-input-when-using-nbconvert-html-export

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!