skillfed

mkdocs-mermaid2-plugin

A MkDocs plugin for including mermaid graphs in markdown sources

mkdocs-mermaid2-plugin v1.2.3 1.0M downloads/30d#4,505 on PyPI286
Permissive license MIT Active released

What it is and what it does

mkdocs-mermaid2-plugin is a MkDocs extension that lets you write Mermaid diagram syntax directly in your markdown source files and have them render as interactive diagrams in the final HTML documentation. It handles inserting the Mermaid JavaScript library and processing the diagram blocks automatically during the MkDocs build.

The plugin works by detecting code blocks marked with the `mermaid` language identifier and converting them into rendered diagrams. It supports all diagram types available in the Mermaid library (flowcharts, sequence diagrams, state diagrams, timelines, and more) and can be configured to use specific versions of the Mermaid library. When used with the Material theme, diagrams automatically adapt their colors to match the site's theme and palette.

Use it for:

  • Add flowcharts and architecture diagrams to API documentation without external image files.
  • Include sequence diagrams in technical specifications or process documentation.
  • Embed state machines or timeline diagrams in software design documents.
  • Create class diagrams or entity-relationship diagrams inline within markdown pages.
  • Build interactive documentation that renders diagrams on-the-fly in the browser.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A MkDocs plugin that renders Mermaid diagram syntax embedded in markdown into interactive flowcharts, sequence diagrams, pie charts, and other diagram types.

Yes. The plugin is actively maintained, carries no known vulnerabilities, has low install friction, and solves a clear problem—embedding diagrams in markdown documentation. It integrates cleanly with MkDocs and the Material theme. Install it if you want to include Mermaid diagrams in your documentation without managing separate image files.

Install

mkdocs-mermaid2-plugin on PyPI

pip

pip install mkdocs-mermaid2-plugin

uv

uv add mkdocs-mermaid2-plugin

poetry

poetry add mkdocs-mermaid2-plugin

Installing mkdocs-mermaid2-plugin

Before you install

Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent commit on 2026-05-14 and carries 286 repository stars, indicating steady community use.

License in practice

Licensed under MIT, a permissive license that allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install mkdocs-mermaid2-plugin

Then in mkdocs.yml:
plugins:
  - search
  - mermaid2

In your markdown:
```mermaid
graph LR
    hello --> world
```

Requires mkdocs and Python >= 3.8; the Mermaid JavaScript library must be available (fetched from unpkg by default or specified via configuration).

Verify before relying

  • Whether all diagram types supported by Mermaid versions > 10 are fully functional in practice.
  • Performance impact when rendering many diagrams in a single documentation site.
  • Compatibility with custom MkDocs themes beyond Material theme.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 6 — beautifulsoup4, jsbeautifier, mkdocs, pymdown-extensions, requests, setuptools
Maintenance actively maintained — 301 days since the last release
Last repo commit
First released
Downloads 1,014,204/month — #4,505 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mkdocs_mermaid2_plugin-1.2.3-py3-none-any.whl

Keywords: markdown, mermaid, mkdocs, python

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

mkdocs mermaid diagramsmarkdown diagram renderingmermaid plugin mkdocsflowchart markdown documentationembed diagrams in mkdocsmermaid syntax supportdocumentation diagram generation
diagram-renderingdocumentation-toolsmarkdown-extension

More Documentation packages

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

griffe

Griffe extracts the complete structure and…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

mkdocs-drawio

A MkDocs plugin that embeds interactive Drawio…

permissive · top 15,000 on PyPI

mkdocs-kroki-plugin

A MkDocs plugin that converts Kroki diagram…

permissive · top 15,000 on PyPI

mkdocs-panzoom-plugin

Adds interactive pan and zoom functionality to…

permissive · top 5,000 on PyPI

sphinxcontrib-mermaid

Embeds Mermaid diagrams (flowcharts, sequence…

permissive · top 5,000 on PyPI

mermaid-py

mermaid-py provides a Python interface to the…

permissive · top 15,000 on PyPI

mermaid-builder

Programmatically generates MermaidJS diagram…

permissive · top 15,000 on PyPI

paracelsus

Paracelsus generates Entity Relationship…

permissive · top 15,000 on PyPI

django-diagram

Generates Entity Relationship Diagrams in…

unclear · top 15,000 on PyPI

mkdocs-print-site-plugin

MkDocs plugin that generates a combined print…

permissive · top 15,000 on PyPI

telegramify-markdown

Converts Markdown to Telegram plain text with…

permissive · top 15,000 on PyPI