Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sphinx-gp-mermaid

Build-time Mermaid diagrams for Sphinx. Fenced mermaid blocks render to inline <svg> during the build via mmdc (@mermaid-js/mermaid-cli): no client-side mermaid runtime, no asynchronous pop-in, no layout shift.

Each diagram is rendered twice — a light and a dark variant — and both are inlined, toggled by CSS on body[data-theme]. Diagrams paint with the page, follow the theme toggle without JavaScript, and survive SPA navigation as live DOM.

Install

$ pip install sphinx-gp-mermaid

Usage

Enable the extension in conf.py:

extensions = ["sphinx_gp_mermaid"]

With gp-sphinx, opt in via merge_sphinx_config:

config = merge_sphinx_config(
    extra_extensions=["sphinx_gp_mermaid"],
)

Author diagrams as MyST fences:

:::{mermaid}
:caption: How it flows.
:alt: a request flowing through two steps
:name: request-flow
:responsive: fit

flowchart LR
    a --> b
:::

fit is the default responsive policy: the rendered SVG scales down to the content column. Use :responsive: preserve when a dense diagram should keep its intrinsic width and scroll horizontally instead of shrinking labels.

Renderer toolchain

Rendering shells out to mmdc, resolved from the mermaid_cmd config value, then <confdir>/node_modules/.bin/mmdc, then PATH. Install it in the docs toolchain:

$ pnpm add -D @mermaid-js/mermaid-cli

When the renderer is unavailable the build still succeeds: diagrams degrade to their source text with a single warning.

Documentation

See the full documentation for directive options, theming, caching, and CI setup.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_gp_mermaid-0.0.1a34.tar.gz (71.3 kB view details)

Uploaded Source

Built Distribution

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

sphinx_gp_mermaid-0.0.1a34-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_gp_mermaid-0.0.1a34.tar.gz.

File metadata

  • Download URL: sphinx_gp_mermaid-0.0.1a34.tar.gz
  • Upload date:
  • Size: 71.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_gp_mermaid-0.0.1a34.tar.gz
Algorithm Hash digest
SHA256 82b2f7594d97a31f87bc9f9285db338b19abdd6f39c35d074198d63b55a6667f
MD5 489313dee115a9a7182e4dbb40d603a9
BLAKE2b-256 7a8ce2f9a363438430cdc30ad5f2caa391416c1e2a5f3458c1ec561c09fb3c49

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_gp_mermaid-0.0.1a34.tar.gz:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_gp_mermaid-0.0.1a34-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_gp_mermaid-0.0.1a34-py3-none-any.whl
Algorithm Hash digest
SHA256 a6333edc54516caf7c71bfdbdec25a8710f42e53622ba6f9448e5f84368e4529
MD5 07eac8d4a57ddfeda12f8660291a1a63
BLAKE2b-256 97e6d25d546cccf18afb87bf1944380e95a5a87c942a5f8b95ccddb3142f942f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_gp_mermaid-0.0.1a34-py3-none-any.whl:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page