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.0a39

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.0a39
File Size Uploaded
sphinx_gp_mermaid-0.1.0a39.tar.gz 71.3 kB Details

Built distribution (wheel)

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

Total release size: 84.1 kB

Release files / sphinx_gp_mermaid-0.1.0a39.tar.gz

Download URL sphinx_gp_mermaid-0.1.0a39.tar.gz
Size 71.3 kB
Tags Source
SHA-256 checksum
How to use checksums
767faa1594f774e41bd1b96b3992c9bda448f1a93d8b6d5f4e309a01870a7791
BLAKE2b-256 checksum
How to use checksums
1de553624bab0d3beae9404a8042fc71b8260dc6c4ff1734fadb5db8824de3ed
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 Sep 6, 2026.

Transparency log

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

Download URL sphinx_gp_mermaid-0.1.0a39-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb795910e81f02c5f4a67df7b9e508fac1b0581cc33c0e13eb02e2ba6029cb74
BLAKE2b-256 checksum
How to use checksums
f7367d15d568a9e241235b4df7f47857e18ae5e1d76c4476cd0190eb97e0b4fd
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 Sep 6, 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