我为使用JLAB做的自定义调整
项目描述
jupyterlab_tpt
我为使用JLAB做的自定义调整;一些本可以放入nb classic中的custom.js
...
需求
- JupyterLab >= 4.0.0
- jupyterlab-myst
安装
要安装扩展,执行
pip install jupyterlab_tpt
卸载
要删除扩展,执行
pip uninstall jupyterlab_tpt
其他命令和快捷键
在命令面板中搜索convenience
以查看命令列表和相关的快捷键
以及为单元格周围添加/删除说明
命令 | 快捷键 |
---|---|
admonition:toggle |
Ctrl-\ Ctrl-A |
admonition:toggle-tip |
Ctrl-\ Ctrl-T |
admonition:toggle-note |
Ctrl-\ Ctrl-N |
admonition:toggle-attention |
|
admonition:toggle-caution |
|
admonition:toggle-danger |
|
admonition:toggle-error |
|
admonition:toggle-hint |
|
admonition:toggle-important |
|
admonition:toggle-seealso |
|
admonition:toggle-warning |
开发
开发安装
注意:您需要NodeJS来构建扩展包。
jlpm
命令是JupyterLab安装的yarn的固定版本。您可以使用以下代码中的yarn
或npm
代替jlpm
。
# Clone the repo to your local environment
# Change directory to the jupyterlab_tpt 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_tpt
在开发模式下,您还需要删除由 jupyter labextension develop
命令创建的符号链接。要找到其位置,可以运行 jupyter labextension list
以确定 labextensions
文件夹的位置。然后您可以删除该文件夹中名为 jupyterlab-tpt
的符号链接。
打包扩展
请参阅 RELEASE
我的笔记
-
关于使用信号 https://github.com/jupyterlab/extension-examples/tree/master/signals
-
一个非常有用的示例,在更改上武装回调 https://discourse.jupyter.org/t/how-to-get-output-model-for-a-given-cell-in-a-jupyterlab-extension/11342/6
-
等待笔记本上下文准备好
notebookContext: DocumentRegistry.IContext<INotebookModel> notebookContext.ready.then(() => { /* * The order of operations here is key. First, create a model that contains a log of * executed cells and the state of the gather UI. */ let notebookModel = notebookContext.model; ... })
项目详情
下载文件
下载您平台上的文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源分布
构建分布
jupyterlab_tpt-0.8.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e89372394db3d715aff6831b14f704ada87af9c75edaab2172b4152c252acfc6 |
|
MD5 | 76dadb90fa5ed6cc8d80c6ce837f9c76 |
|
BLAKE2b-256 | a85f1099373402e18121bd8038d6971ff23a191c8a21031bf5e5b5bd49678098 |
jupyterlab_tpt-0.8.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 85bdf956a428f32daf8c75a2552f6764ae21cfa48d4b58e7b7f193e77efc9512 |
|
MD5 | f3ddee1781d322cf7c0ab3929b61df90 |
|
BLAKE2b-256 | 97933b782532051901403e979b6ef024b23918c43357a9088596ae07590937cc |