通过文件名的一部分快速打开JupyterLab中的文件
项目描述
jupyterlab-quickopen
通过输入文件名的一部分快速打开JupyterLab中的文件
https://github.com/user-attachments/assets/77567c89-ad52-4be8-b0e4-612700353242
兼容性
- Python >=3.8.x
- JupyterLab >=3.2
- Jupyter Server >=2.4
- 配置,其中笔记本文档和其他文件位于Jupyter Server的本地文件系统上(默认情况),而不是远程存储(例如,S3)
用法
安装扩展后,您可以通过按 Ctrl Shift P
(或 macOS 上的 Cmd P
)打开快速打开面板。开始输入您要打开的文件名,快速打开面板将显示与您输入的文本匹配的文件列表。
https://github.com/user-attachments/assets/77567c89-ad52-4be8-b0e4-612700353242
此扩展也适用于 Jupyter Notebook 7
https://github.com/user-attachments/assets/49147847-2b98-4016-8a11-5d0e8d9749e1
安装
pip install jupyterlab-quickopen
配置
使用自定义键盘快捷键
打开快速打开面板的默认键盘快捷键是 Accel Ctrl P
。
您可以在任何时间分配自己的键盘快捷键来显示快速打开面板。通过单击 设置 → 高级设置编辑器 → 键盘快捷键 打开键盘编辑器。然后在 用户覆盖 文本区域中输入以下 JSON,调整 keys
值以分配您选择的快捷键
{
"shortcuts": [
{
"command": "quickopen:activate",
"keys": ["Accel Ctrl P"],
"selector": "body",
"title": "Activate Quick Open",
"category": "Main Area"
}
]
}
要排除的图案
您可以使用 Jupyter 服务器设置、JupyterLab 设置或两者来控制要排除的文件。
在服务器端,使用 ContentsManager.allow_hidden
和/或 ContentsManager.hide_globs
设置。有关 Jupyter 服务器选项的详细信息,请参阅 文档。
在 JupyterLab 网页应用中,打开 设置 菜单,单击 高级设置编辑器 选项,在 原始视图 侧边栏中选择 快速打开 项,并在 用户覆盖 文本区域中输入 JSON 以覆盖默认值。
开发安装
注意:您将需要 NodeJS 来构建扩展包。
jlpm
命令是 JupyterLab 随附的 yarn 版本。您可以使用以下命令代替 jlpm
:
# Clone the repo to your local environment
# Change directory to the jupyterlab_quickopen directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable jupyterlab_quickopen
# 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
发布
参阅 RELEASE
致谢
此扩展最初由 Peter Parente 创建,后来被移动到 jupyterlab-contrib
GitHub 组织。
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。