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

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.6.tar.gz
Algorithm Hash digest
SHA256 e676e8c855e8b0c391ce22cb08e0793e725a725bc12333773f704bbdbd0649ea
MD5 61524892dcefb6af2cdf3c86737dc63a
BLAKE2b-256 2a1cf841681cc5466e91cdec4f93c969c31aef15b9c0d3ae273cc62ddf31ce99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 874ed36ffdc964a7753685bbd61ec9b2bd5559ba5579e42e0d04122442ed900d
MD5 bce54fe8e3137cbde3d7f399a8123420
BLAKE2b-256 1ede0c16c567f27674b5183ff5adff0b2d448145ccc570a282e32e85f7728a26

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