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).
- Install copier and some plugins.
With pip
:
pip install "copier~=7.2" jinja2-time "pydantic<2.0.0"
Or with conda
/ mamba
:
conda install -c conda-forge "copier>=7,<8" jinja2-time
- Create an extension directory and go to it.
mkdir myextension
cd myextension
- Use copier to generate an extension, following the prompts to fill all required information.
copier copy https://github.com/jupyterlab/extension-template .
If you use copier v8+, you will need to pass the flag
--UNSAFE
(see documentation).
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 --vcs-ref v4.0.0 copy https://github.com/jupyterlab/extension-template .
If you use copier v8+, you will need to pass the flag
--UNSAFE
(see documentation).
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.
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
If you use copier v8+, you will need to pass the flag
--UNSAFE
(see documentation).
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.