Skip to content

Automattic/jupyterlab_templates

 
 

Repository files navigation

Support for jupyter notebook templates in jupyterlab

Build Status codecov PyPI PyPI npm FINOS Active Binder

Install

PyPI

jupyterlab_templates is available on PyPI:

pip install jupyterlab_templates

Conda

jupyterlab_templates is also available on conda-forge:

conda install -c conda-forge jupyterlab_templates

Jupyter Server/JupyterLab Extension

jupyter labextension install jupyterlab_templates
jupyter server extension enable --py jupyterlab_templates

Adding templates

install the server extension, and add the following to jupyter_notebook_config.py

c.JupyterLabTemplates.template_dirs = ['list', 'of', 'template', 'directories']
c.JupyterLabTemplates.include_default = True
c.JupyterLabTemplates.include_core_paths = True

HDFS path

HDFS paths are supported by setting the hdfs:// prefix in the template_dirs list and can be used with local paths. The For example:

c.JupyterLabTemplates.template_dirs = ['hdfs://path/to/template/directory', '/local/path']

Note: The fs.defaultFS from core-site.xml will be used to define the connection to HDFS.

## Templates for libraries
The extension will search *subdirectories* of each parent directory specified in `template_dirs` for templates.
**Note!** Templates in the parent directories will be ignored. You must put the templates in *subdirectories*, in order to keep everything organized.  

If `include_default = True` the `notebook_templates` directory under the [jupyter data folder](https://jupyter.readthedocs.io/en/latest/use/jupyter-directories.html) is one of the default parent directories. Thus, if you have tutorials or guides you'd like to install for users, simply copy them into your jupyter data folder inside the `notebook_templates` directory, e.g. `/usr/local/share/jupyter/notebook_templates/bqplot` for `bqplot`.


### Flags
- `template_dirs`: a list of absolute directory paths. All `.ipynb` files in any *subdirectories* of these paths will be listed as templates
- `include_default`: include the default Sample template (default True)
- `include_core_paths`: include jupyter core paths (see: jupyter --paths) (default True)


## Development

See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.


## License

This software is licensed under the Apache 2.0 license. See the
[LICENSE](LICENSE) and [AUTHORS](AUTHORS) files for details.

About

Support for jupyter notebook templates in jupyterlab

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 47.9%
  • JavaScript 34.5%
  • Makefile 17.2%
  • Shell 0.4%