跳转到主要内容

JupyterLab中的一个按钮,用于运行代码单元格然后隐藏代码单元格。

项目描述

jupyterlab-hide-code: JupyterLab中的一个按钮,用于运行和隐藏代码

Github Actions StatusBinder

JupyterLab中的一个按钮,用于运行代码单元格然后隐藏代码单元格。

demo

需求

  • JupyterLab >= 4.0.0

安装

要安装扩展,请执行

pip install jupyterlab_hide_code

卸载

要删除扩展,请执行

pip uninstall jupyterlab_hide_code

贡献

开发安装

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

jlpm 命令是JupyterLab捆绑的 yarn 版本,它与JupyterLab一起安装。您可以使用 yarnnpm 替代以下 jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab_hide_code 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_hide_code

在开发模式下,您还需要删除由 jupyter labextension develop 命令创建的符号链接。要找到其位置,您可以运行 jupyter labextension list 以确定 labextensions 文件夹的位置。然后您可以在该文件夹中删除名为 jupyterlab_hide_code 的符号链接。

测试扩展

前端测试

此扩展使用 Jest 进行 JavaScript 代码测试。

要执行它们,请执行

jlpm
jlpm test

集成测试

此扩展使用 Playwright 进行集成测试(也称为用户级测试)。更确切地说,JupyterLab 助手 Galata 用于处理在 JupyterLab 中测试扩展。

更多详细信息请参阅 ui-tests 的 README 文件。

打包扩展

参见 RELEASE

致谢

我们感谢 EPFL Open Science Fund 通过 OSSCAR 项目提供支持。

项目详情


下载文件

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

源分布

jupyterlab_hide_code-4.0.0.tar.gz (167.8 kB 查看散列值)

上传时间

构建分布

jupyterlab_hide_code-4.0.0-py3-none-any.whl (45.3 kB 查看散列值)

上传时间 Python 3

由以下支持

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