跳转到主要内容

jupyter和jupyterlab的笔记本模板

项目描述

支持jupyter和jupyterlab的笔记本模板

Build Status codecov PyPI PyPI npm Binder

JupyterLab

Jupyter Notebook

安装

PyPI

jupyter-templatesPyPI上有提供

pip install jupyter-templates

Conda

jupyter-templates也在conda-forge上有提供

conda install -c conda-forge jupyter-templates

Jupyter服务器/JupyterLab扩展

jupyter-templates作为一个预构建的扩展提供,因此JupyterLab中无需采取进一步操作。

要显式安装,运行

jupyter labextension install jupyter-templates
jupyter server extension enable --py jupyter_templates

对于经典笔记本,运行

jupyter nbclassic-extension enable jupyter_templates/extension
jupyter server extension enable --py jupyter_templates

添加模板

安装服务器扩展,并将以下内容添加到jupyter_notebook_config.py

c.JupyterLabTemplates.allowed_extensions = ["*.ipynb"]
c.JupyterLabTemplates.template_dirs = ['list', 'of', 'template', 'directories']
c.JupyterLabTemplates.include_default = True
c.JupyterLabTemplates.include_core_paths = True
c.JupyterLabTemplates.template_label = "Template"

库模板

该扩展将在template_dirs中指定的每个父目录的子目录中搜索模板。**注意**!父目录中的模板将被忽略。您必须将模板放在子目录中,以便保持一切有序。

如果 include_default = True,则位于 jupyter 数据文件夹 下的 notebook_templates 目录是默认父目录之一。因此,如果您想为用户安装教程或指南,只需将它们复制到您的 jupyter 数据文件夹中的 notebook_templates 目录中即可,例如 /usr/local/share/jupyter/notebook_templates/bqplot 用于 bqplot

如果您想排除特定目录中的模板,请在此位置添加一个名为 .jupyter_templates_ignore 的文件。此目录中的所有笔记本都将被忽略(但不会影响子目录)。

标志

  • allowed_extensions:允许模板的扩展名列表。(可选,默认 ["*.ipynb"]
  • template_dirs:绝对目录路径列表。所有这些路径的任何 子目录 中匹配 allowed_extensions 的文件都将被列为模板
  • include_default:包含默认示例模板(默认 True)
  • include_core_paths:包含 jupyter 核心路径(见:jupyter --paths)(默认 True)
  • template_label:设置模板 UI 图标的标签(默认 "模板")

本软件根据 Apache 2.0 许可证授权。有关详细信息,请参阅 LICENSE 文件。

项目详情


下载文件

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

源分布

jupyter_templates-0.1.1.tar.gz (302.5 kB 查看哈希值

上传时间

构建分布

jupyter_templates-0.1.1-py3-none-any.whl (150.8 kB 查看哈希值

上传时间 Python 3

由以下机构支持

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