JupyterLab的Nebari定制。
项目描述
jupyterlab_nebari_mode
JupyterLab的Nebari定制。
插件
jupyterlab-nebari-mode:logo
: 替换@jupyterlab/application-extension:logo
,添加可点击的Nebari标志:jupyterlab-nebari-mode:commands
添加以下命令nebari:open-proxy
用于打开代理进程,例如VSCode;此命令可以用于添加菜单项,例如{ "command": "nebari:open-proxy", "rank": 1, "args": { "name": "vscode" } }
nebari:run-first-enabled
执行第一个可用和启用的命令;它与内置的apputils:run-first-enabled
命令不同,因为它接受表示命令的对象列表,允许自定义label
、iconClass
、caption
、usage
和className
属性。用于菜单定制的示例用法是添加一个标签为在文件编辑器中导入numpy
的菜单项,当用户打开文件编辑器时,以及当用户打开笔记本时添加一个标签为在笔记本中导入numpy
的菜单项{ "command": "nebari:run-first-enabled", "rank": 1, "args": { "commands": [ { "id": "fileeditor:replace-selection", "label": "Import numpy in File Editor", "args": { "text": "import numpy as np" } }, { "id": "notebook:replace-selection", "label": "Import numpy in Notebook", "args": { "text": "import numpy as np" } } ] } }
需求
- JupyterLab >= 4.0.0
安装
要安装扩展,执行
pip install jupyterlab_nebari_mode
卸载
要删除扩展,执行
pip uninstall jupyterlab_nebari_mode
贡献
开发安装
注意:您需要NodeJS来构建扩展包。
《jlpm》命令是 JupyterLab 集成安装的yarn版本,它是 JupyterLab 的固定版本。您可以使用下面的《yarn》或《npm》代替《jlpm》。
# Clone the repo to your local environment
# Change directory to the jupyterlab_nebari_mode 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 build
您可以在不同的终端同时监视源目录并运行 JupyterLab,以监视扩展源代码的变化并自动重新构建扩展。
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
当监视命令运行时,每次保存的更改都将立即本地构建并可在您运行的 JupyterLab 中使用。刷新 JupyterLab 以在浏览器中加载更改(您可能需要等待几秒钟以重新构建扩展)。
默认情况下,《jlpm build》命令为此扩展生成源映射,使其更容易使用浏览器开发者工具进行调试。要为 JupyterLab 核心扩展也生成源映射,可以运行以下命令
jupyter lab build --minimize=False
开发模式卸载
pip uninstall jupyterlab_nebari_mode
在开发模式下,您还需要删除由《jupyter labextension develop》命令创建的符号链接。要找到其位置,可以运行《jupyter labextension list》以确定《labextensions》文件夹的位置。然后您可以删除该文件夹中的名为《jupyterlab-nebari-mode》的符号链接。
测试扩展
前端测试
此扩展使用Jest进行 JavaScript 代码测试。
要执行它们,请执行
jlpm
jlpm test
集成测试
此扩展使用Playwright进行集成测试(即用户级测试)。更准确地说,JupyterLab 辅助工具Galata用于处理在 JupyterLab 中测试扩展。
更多信息请参阅ui-tests README。
打包扩展
请参阅RELEASE
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪一个,请了解有关安装包的更多信息。
源分布
jupyterlab_nebari_mode-0.3.0.tar.gz (194.6 kB 查看哈希)
构建分布
关闭
jupyterlab_nebari_mode-0.3.0.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9686e192b8f66939d6117e274e7f7e6af836810238be9163a238fa399921759f |
|
MD5 | 4a7bdc05a3f211ab6c4ccc24e45d0dc6 |
|
BLAKE2b-256 | 4fcac22e3a261d5d9a286a0bca0056dc1986dda51a919f8638cad430ec06b4dc |
关闭
jupyterlab_nebari_mode-0.3.0-py3-none-any.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e51ad859ac7faa0ec610dff0c988d7882d52745a08dc17fca063256c563e237c |
|
MD5 | 04e0e1b66fb0dd1a5d16376cf2a2db21 |
|
BLAKE2b-256 | 76f11a36d58e7a933077617bc1c18918b4bc37d1c7fde8d6f3fec328400a0e62 |