Skip to main content

Jupyterlab extension that makes the tabs coloured (using pastel colours) to help you find tab when many of them are opened. Colour persists between refreshes

Project description

jupyterlab_colourful_tab_extension

GitHub Actions npm version PyPI version Total PyPI downloads JupyterLab 4 Brought To You By KOLOMOLO Donate PayPal

[!TIP] This extension is part of the stellars_jupyterlab_extensions metapackage. Install all Stellars extensions at once: pip install stellars_jupyterlab_extensions

A JupyterLab extension that applies pastel colours to tabs for visual identification when many tabs are open.

Coloured tabs make it easy to identify different notebooks and files at a glance.

Right-click any tab to select a colour from the "Tab Colour" submenu.

Features

Assign colours to tabs via right-click context menu for easy visual identification when working with multiple notebooks and files.

Colour options:

  • Red, Orange, Yellow, Green, Blue, Purple
  • Pastel shades optimised for both light and dark themes

Key features:

  • Right-click any tab to assign a colour from the "Set Tab Colour" submenu
  • Selected (active) tab shows a distinct shade of its colour so it stands out from other coloured tabs
  • Colours persist across browser refreshes via localStorage - a file keeps its colour by path, a terminal for as long as its session runs
  • Notebook toolbar matches the active tab colour
  • A terminal's colour is released once its session ends, so the next terminal to reuse that number starts clear
  • Tabs with no lasting identity of their own (the launcher, for example) can still be coloured, but the colour lasts only for the session

Yes, this is yet another mass-produced JupyterLab extension that does one trivially simple thing. We are almost embarrassed by how utterly unremarkable it is - just some CSS classes and a context menu. But someone had to do it, and here we are. You're welcome.

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

pip install jupyterlab_colourful_tab_extension

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_colourful_tab_extension

Extension API

Other extensions can tint a widget's tab programmatically via the public IColourfulTabs token.

  • Import the token from jupyterlab_colourful_tab_extension and request it as an optional (or requires) plugin dependency
  • Call setColour(widget, colourId) where colourId is one of rose, peach, lemon, mint, sky, lavender, or null to clear
  • The tint rides the widget's Lumino title.className, so it survives tab re-renders and reordering with no DOM querying
  • Programmatic colours are independent of the right-click menu's localStorage-persisted colours
import {
  JupyterFrontEnd,
  JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { IColourfulTabs } from 'jupyterlab_colourful_tab_extension';

const plugin: JupyterFrontEndPlugin<void> = {
  id: 'my_extension:plugin',
  autoStart: true,
  optional: [IColourfulTabs],
  activate: (app: JupyterFrontEnd, colourfulTabs: IColourfulTabs | null) => {
    if (colourfulTabs) {
      colourfulTabs.setColour(widget, 'sky');
    }
  }
};

[!IMPORTANT] The consumer must declare jupyterlab_colourful_tab_extension as a shared singleton in its package.json jupyterlab.sharedPackages block (with "bundled": false). Without it, module federation serves two copies of the token and the optional dependency silently resolves to null.

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_colourful_tab_extension-1.1.13.tar.gz (600.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file jupyterlab_colourful_tab_extension-1.1.13.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_colourful_tab_extension-1.1.13.tar.gz
Algorithm Hash digest
SHA256 632671dee4edbb1b34ec840f346b2f9d5cd1fc44057b4f3ed926d41b039f56b2
MD5 579e04285f6768e123db5a72c524560f
BLAKE2b-256 95717bde7ffeae09183e2c4c1724dfbbf60e5c5b4d58e95e0cf130ec30976f55

See more details on using hashes here.

File details

Details for the file jupyterlab_colourful_tab_extension-1.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_colourful_tab_extension-1.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 587da5b355e6e14f61634f04e82322d9a327c7ab04b517ffa5249216420fb3dc
MD5 c1282c07ea0ae734c37ef32eb3c66d79
BLAKE2b-256 22d07cd32bd25a000cf45425511ecb69530939cd374744c283138155a99f08dd

See more details on using hashes here.

Supported by

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