如何编辑Jupyter Lab主题 [英] How to edit jupyter lab theme
问题描述
如上一个问题中所述所述,编辑Jupyter Lab主题.但是,这个主题对我个人来说有一些问题.例如,由于其默认颜色为黑色,因此使绘图轴难以读取.其他用户拥有 类似问题.因此,我想分叉现有主题,并使绘图显示单元为浅灰色.如何做到这一点?
As described in a previous question, it is now possible to edit the Jupyter Lab theme. However, this theme has a few issues for me personally. For example, it makes plot axes hard to read, since their default color is black. Other users have had similar problems. Consequently, I would like to fork the existing theme and make plot display cells a light grey colour. How does one do this?
我试图找到相应的.css
文件,但我只能找到/usr/local/share/jupyter/lab/themes/@jupyterlab/theme-dark-extension/
.我知道我可以编辑index.css
来实现所需的功能,但是我该如何替代该主题并对其进行编辑?如何让Jupyter Lab知道我的自定义主题?
I tried to find the corresponding .css
file, but all I could find was /usr/local/share/jupyter/lab/themes/@jupyterlab/theme-dark-extension/
. I understand that I could edit the index.css
to achieve what I want, but how do I instead fork that theme and edit it? How do I let Jupyter Lab know about my custom theme?
推荐答案
我们正在使用版本0.35.x ... 以下步骤对我有用...它将创建灯光主题的克隆,将其安装在jupyter实验室中,您可以从设置菜单中进行选择.您可以自定义此主题,进行构建并在jupyter实验室中发挥作用
we are using version 0.35.x ... the following steps worked for me ... it will create a clone of the light theme, would install it in jupyter lab and you would be able to select that from settings menu. you can customize this theme, build it and have the effect in jupyter lab
- 从此处 https://docs.conda.io/zh-CN/latest安装miniconda/miniconda.html (选择python3.7一个)
- 打开Anaconda终端,[在Windows goto搜索类型Anaconda中,选择终端]
- 然后运行此
conda create -n jupyterlab-ext -c conda-forge --override-channels nodejs jupyterlab cookiecutter git
- 从此处克隆jupyterlab https://github.com/jupyterlab/jupyterlab.git
- 使用
git checkout 0.35.x
切换分支
- 然后
jlpm install
jlpm build
npm run create:theme
- 将主题文件夹复制到您选择的本地主题文件夹以进行扩展开发.将tsconfig.json内容替换为以下内容
- install miniconda from here https://docs.conda.io/en/latest/miniconda.html (chose python3.7 one)
- open Anaconda Terminal, [in windows goto search type Anaconda, select the terminal]
- then run this
conda create -n jupyterlab-ext -c conda-forge --override-channels nodejs jupyterlab cookiecutter git
- clone jupyterlab from here https://github.com/jupyterlab/jupyterlab.git
- switch branch with
git checkout 0.35.x
- then
jlpm install
jlpm build
npm run create:theme
- copy the theme folder to your chosen local theme folder for extension development. Replace tsconfig.json content with the following
{ "compilerOptions":
{ "declaration": true,
"lib": ["es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noUnusedLocals": true,
"outDir": "lib",
"rootDir": "src",
"strict": true,
"strictNullChecks": false,
"target": "es2015",
"types": []
},
"include": ["src/*"]
}
[由此处的步骤创建 https://jupyterlab .readthedocs.io/en/stable/developer/xkcd_extension_tutorial.html#xkcd-extension-tutorial]
{ "compilerOptions":
{ "declaration": true,
"lib": ["es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noUnusedLocals": true,
"outDir": "lib",
"rootDir": "src",
"strict": true,
"strictNullChecks": false,
"target": "es2015",
"types": []
},
"include": ["src/*"]
}
[created by the steps here https://jupyterlab.readthedocs.io/en/stable/developer/xkcd_extension_tutorial.html#xkcd-extension-tutorial]
在主题文件夹中..
- 运行以下命令
jlpm install
,jlpm run build
和jlpm run build:webpack
- 打开另一个conda终端,转到仓库文件夹并运行
conda activate jupyterlab-ext then jupyter labextension install .
- 在conda终端机
conda activate jupyterlab-ext
中,然后jupyter lab --watch
- run the following commands
jlpm install
,jlpm run build
,jlpm run build:webpack
- open another conda terminal, there go to repo folder and run
conda activate jupyterlab-ext then jupyter labextension install .
- in a conda terminal
conda activate jupyterlab-ext
then,jupyter lab --watch
对于1.0版,可以使用此cookie切割器... https://github.com/jupyterlab/主题-cookiecutter
For version 1.0 , this cookie cutter could be used ... https://github.com/jupyterlab/theme-cookiecutter
这篇关于如何编辑Jupyter Lab主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!