Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Apr 12, 2023
1 parent 762d287 commit 58d7093
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# JupyterLab extension-cookiecutter-ts
# JupyterLab extension template

[![Github Actions Status](https://github.com/jupyterlab/extension-cookiecutter-ts/workflows/CI/badge.svg)](https://github.com/jupyterlab/extension-cookiecutter-ts/actions/workflows/main.yml)

A [cookiecutter](https://github.com/audreyr/cookiecutter) template for creating
A [copier](https://copier.readthedocs.io) template for creating
a JupyterLab extension. Three kinds of extension are supported:
- _frontend_: Pure frontend extension written in TypeScript.
- _server_: Extension with frontend (in TypeScript) and backend (in Python) parts.
- _theme_: Theme for JupyterLab (using CSS variables).

> See also [extension-cookiecutter-js](https://github.com/jupyterlab/extension-cookiecutter-js)
for an extension in CommonJS.

## Use the template to create package

Install cookiecutter.
1. Install copier and some plugins.

```sh
pip install "copier>=7.1.0" jinja2-time
```
pip install cookiecutter

2. Go into the extension directory

```sh
mkdir myextension
cd myextension
```

Use cookiecutter to generate a package, following the prompts to fill in the name and authorship of your new JupyterLab extension.
3. Use copier to generate a package, following the prompts to fill in the name and authorship of your new JupyterLab extension.

```
cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts --checkout 4.0
copier https://github.com/jupyterlab/extension-cookiecutter-ts .
```

The available options are:
Expand All @@ -41,15 +45,15 @@ The available options are:
- `test`: Whether to add test set ups and skeletons for the extension or not
- `repository`: Version Control System repository URI

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

If you'd like to generate a package for a specific JupyterLab release, use the `--checkout` option and give a tag or commit from this repository.

```
cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts --checkout v1.0
cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts --checkout v2.0
cookiecutter https://github.com/jupyterlab/extension-cookiecutter-ts --checkout 3.0
```sh
copier --vcs-ref v4.0.0 https://github.com/jupyterlab/extension-cookiecutter-ts
```

> If you are looking for a template compatible with JupyterLab version prior to 4.0.0, look at
> the [cookiecutter template](https://github.com/jupyterlab/extension-cookiecutter-ts).
## 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](https://github.com/jupyterlab/extension-examples) repository for more information on various JupyterLab features.

0 comments on commit 58d7093

Please sign in to comment.