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 simiar lavender Matplotlib styles.

Requirements

  • JupyterLab >= 4.0.0

How to Use

Install the theme in one of the ways listed. It should be available to use under Settings -> Theme. Check installation with

jupyter labextension list

pip install

Coming soon

Alternative

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

In the new folder, build (note that NodeJS is required) 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 install as above.

Uninstalling

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

Uninstalling with pip will not be complete.

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, followed by src/index.ts and style/index.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.

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.0.tar.gz (454.6 kB view details)

Uploaded Source

Built Distribution

jupyterlab_lavender-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyterlab_lavender-0.1.0.tar.gz
  • Upload date:
  • Size: 454.6 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.0.tar.gz
Algorithm Hash digest
SHA256 67d1e095148ef86f7ef7c28f17968d20708e5f06ec50742530bdbb4751b84e2b
MD5 9ef291accf871a47a2fd8e005da87d58
BLAKE2b-256 352457a31a42311ea8b8eb47c32122ca5e40420817f0d29405dc159e3243127a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlab_lavender-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d423b6949f96ddd488848fd6b9af13bba48f5d60991e4155e66e8b356325e9a
MD5 cb236bbe4cf1abd358761204fb3c1684
BLAKE2b-256 86b359dedb1e78886104cacb9dc7de56dfc4bf7bfd9fa12a40e22e81c9cf6562

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