Skip to main content

jupyterlab_empinken_extension

A JupyterLab extension for colouring notebook cell backgrounds.

Builds on jupyterlab-celltagsclasses and earlier versions of jupyterlab_empinken_extension.

empinken backgrounds

empinken settings

The buttons set tags on selected cells and the cell is styled correspondingly.

In v0.6.x:

New empinken MDI icons - book-open-outline, check, school-outline, format-quote-close

  • book / book-open-outline icon: "activity" [maps to style-activity cell tag], by default, a blue background; used to idnetify activity blockls (follows OU VLE theme);
  • tick / check icon: "solution" [maps to style-solution cell tag], by default, a green background; used to identify solution cells;
  • head/mortarboard ("scholar") / school-outline icon: "learner" [maps to cell tag style-learner], by default, a yellow background; used as a nudge to students ("you should edit / add content to this cell");
  • quote / format-quote-close icon: "tutor" [maps to cell tag style-tutor], by default, a pink background; used by tutors to highlight feedback cells; used by editors/critical readers to highlight feedback cells to authors.

Icons from Material Design Icons

Any old style tags (style-student rather than style-learner, style-commentate rather than style-tutor) will be lazily updated as and when an empinken button is clicked on a cell tagged in the old style.

In 0.5.6:

  • A: "activity" [maps to style-activity cell tag], by default, a blue background; used to idnetify activity blockls (follows OU VLE theme);
  • S: "solution" [maps to style-solution cell tag], by default, a green background; used to identify solution cells;
  • L: "learner" [maps to cell tag style-learner], by default, a yellow background; used as a nudge to students ("you should edit / add content to this cell");
  • T: "tutor" [maps to cell tag style-tutor], by default, a pink background; used by tutors to highlight feedback cells; used by editors/critical readers to highlight feedback cells to authors.

Associated tools: in tm351_nb_utils command lines tools:

  • empinken tags updater — updates tags in notebooks to new style (style-activity/style-solution/style-learner/style-tutor format): upgrade_empinken_tags NOTEBOOKS_PATH)

Requirements

  • JupyterLab >= 4.0.0

Initial set-up

# Create orphan branch
% git checkout --orphan NEWBRANCH

# Clear old files
git rm -rf .

# Use template to create base extenion
copier copy https://github.com/jupyterlab/extension-template .

Install

To install the extension, execute:

pip install jupyterlab_empinken_extension

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_empinken_extension

TH BUILD

jlpm build

hatch build

Contributing

Set up environment

cd into dir and run pipenv install

Each terminal session, cd into dir and run pipenv shell.

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 jupyterlab_empinken_extension 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

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 jupyterlab_empinken_extension

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 jupyterlab_empinken_extension 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

Metadata

Release files for jupyterlab-empinken-extension 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterlab-empinken-extension 0.6.2
File Size Uploaded
jupyterlab_empinken_extension-0.6.2.tar.gz 817.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-empinken-extension 0.6.2
File Interpreter ABI Platform
jupyterlab_empinken_extension-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 882.9 kB

Release files / jupyterlab_empinken_extension-0.6.2.tar.gz

Download URL jupyterlab_empinken_extension-0.6.2.tar.gz
Size 817.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f72b65be20092a585262fb809aa1244090b1de180b889c51bfb8964aef7af3ff
BLAKE2b-256 checksum
How to use checksums
4dbeb3599a89fddd32f0df78027db5adb9aa1a12b45040fc75dcc31d5ed5c5f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.0

Release files / jupyterlab_empinken_extension-0.6.2-py3-none-any.whl

Download URL jupyterlab_empinken_extension-0.6.2-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22bcef2dfa8e630b8e3fe149664e99f018c6799311710668955395e8617d7263
BLAKE2b-256 checksum
How to use checksums
5929dc4b729d355ce0fe59c5a70308f6e2fc0ac28765bf2891945b3d9f438c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.3

1 release file

0.4.2

1 release file

0.4.0

1 release file

0.1.2

1 release file

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page