Skip to main content

Jupyterlab extension that brings the lates version of the mermaid library to the rendering in notebooks and markdown

Project description

jupyterlab_mermaid_latest_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

JupyterLab extension that brings the latest version of the Mermaid diagram library to notebook and markdown rendering. JupyterLab ships with an older bundled Mermaid version - this extension replaces it with the current release so you get access to the newest diagram types, syntax features, and bug fixes.

[!WARNING] This extension works by monkey-patching the built-in IMermaidManager at runtime. It replaces the manager's rendering methods with implementations that use a newer bundled Mermaid library. The built-in Mermaid extension remains loaded but its rendering code is bypassed. This approach may break if JupyterLab changes the IMermaidManager interface in a future major release.

Features

  • Latest Mermaid version - renders diagrams with Mermaid 11.15.0, independent of JupyterLab 4.5's bundled 11.12.3
  • New diagram types - access beta and recently stabilised Mermaid diagrams (e.g., venn-beta) that the bundled version rejects with UnknownDiagramError
  • Transparent replacement - notebooks, markdown cells, and .md files all render through the patched manager
  • Theme aware - respects JupyterLab dark/light theme and re-renders on theme change

How It Works

JupyterLab 4 provides an IMermaidManager token that all Mermaid rendering flows through. This extension requires that token, then replaces getMermaid(), renderSvg(), renderFigure(), and getCachedFigure() with its own implementations backed by a force-bundled newer Mermaid library. Since all consumers (notebook renderer, markdown renderer) hold references to the same manager object, they automatically use the patched methods. The built-in @jupyterlab/mermaid-extension stays loaded and enabled - its rendering code is simply bypassed.

Example

A venn-beta diagram, unsupported by JupyterLab's bundled Mermaid, renders with this extension installed:

```mermaid
venn-beta
  title "Effects across KPIs"
  set CV
  set ADG
  set FCR
  union CV,ADG,FCR["Temperature uniformity, Feeder access"]
```

Installation

Requires JupyterLab 4.0.0 or higher.

pip install jupyterlab_mermaid_latest_extension

Uninstall

pip uninstall jupyterlab_mermaid_latest_extension

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_mermaid_latest_extension-1.0.7.tar.gz (1.2 MB 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_mermaid_latest_extension-1.0.7.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.7.tar.gz
Algorithm Hash digest
SHA256 94180b43a7ff6b7fe71d6e0f1619a52195d818e6c02e0a2ed7a9d352f95d32ac
MD5 4d179da25b02ff6de4f26d607fbd8237
BLAKE2b-256 50f37c7354cbd6ea5188e7c850f130a719f25a687cd75fb87d9d7d50cc8524dc

See more details on using hashes here.

File details

Details for the file jupyterlab_mermaid_latest_extension-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1a85b4c5ccb9fe7d57cb231e53d8e9a4dd17960a93e1a39b4dda8264af423005
MD5 e882f0d12c67a6056bfe382518e67460
BLAKE2b-256 68e385d8defa923497d3f1006b11cba6561129c6e0df4512e48e6c1f09c942f5

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