【问题标题】:How do I launch jupyter lab with the dark theme enabled by default?如何在默认启用深色主题的情况下启动 jupyter lab?
【发布时间】:2020-09-10 09:13:01
【问题描述】:

this question 的答案指出,“JupyterLab Dark”主题现在可以作为原版jupyter-lab 安装的一部分使用。

我如何配置jupyter-lab 以便它在启动时使用已经应用的主题在第一次启动时,这样我就不必在每次启动我的 jupyter docker 容器时手动选择它了?

【问题讨论】:

标签: jupyter jupyter-lab


【解决方案1】:

当我使用 jupyter docker stacks 时,mike 的回答和 MarkusOdenthal 的评论对我不起作用,我寻找了一个不同的解决方案,它使用 overrides.json 接缝是当前推荐的方法:

https://jupyterlab.readthedocs.io/en/stable/user/directories.html#overridesjson

简而言之: 使用jupyter lab path 检查应用程序目录并放置一个名为overrides.json 的文件,其中包含

{
    "@jupyterlab/apputils-extension:themes": {
        "theme": "JupyterLab Dark"
    }
}

进入<application directory>/settings/(例如,/opt/conda/share/jupyter/lab/settings/ 用于官方 jupyter docker 容器)

因此,如果您想从 jupyter 获得带有深色主题的基础映像,则 Dockerfile 将是

FROM jupyter/base-notebook

COPY overrides.json /opt/conda/share/jupyter/lab/settings/

【讨论】:

    【解决方案2】:

    把这个放在~/.jupyterlab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings

    {
        "theme": "JupyerLab Dark"
    }
    

    在 Dockerfile 中可能如下所示:

    RUN mkdir -p ~/.jupyterlab/user-settings/@jupyterlab/apputils-extension/ && \
        echo '{ "theme":"JupyterLab Dark" }' > themes.jupyterlab-settings
    

    【讨论】:

    • 在 saturncloud.io 中,您需要从 @mike 稍微更改 URL。 mkdir -p ~/.jupyter/lab/jupyterlab/user-settings/@jupyterlab/apputils-extension/ && echo '{ "theme":"JupyterLab Dark" }' > theme.jupyterlab-settings
    猜你喜欢
    • 2020-04-27
    • 1970-01-01
    • 2021-12-20
    • 1970-01-01
    • 2019-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-05
    相关资源
    最近更新 更多