kyl*_*han 5 html python jupyter jupyter-notebook nbconvert
我正在使用带有浅色主题的 JupyterLab,当我将笔记本导出为 HTML 时,我看到了这个:

设置的任何想法?
从命令行运行:
jupyter nbconvert --execute --to html /path/to/example.ipynb --HTMLExporter.theme=dark
添加--execute保证在保存之前渲染绘图。
您可以使用 Plotly 深色主题将绘图也设置为黑色
import plotly.io as pio
pio.templates.default = "plotly_dark"
Run Code Online (Sandbox Code Playgroud)
我有完全相同的问题。经过几个小时的调试后,我意识到它与库有关(至少对我来说)jupyter-theme。我安装了一个深色主题,我认为nbconverter使用您jupyter也在使用的任何设置,因此深色设置影响了 html 转换。
解决方案很简单,使用以下命令恢复默认值:
$ jt -r
如果这不起作用,请参阅此线程:https ://github.com/dunovank/jupyter-themes/issues/86
| 归档时间: |
|
| 查看次数: |
1437 次 |
| 最近记录: |