【发布时间】:2021-06-21 03:35:38
【问题描述】:
尝试将 .ipynb 笔记本转换为 Markdown,其中包含用于 Jekyll 站点(托管在 GitHub Pages 上)中的 Plotly 图表。我遇到了这个错误:
Liquid Exception: Liquid syntax error (line 134): Variable '{{ x.observe(notebookContainer, {childList: true}' was not properly terminated with regexp: /\}\}/ bundler: failed to load command: jekyll
使用这个简单的笔记本来复制这个问题,链接here。 Markdown 转换后的文件是here。
我尝试从 Jupyter 以转换格式(.md 和 .html)下载笔记本,但我遇到了同样的错误。当文件在我的项目目录中时,程序在启动时冻结,也无法在 Xcode 中打开 Markdown 文件。
非常感谢您对此问题的任何帮助。
编辑:提到的解决方法here 是删除init_notebook_mode() 和pio.renderers.default = 'jupyterlab'。同时避免使用pio.write_html() 直接在笔记本中渲染 Plotly。导出到.md,添加YAML前端,然后调用{% include figure_name.html %}。
【问题讨论】:
标签: plotly markdown jupyter jekyll liquid