Skip to main content

Frontend Jupyter Lab extension providing Jupyter Book Table of Contents in Jupyter Lab

Project description

jb-toc-frontend

A JupyterLab frontend extension that provides Jupyter Book navigation in a sidepanel widget with a Jupyter Book table of contents.

Requirements

  • JupyterLab >= 4.0.0 < 5

Install

Note: If you have a Jupyter server, for a performance boost, you should install the server extension, which automatically installs the frontend extension as well.

To install jb-toc-frontend, execute:

python -m pip install jb-toc-frontend

Uninstall

To remove the jb-toc-frontend extension, execute:

python -m pip uninstall jb-toc-frontend

Contributing

Development install

Note: You will need NodeJS to build the extension package.

# Clone the repo to your local environment
# Change directory to the jb-toc directory
# Install package in development mode
python -m pip install -e ./jb_toc_frontend
# Rebuild `jb_toc_frontend` Typescript source after making changes
jlpm --cwd ./jb_toc_frontend 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 --cwd ./jb_toc_frontend 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

python -m pip uninstall jb-toc-frontend

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 jb-toc-frontend within that folder.

Testing the extension

Frontend tests

This extension is using Jest for JavaScript code testing.

To execute them, execute:

jlpm --cwd ./jb_toc_frontend
jlpm --cwd ./jb_toc_frontend 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

jb_toc_frontend-2.0.0.tar.gz (176.2 kB view details)

Uploaded Source

Built Distribution

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

jb_toc_frontend-2.0.0-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file jb_toc_frontend-2.0.0.tar.gz.

File metadata

  • Download URL: jb_toc_frontend-2.0.0.tar.gz
  • Upload date:
  • Size: 176.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for jb_toc_frontend-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e7f3d7eeb28323c08895e80215626114b7cbbae97ee10650f8545b7467610bb7
MD5 66c131d03999d699982ee19baf3e62d2
BLAKE2b-256 a5787e93f12d6212c9272393ffd565744c5e53049cfd07da5ab67acfb044d318

See more details on using hashes here.

File details

Details for the file jb_toc_frontend-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jb_toc_frontend-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3396d65039b73b1a82c118a034d4273e4fea1423b7d888517ff112c161f30ce0
MD5 c991813f4fddff9c79e886032360ddfe
BLAKE2b-256 7c6f406a701f6472aaeee226d642aa35afe3180298641806d688eecc85b8be6d

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