MkDocs plugin for Kroki-Diagrams
Project description
mkdocs-kroki-plugin
This is a MkDocs plugin to embed Kroki-Diagrams into your documentation.
Setup
Install the plugin using pip:
pip install mkdocs-kroki-plugin
Activate the plugin in mkdocs.yml
:
plugins:
...
- kroki:
Config
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 (GET
orPOST
), default:GET
(Note: you have to enableDownloadImages
if 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
- svg
FileTypeOverrides
- Overrides for specific diagrams to set the desired file type default: None,
- kroki:
FileTypeOverrides:
mermaid: png
Usage
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:
```kroki-bpmn
@from_file:path/to/diagram.bpmn
```
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
Pre-Release-Versions
Install the newest pre-release version using pip:
pip install -i https://test.pypi.org/simple/ mkdocs-kroki-plugin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs-kroki-plugin-0.6.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ee8fc9ac715222c0ace9080f4fcdf3ddd231f13f4edc3f1c73c6db841c5588 |
|
MD5 | 11afa51233049b7f0fb66d95d8ad8b5d |
|
BLAKE2b-256 | 54d5ef695cc64f49dd135538b1415746d1107f083e75d585173dcca1ed7d61ed |
Hashes for mkdocs_kroki_plugin-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b1ee90cee532adfa3414b78da4e31291a537bbcca897feaf25beef061c1faeb |
|
MD5 | 5aaa51d7383fe4caa74975deebb4bbbd |
|
BLAKE2b-256 | 862f8a32b97057f32a0e571b759529396b6ed208e0239b24caf0733238bf75fd |