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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file jupyterlab_lavender-0.1.1.tar.gz.

File metadata

  • Download URL: jupyterlab_lavender-0.1.1.tar.gz
  • Upload date:
  • Size: 454.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for jupyterlab_lavender-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f145b886727bea61663c21403b4b5e9ed226507d980c41325f5ed0b3ed39bfee
MD5 a7d9c09cc28cd2d67348f75834620680
BLAKE2b-256 d6dfcb34dedf05b633763cfa11664cf1c2fe79f3232fe9b8c18d03412a9d0963

See more details on using hashes here.

File details

Details for the file jupyterlab_lavender-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_lavender-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a36e96d3df46a65aadafdd90dd9aa3f20a023ae61e71cc76e636a29757240f10
MD5 a5cf275de276e7946d684bd32826a129
BLAKE2b-256 c43ff7b5ce7c1d94472f22ec4dfafe6931626c76830ab70639042f3458a90225

See more details on using hashes here.

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