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:
plugins:
...
- kroki:ServerURL- URL of your kroki-Server, default: https://kroki.ioFencePrefix- Diagram prefix, default:kroki-EnableBlockDiag- Enable BlockDiag (and the related Diagrams), default: TrueEnablebpmn- Enable BPMN, default: TrueEnableExcalidraw- Enable Excalidraw, default: TrueEnableMermaid- Enable Mermaid, default: TrueEnableDiagramsnet- Enable diagrams.net (draw.io), default: FalseHttpMethod- Http method to use (GETorPOST), default:GET(Note: you have to enableDownloadImagesif you want to usePOST!)DownloadImages- Download diagrams from kroki as static assets instead of just creating kroki links, default: FalseDownloadDir- The asset directory to place downloaded images in, default: images/kroki_generatedFileTypes- File types you want to use, default: [svg], (Note: not all file formats works with all diagram types https://kroki.io/#support)
- kroki:
FileTypes:
- png
- svgFileTypeOverrides- Overrides for specific diagrams to set the desired file type default: None,
- kroki:
FileTypeOverrides:
mermaid: pngUse 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:
```kroki-bpmn
@from_file:path/to/diagram.bpmn
```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 https://test.pypi.org/simple/ mkdocs-kroki-plugin