Jupyter notebook 如何在jupyter中使用代码折叠导出?

Jupyter notebook 如何在jupyter中使用代码折叠导出?,jupyter-notebook,Jupyter Notebook,我想将jupyter笔记本导出为html,并启用代码折叠扩展 我试着跟着 我在~/.jupyter/jupyter\u nbconvert\u config.py中尝试了以下几行 # # not working, tried one line at a time # Exporter.preprocessors += ['jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor'] # Exporter.prep

我想将jupyter笔记本导出为html,并启用代码折叠扩展

我试着跟着

我在
~/.jupyter/jupyter\u nbconvert\u config.py中尝试了以下几行

# # not working, tried one line at a time
# Exporter.preprocessors += ['jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor']
# Exporter.preprocessors += ['jupyter_contrib_nbextensions.nbconvert_support.pre_codefolding']
# c.Exporter.preprocessors.append('jupyter_contrib_nbextensions.nbconvert_support.pre_codefolding')

# working for cmd line, eg:
# jupyter nbconvert --to html my_nb.ipynbc.Exporter.preprocessors.append('jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor')
c.Exporter.preprocessors += ['jupyter_contrib_nbextensions.nbconvert_support.CodeFoldingPreprocessor']
c.CodeFoldingPreprocessor.remove_folded_code=True
以上内容在jupyter笔记本
文件中均不起作用
->
下载为
->
HTML(.HTML)

但是,命令行中的jupyter nbconvert--to html my_nb.ipynb
确实有效

Q:如何在jupyter笔记本中实现这一点?

仅供参考,我正在跑步:

  • jupyter_客户端5.1.0
  • jupyter_core 4.3.0
  • Python 3.6.2

我现在使用的记事本中有一个bug:
docker exec jupyter jupyter nbconvert--to html--CodeFoldingPreprocessor.remove_folded_code=True/home/jovyan/work/Notebook/test.ipynb