Skip to main content

MkDocs plugin for Kroki-Diagrams

Project description


This is a MkDocs plugin to embed Kroki-Diagrams into your documentation.


Install the plugin using pip:

pip install mkdocs-kroki-plugin

Activate the plugin in mkdocs.yml:

  - kroki:


Key Description
ServerURL URL of your kroki-Server, default: !ENV [KROKI_SERVER_URL, '']
FencePrefix Diagram prefix, default: kroki-
EnableBlockDiag Enable BlockDiag (and the related Diagrams), default: true
Enablebpmn Enable BPMN, default: true
EnableExcalidraw Enable Excalidraw, default: true
EnableMermaid Enable Mermaid, default: true
EnableDiagramsnet Enable (, default: false
HttpMethod Http method to use (GET or POST), default: GET
Note: On POST the retrieved images are stored next to the including page in the build directory
UserAgent User agent for requests to the kroki server, default: kroki.plugin/0.7.1
FileTypes File types you want to use, default: [svg]
Note: not all file formats work with all diagram types
FileTypeOverrides Overrides for specific diagram types to set the desired file type, default: empty
FailFast Errors are raised as plugin errors, default: false


  - kroki:
      ServerURL: !ENV [KROKI_SERVER_URL, '']
        - png
        - svg
        mermaid: png
      FailFast: !ENV CI


Use code-fences with a tag of kroki-<Module> to replace the code with the wanted diagram.

Diagram options can be set as well.

Example for BlockDiag:

```kroki-blockdiag no-transparency=false
blockdiag {
  blockdiag -> generates -> "block-diagrams";
  blockdiag -> is -> "very easy!";

  blockdiag [color = "greenyellow"];
  "block-diagrams" [color = "pink"];
  "very easy!" [color = "orange"];

You can render diagram from file with @from_file: directive:


See Also

Diagram examples can be found here.

More information about installing a self-manged Kroki-Service here.

More Plugins for MkDocs can be found here


Install the newest pre-release version using pip:

pip install -i mkdocs-kroki-plugin



git clone
cd mkdocs-kroki-plugin
pipx install hatch
pipx install pre-commit
pre-commit install

Run tests (for all supported python versions):

hatch test -a

Run static code analysis:

hatch fmt

Project details

Download files

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

Source Distribution

mkdocs_kroki_plugin-0.8.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_kroki_plugin-0.8.0-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page