跳转到主要内容

JupyterLab工具栏主题切换器

项目描述

jupyterlab-theme-toggle

JupyterLab扩展,用于在顶部区域切换主题。

screencast

此扩展最初作为jupyterlab-topbar项目的一部分开发,后来提取到其自己的仓库中,并被带回jupyterlab-topbar项目。

先决条件

  • JupyterLab 1.0+

安装

JupyterLab 4.x

从JupyterLab 4.0开始,扩展可以作为Python包分发。使用版本1.0.0,因为其他版本与JupyterLab 4不兼容

pip install jupyterlab-theme-toggle==1.0.0

JupyterLab 2.x和3.x

此扩展需要JupyterLab的jupyterlab-topbar-extension扩展来显示视觉切换

jupyter labextension install jupyterlab-topbar-extension jupyterlab-theme-toggle

仅安装快捷键(默认为Cmd/Ctrl+y

jupyter labextension install jupyterlab-theme-toggle

开发

JupyterLab 4.x

注意:您需要NodeJS来构建扩展包。

jlpm命令是JupyterLab附带安装的yarn的固定版本。您可以使用yarnnpm代替下面的jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab-logout directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以便监视扩展源代码中的更改并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

在运行watch命令时,每次保存的更改都会立即在本地构建,并在您的运行JupyterLab中可用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟,以便扩展重建)。

默认情况下,jlpm run build命令为该扩展生成源映射,以便使用浏览器开发者工具更容易地进行调试。要为JupyterLab核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

JupyterLab 3.x

# create a new conda environment
conda create -n jupyterlab-theme-toggle jupyterlab nodejs
conda activate jupyterlab-theme-toggle

# required to place indicators in the top area
jupyter labextension install jupyterlab-topbar-extension

# install dependencies
jlpm

# local install of the extension
jupyter labextension install .

重建软件包和JupyterLab应用

jlpm run build
jupyter lab build

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

jupyterlab_theme_toggler-1.0.0.tar.gz (961.7 kB 查看哈希值)

上传时间

构建分发

jupyterlab_theme_toggler-1.0.0-py3-none-any.whl (301.4 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面