Skip to content

kroki ¤

Support for kroki diagrams.

Kroki is a metahub for various kinds of diagram types, incl. plantuml (our default).

These are just a few of the growing selection of supported formats:

Syntax¤

  • Set the mode parameter to kroki[:diagtype], with plantuml the default type.
  • Set fn to the svg to be produced, relative to your page.
  • Diagram source:

    • In the lp block body supply the source
    • Alternatively you could also supply the source as src header argument, relative to the page or absolute path

Default Parameters:

lp_kroki_dflts = {
'server': env('lp_kroki_server', 'https://kroki.io/'),
'puml': env('lp_kroki_puml', 'dark_blue'),
'kroki_mode': 'plantuml',  # when user gave no kroki mode we set this
}

Examples¤

LP Source:

 ```bash lp:kroki fn=img/k1 addsrc
 rectangle "Main" {
   (main.view)
   (singleton)
 }
 rectangle "Base" {
   (base.component)
   (component)
   (model)
 }
 rectangle "<b>main.ts</b>" as main_ts
 
 (component) ..> (base.component)
 main_ts ==> (main.view)
 (main.view) --> (component)
 (main.view) ...> (singleton)
 (singleton) ---> (model)
 
 ```

Result:

LP Source (shortform):

 `lp:kroki:excalidraw fn=img/k2 addsrc src=excali.json`

Result:

Back to top