Skip to content

A `copier` template for JupyterLab extensions

License

Notifications You must be signed in to change notification settings

jupyterlab/extension-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

JupyterLab extension template

Github Actions Status

A copier template for creating a JupyterLab extension. Four kinds of extension are supported:

  • frontend: Pure frontend extension written in TypeScript.
  • mimerenderer: MIME renderer extension.
  • server: Extension with frontend (in TypeScript) and backend (in Python) parts.
  • theme: Theme for JupyterLab (using CSS variables).

Use the template to create extension

  1. Install copier and some plugins.

With pip:

pip install "copier~=9.2" jinja2-time

Or with conda / mamba:

conda install -c conda-forge "copier>=9.2,<10" jinja2-time
  1. Create an extension directory and go to it.
mkdir myextension
cd myextension
  1. Use copier to generate an extension, following the prompts to fill all required information.
copier copy --trust https://github.com/jupyterlab/extension-template .

If you are using Visual Studio Code, you may be interested in the configuration template for JupyterLab extension.


If you'd like to generate an extension for a older release, use the --vcs-ref option and give a tag or commit from this repository.

copier copy --vcs-ref v4.0.0 --trust https://github.com/jupyterlab/extension-template .

If you are looking for a template compatible with JupyterLab version prior to 4.0.0, look at the cookiecutter template or the mimerenderer template.

Update an extension to the latest template version

This only works with an older version of the copier template. It does not work with an extension generated using the cookiecutter template. In that case, you could try the script python -m jupyterlab.upgrade_extension.

Extension generated from the copier template can be updated with a newer version of the template by executing the command:

copier update --trust

A simple example

Your new extension includes a very simple example of a working extension. Use this example as a guide to build your own extension. Have a look at the extension examples repository for more information on various JupyterLab features.