python - JupyterLab + Reveal.JS → 如何隐藏代码单元?

标签 python jupyter-lab reveal.js

我想知道如何在导出到 Reveal.JS 时隐藏笔记本中的代码单元

最佳答案

从幻灯片单元格开始,例如

enter image description here

I) 使用“属性检查器”添加标签:

# In JupyterLab → Property Inspector → Cell Metadata
{
    "tags": [
        "remove-input"
    ]
}

enter image description here

II) 使用 nbconvert 手动转换为幻灯片,指定一个预处理器,该处理器将删除具有给定标签的单元格中的输入,例如:

jupyter nbconvert Presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"remove-input\"} --post serve --SlidesExporter.reveal_theme=simple

result

输出的 html 文件将在 Presentation.slides.html 中。

基于 this comment .

关于python - JupyterLab + Reveal.JS → 如何隐藏代码单元?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67685650/

相关文章:

python - 命令帮助(通过 -h) 其中 `argparse` 是范围检查输入端口号

python - 从生成器创建两个串联数组

javascript - 使用 Selenium 在 Python 中滚动到页面顶部

ipython-notebook - 自定义 IPython 笔记本/Jupyter 幻灯片放映

Windows 7 中的 Python 文件资源管理器

python-3.x - 无法在 Windows 7 中从 cmd 启动 Jupyter 实验室

python - 使用动态命名导出多个 csv 文件

python - TensorFlow 模型的 tf.data 管道中存在问题

javascript - 在 reveal.js 中调暗背景图像

css - 如何将 <blink> 添加到 reveal.js 幻灯片?