Socket
Socket
Sign inDemoInstall

mkdocs-kroki-plugin

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkdocs-kroki-plugin

MkDocs plugin for Kroki-Diagrams


Maintainers
1

Readme

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

KeyDescription
ServerURLURL of your kroki-Server, default: !ENV [KROKI_SERVER_URL, 'https://kroki.io']
FencePrefixDiagram prefix, default: kroki-
EnableBlockDiagEnable BlockDiag (and the related Diagrams), default: true
EnableBpmnEnable BPMN, default: true
EnableExcalidrawEnable Excalidraw, default: true
EnableMermaidEnable Mermaid, default: true
EnableDiagramsnetEnable diagrams.net (draw.io), default: false
HttpMethodHttp 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
UserAgentUser agent for requests to the kroki server, default: kroki.plugin/0.7.1
FileTypesFile types you want to use, default: [svg]
Note: not all file formats work with all diagram types https://kroki.io/#support
FileTypeOverridesOverrides for specific diagram types to set the desired file type, default: empty
FailFastErrors are raised as plugin errors, default: false

Example:

  - kroki:
      ServerURL: !ENV [KROKI_SERVER_URL, 'https://kroki.io']
      FileTypes:
        - png
        - svg
      FileTypeOverrides:
        mermaid: png
      FailFast: !ENV CI

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

Development

Setup:

git clone git@github.com:AVATEAM-IT-SYSTEMHAUS/mkdocs-kroki-plugin.git
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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc