Browse Docs

Shortcode

Generate Kroki diagrams by using shortcode.

Syntax

Closing Syntax

1{{< kroki _type=[type] >}}
2DIAGRAM
3{{< /kroki >}}

It’s similar to the usage of code block.

Self-Closing Syntax

1{{< kroki _type=[type] _name=[name] />}}

Parameters

_name

PositionNameTypeRequiredDefaultSinceExample
-_namestring----

The name of diagram file, site’s resource and page’s resource are supported.

_type

PositionNameTypeRequiredDefaultSinceExample
-_typestring---

The diagram type, such as blockdiag, bpmn, bytefield, seqdiag, actdiag, nwdiag, packetdiag, rackdiag, c4plantuml, d2, dbml, ditaa, erd, excalidraw, graphviz, mermaid, nomnoml, pikchr, plantuml, structurizr, svgbob, symbolator, tikz, vega, vegalite, wavedrom, wireviz.

_output

PositionNameTypeRequiredDefaultSinceExample
-_outputstring-inline--

The type of output: inline, embed.

Others

You can set any attributes for diagrams, such as id, class and data-*.

Examples

Site’s File Kroki Example

1digraph G {Hello->World}
Source
1{{< kroki _type="graphviz" _name="diagrams/hello.dot" >}}
Result
GHelloHelloWorldWorldHello->World

Page’s File Kroki Example

1graph TD
2  A[ Anyone ] -->|Can help | B( Go to github.com/yuzutech/kroki )
3  B --> C{ How to contribute? }
4  C --> D[ Reporting bugs ]
5  C --> E[ Sharing ideas ]
6  C --> F[ Advocating ]
Source
1{{< kroki _type="mermaid" _name="diagrams/mermaid.dot" >}}
Result

Can help

Anyone

Go to github.com/yuzutech/kroki

How to contribute?

Reporting bugs

Sharing ideas

Advocating