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.

Metadata

Release files for sphinx-gp-mermaid 0.1.0a38

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-gp-mermaid 0.1.0a38
File Size Uploaded
sphinx_gp_mermaid-0.1.0a38.tar.gz 71.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-gp-mermaid 0.1.0a38
File Interpreter ABI Platform
sphinx_gp_mermaid-0.1.0a38-py3-none-any.whl Python 3 none any Details

Total release size: 84.1 kB

Release files / sphinx_gp_mermaid-0.1.0a38.tar.gz

Download URL sphinx_gp_mermaid-0.1.0a38.tar.gz
Size 71.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5e3bc57f7116a2439737bf8e2f972d33506c6a663431a454dc5caf089bad0589
BLAKE2b-256 checksum
How to use checksums
9d6dd6402791de855a72ae6a8077f1c381a9aaadc6e57277ccbfe94c997b1788
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log

Release files / sphinx_gp_mermaid-0.1.0a38-py3-none-any.whl

Download URL sphinx_gp_mermaid-0.1.0a38-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c39a77e5910c32fad4d13bdd9114290377c3e35dce5d34d29444ac5f311bb23
BLAKE2b-256 checksum
How to use checksums
4ca1c33710e13da0b020c0938b8408136b4dc1f15a4af36533644263058277fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page