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.4.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.4.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.4.tar.gz
Algorithm Hash digest
SHA256 734d021ee7e62467e6fe445c8254ab660a53b984f3b6932e69b01c72cd095994
MD5 1f1b0b1e98c000aa1f9f2bad1751d83e
BLAKE2b-256 19de686c1e6eb6ecc17b5dee17056ae38d49c48ae76ad205b5d4af042fc5f4ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6e50b934d18261f96e8a348775ca3a3a01c60662985191311ae9acc2cf5b2574
MD5 3376d75c68d5a0ce886ce13c0daac0ae
BLAKE2b-256 06c5ddef5a5fff27eab36b63a4d236845aa6e98b3411c002e3b872a1f68ba0e3

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