【发布时间】:2021-12-09 15:59:56
【问题描述】:
关于如何更改所有内容的字体系列有很多答案。但是,我想进行特定于语法的更改,例如,将 Python 注释字体样式从斜体更改为正常。有人可以帮我吗?谢谢!
在 VS Code 中做同样的事情也有类似的问题。 How to change Python comment font style in the latest VS Code?
【问题讨论】:
标签: python css jupyter jupyter-lab
关于如何更改所有内容的字体系列有很多答案。但是,我想进行特定于语法的更改,例如,将 Python 注释字体样式从斜体更改为正常。有人可以帮我吗?谢谢!
在 VS Code 中做同样的事情也有类似的问题。 How to change Python comment font style in the latest VS Code?
【问题讨论】:
标签: python css jupyter jupyter-lab
对于 JupyterLab 3.x,您可以安装 jupyterlab-fonts 并将其配置为在 Advanced Settings Editor 中将标记的字体与 cm-comment 类交换 → Fonts:
{
"styles": {
".CodeMirror-line span.cm-comment": {
"fontFamily": "Consolas",
"fontStyle": "normal"
}
}
}
您也可以:
【讨论】:
pip(本地)安装它,但它仅在 3.0 中引入,因此 JupyterLab 1.x 不支持(它会需要安装 Node.js 并重建实验室,这可能意味着您也不能这样做)。所以前进的方向是推动管理员升级(我们不再积极支持 1.x,最近的安全修复是例外)。
style/base.css 文件(已经存在)中添加样式。