Skip to main content

JupyterLab theme extension with dark background and low saturation

Project description

jupyterlab_lavender

Github Actions StatusBinder

lavender, in files jupyterlab_lavender, is a JupyterLab theme extension with a dark background, high contrast and low saturation. Example:

See also here for the similar lavender Matplotlib styles.

Requirements

  • JupyterLab >= 4.0.0

How to Use

Install the theme using one of the methods here. It should be available to use under Settings -> Theme. Check installation with

jupyter labextension list

Install with pip

Install from PyPI with

pip install jupyterlab_lavender

Or build locally (requires NodeJS) with

pip install git+https://github.com/tinjano/jupyterlab_lavender

Alternatives

  • Clone this repository with
git clone https://www.github.com/tinjano/jupyterlab_lavender

In the new folder, build (required NodeJS) with

pip install -e .
jupyter labextension develop . --overwrite
jlpm run build
  • You can also build your own extension, latest template with guide here, then copy the file style/variables.css, set isLight to false in src/index.ts and build as above.

Uninstalling

If installed with pip

pip uninstall jupyterlab_lavender

Else use jupyter labextension list to find the folder with extensions. (it could be $HOME/.local/share/jupyter/labextensions) and run

rm -rf path_to_folder/jupyterlab_lavender

How to Make Your Own Extension

Since this is a niche topic, I would like to share my experience. For the latest template with a guide see here, then see examples with their guides. In the case of a theme extension, the most important file is style/variables.css. I have had problems with updating the extension (the expected changes would not be visible and would indeed not be built). Oddly, the only solution that consistently worked was repeating this twice: uninstall the extension and build as above. See also here for info on packaging.

Issues

The use of CSS variables from style/varibles.css can be different with different version of JupyterLab. Feel free to open an issue if this happens.

The rest of this README is inherited from the extension template.

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the lavender directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Development uninstall

pip uninstall lavender

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named lavender within that folder.

Testing the extension

Frontend tests

This extension is using Jest for JavaScript code testing.

To execute them, execute:

jlpm
jlpm test

Integration tests

This extension uses Playwright for the integration tests (aka user level tests). More precisely, the JupyterLab helper Galata is used to handle testing the extension in JupyterLab.

More information are provided within the ui-tests README.

Packaging the extension

See RELEASE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlab_lavender-0.1.1.tar.gz (454.8 kB view hashes)

Uploaded Source

Built Distribution

jupyterlab_lavender-0.1.1-py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page