hide code in jupyter notebook

后端 未结 4 1364
时光取名叫无心
时光取名叫无心 2021-01-06 22:23

I have a jupyter notebook that is a mixture of markdown and code. In the end I want to render it out as a pdf report and hide the code. I still want to see the output of t

4条回答
  •  耶瑟儿~
    2021-01-06 22:44

    If you don't fancy writing your own template, and you're not bothered about outputs, you could use the hide_input_all nbextension, which is provided as part of the jupyter contrib nbextensions package. This provides buttons to hide the inputs (though not outputs) of all code cells, as well as setting metadata items that allow you to export with hidden inputs to html, latex or pdf using templates provided by the package:

    jupyter nbconvert --template=nbextensions --to=html my_notebook.ipynb
    

提交回复
热议问题