跳转到主要内容

限制文本输出.mime渲染

项目描述

jupyterlab-limit-output

PyPI version PyPI DM Github Actions Status Binder

限制单个mime渲染的长时间文本输出。

Limit OutputScreenshot

这灵感来源于笔记本版本这里

设置

使用 设置->高级用户设置->限制输出 设置头部和/或尾部限制。您还可以按字符而不是按行进行限制。此扩展也可以启用/禁用,以允许网站范围安装。

注意:这是基于每个mime渲染的。例如,想象一个单元格输出大量交替的stdout和stderr行。此扩展无法帮助,因为每一行都是自己的mime渲染器(lab本身将通过限制显示的渲染数量来帮助)。

要求

  • JupyterLab >= 3.0

安装

使用 pip 安装此软件包,请运行

pip install jupyterlab_limit_output

使用 conda 安装此软件包,请运行

conda install -c conda-forge jupyterlab_limit_output

贡献

开发安装

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

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

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

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

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

jupyter lab build --minimize=False

发布

开始之前,您需要运行: pip install twine jupyter_packaging

  1. 更新 package.json 中的版本并更新 CHANGELOG.md 中的发布日期
  2. 提交第 1 步中的更改,标记它,然后推送
git commit -am <msg>
git tag vX.Z.Y
git push && git push --tags
  1. 创建工件
rm -rf dist jupyterlab_limit_output/labextension
jlpm run build
python setup.py sdist bdist_wheel
  1. 在此测试测试 pypi。您也可以从这里安装以进行测试
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# In a new venv
pip install --index-url https://test.pypi.org/simple/ jupyterlab_limit_output
  1. 将其上传到 pypi
twine upload dist/*

卸载

pip uninstall jupyterlab_limit_output

历史

此插件由 D. E. Shaw group 贡献给社区。

D. E. Shaw Logo

许可证

此项目在 BSD-3-Clause 许可证 下发布。

我们热爱贡献!在您能够贡献之前,请签署并提交此 贡献者许可协议 (CLA)。此 CLA 的目的是保护此项目的所有用户。

"Jupyter" 是 NumFOCUS 基金会的商标,Project Jupyter 是其一部分。

项目详情


下载文件

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

源分布

jupyterlab_limit_output-2.0.0.tar.gz (111.7 kB 查看散列)

上传时间

构建分布

jupyterlab_limit_output-2.0.0-py3-none-any.whl (504.8 kB 查看散列)

上传时间 Python 3

由以下支持

AWSAWS 云计算和安全赞助商 DatadogDatadog 监控 FastlyFastly CDN GoogleGoogle 下载分析 MicrosoftMicrosoft PSF赞助商 PingdomPingdom 监控 SentrySentry 错误日志 StatusPageStatusPage 状态页面