A JupyterLab extension for colouring notebook cell backgrounds.
Builds on jupyterlab-celltagsclasses
and earlier versions of jupyterlab_empinken_extension
.
The buttons set tags on selected cells and the cell is styled correspondingly.
In v0.6.x:
- book /
book-open-outline
icon: "activity" [maps tostyle-activity
cell tag], by default, a blue background; used to idnetify activity blockls (follows OU VLE theme); - tick /
check
icon: "solution" [maps tostyle-solution
cell tag], by default, a green background; used to identify solution cells; - head/mortarboard ("scholar") /
school-outline
icon: "learner" [maps to cell tagstyle-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 tagstyle-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 tostyle-activity
cell tag], by default, a blue background; used to idnetify activity blockls (follows OU VLE theme);S
: "solution" [maps tostyle-solution
cell tag], by default, a green background; used to identify solution cells;L
: "learner" [maps to cell tagstyle-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 tagstyle-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
)
- JupyterLab >= 4.0.0
# 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 .
To install the extension, execute:
pip install jupyterlab_empinken_extension
To remove the extension, execute:
pip uninstall jupyterlab_empinken_extension
jlpm build
hatch build
cd
into dir and run pipenv install
Each terminal session, cd
into dir and run pipenv shell
.
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
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.
This extension is using Jest for JavaScript code testing.
To execute them, execute:
jlpm
jlpm test
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.
See RELEASE