笔记本7中的自定义主题#

在Notebook 7中,创建自定义主题的方式发生了变化。这意味着为Notebook 6或更早版本开发的定制主题不适用于Notebook 7及更高版本。

例如,社区贡献的主题就是这样的情况 [jupyter-themes] (https://github.com/dunovank/jupyter-themes).)

使用自定义主题#

幸运的是,为Notebook 7安装定制主题非常容易。这与安装常规扩展的过程相同。

例如,假设您想要安装 [JupyterLab Night] (https://github.com/martinRenou/jupyterlab-night)主题。您可以通过运行以下命令来执行此操作:

pip install jupyterlab-night

然后刷新页面,您应该会在设置菜单中看到新的主题:

好了! [a screencast showing how to install a custom theme] (https://user-images.githubusercontent.com/591645/229583076-de3c0541-246f-4781-8941-fcbec2204038.gif)

上已经有许多主题可用 [PyPI] (https://pypi.org/search/?q=jupyterlab-theme).

您还可以使用 jupyterlab-theme GitHub话题:https://github.com/topics/jupyterlab-theme

例如:

  • [https://github.com/johnnybarrels/jupyterlab_onedarkpro] (https://github.com/johnnybarrels/jupyterlab_onedarkpro)

  • [https://github.com/dunovank/jupyterlab_legos_ui] (https://github.com/dunovank/jupyterlab_legos_ui)

  • [https://github.com/timkpaine/jupyterlab_miami_nights] (https://github.com/timkpaine/jupyterlab_miami_nights)

创建自定义主题#

为Notebook 7创建自定义主题的过程与为JupyterLab 4创建自定义主题的过程相同。

See the Frontend Extension Guide to get you started. When creating the extension, select the Theme option in the cookiecutter prompt.