Skip to content

innovationOUtside/jupyterlab_empinken_extension

Repository files navigation

jupyterlab-empinken-extension

Coloured JupyterLab / RetroLab notebook cells based on cell tags

THIS EXTENSION NOW IS WHAT IT IS. THE JUPYTER DEV / BUILD PROCESS IS UNFATHOMABLE TO ME. AND BREAKING CHANGES IN A BUILD PROCESS I CAN'T FATHOM AS WELL AS THE JUPYTER ENVIRONMENT MEANS I JUST CAN'T KEEP WASTING FRUITLESS AND FUTILE HOURS TRYING TO MAKE EVEN A SIMPLE CSS CHANGE. USE THE VARIOUS VERSIONS ON PYPI. THIS MAIN BRANCH (DEPRECATED ANYWAY) AND OTHER BRANCHES THAT ONCE WORKED HAVE ALL ROTTED IN THE BUILD PROCESS AS WELL AS THE CODE.

Jupyterlite demo: https://innovationoutside.github.io/jupyterlab_empinken_extension/

Binder

This extension optionally enables four notebook toolbar buttons that can toggle persistent tag state on notebook markdown and code cells.

To install the prebuilt extension from a wheel:

pip3 install --upgrade jupyterlab-empinken-extension

To install the wheel from this repo:

pip3 install --upgrade https://raw.githubusercontent.com/innovationOUtside/jupyterlab_empinken_extension/main/dist/jupyterlab_empinken_extension-0.1.1-py3-none-any.whl

You may need to restart the JupyterLab server? [NOT TESTED]

I have no idea how to construct the repo so that you could pip install git+REPO and it wouldn't go through the build process. TBH, I'm surprised I made it this far...

The extension detects appropriate tags and adds corresponding classes to the notebook cell HTML DOM, which allows the backgrounds of the styles to be styled:

image

Extension settings can be accessed from the Settings menu (Advanced Settings) and used to define the parsed tag patterns and the corresponding background colours.

image

The extension also allows the display of each of the toolbar buttons to be individually controlled, as well as whether cells with parsed tags have HTML DOM classes added or not.

Building and Pushing Newly Built Wheels to PyPi

# Build
pip install build jupyter-packaging

# Install the package
pip install .

# Node MUST BE INSTALLED
python -m build
# packages built into ./dist

# Push to PyPi
pip install twine
twine upload MY_PACKAGE.whl

Related Blog Posts