MkDocs plugin that exports mermaid diagrams to PNG/SVG format and attaches images into html page with img src tag.
Install the plugin using pip:
pip install mkdocs-mermaid-export-to-svg
Activate the plugin in mkdocs.yml
:
plugins:
- search
- mermaid-export-to-svg
More information about plugins in the [MkDocs documentation][mkdocs-plugins].
Attach mermaid diagram in your markdown as follows:
...
Then it will be extracted using the plugin, and the PNG/SVG image will be generated with the mermaid.cli usage
Set export_to_pdf to true if you want to use your svg in PDF, otherwise (static web) leave it set to false
Use it to see prints to stdout, incl. what will the markdown page look like after including the images.
Plugin requires Mermaid.cli to be installed via npm:
npm install -g mermaid.cli
Tested on mermaid.cli on version 8.8.2-beta.8