使用nbconvert html导出时组合"toc"和“隐藏输入" [英] Combine 'toc' and 'hide input' when using nbconvert html export

查看:637
本文介绍了使用nbconvert html导出时组合"toc"和“隐藏输入"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Jupyter笔记本导出为html,以显示目录(toc2),并在导出的同时隐藏输入单元格.

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.

我使用模板隐藏代码( https://github.com/ihuston/jupyter-hide-code-html ),它本身就可以正常工作.

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

为了显示目录,我运行命令jupyter nbconvert --to html_toc FILE.ipynb,它也可以正常工作.

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

当我尝试通过jupyter nbconvert --to html_toc --template HIDE_CELL FILE.ipynb合并两者时,只有单元格被隐藏,但toc不再显示.有没有人找到结合这两种功能的解决方案?

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?

谢谢您的帮助!

推荐答案

我在下面尝试了此命令,它隐藏了代码并生成了目录:

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

以上内容适用于:Ubuntu 18.10和jupyter lab.

The above worked for: Ubuntu 18.10 and jupyter lab.

这篇关于使用nbconvert html导出时组合"toc"和“隐藏输入"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆