Skip to main content

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.io
  • 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 diagrams.net (draw.io), default: False
  • HttpMethod - Http method to use (GET or POST), default: GET (Note: you have to enable DownloadImages if you want to use POST!)
  • DownloadImages - Download diagrams from kroki as static assets instead of just creating kroki links, default: False
  • DownloadDir - The asset directory to place downloaded images in, default: images/kroki_generated
  • FileTypes - 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


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.6.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_kroki_plugin-0.6.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-kroki-plugin-0.6.0.tar.gz.

File metadata

  • Download URL: mkdocs-kroki-plugin-0.6.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for mkdocs-kroki-plugin-0.6.0.tar.gz
Algorithm Hash digest
SHA256 cc770d12098a25b648eb0de0ba3ccc3979c5ed5e011c74382e58407ae813c59f
MD5 4aaca41d5f05096b048825a9a18919df
BLAKE2b-256 25924096cc3f2ab3be88987b4b1ef430f34cabb85519cd86edc855be0e6472df

See more details on using hashes here.

File details

Details for the file mkdocs_kroki_plugin-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_kroki_plugin-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2fc16ea723f47bce02536833680e3db6638101b031480fda1e5ae4a920cfbc
MD5 c81c2c58ce89ae8fa320b5c8667dcb52
BLAKE2b-256 4c7be6006fd178887c2d0964ddaacbc56465b3543181bd9975aee73a7bb97f9e

See more details on using hashes here.

Supported by

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