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

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.5.tar.gz
Algorithm Hash digest
SHA256 15e4a2ae870c7efb4cb5f36dcdc0254670a9af420fc01efed55753ebdec84054
MD5 9007f5789a191711fa7b6894c0b92378
BLAKE2b-256 7bf20f51a865cf1c6db8d425cdc9ac178e08b91008e3e365855a5c7841682208

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlab_mermaid_latest_extension-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6e04af37ea8c3f01f1a2c0b4e632605db13d96fc217041089a1891c7814d6fc3
MD5 4da768fb17301cf0e5794c0451310366
BLAKE2b-256 39bb6cc9c974bc897a3b20b86f39b4a258d29d498644572a6a70716d7522eb1d

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