Usage

In your AsciiDoc document, you can either write your diagram inline or reference a diagram file using the macro form or the include directive.

Inline diagram

Declare a diagram directly in your AsciiDoc document using the block syntax:

[graphviz]
----
digraph foo {
  node [style=rounded]
  node1 [shape=box]
  node2 [fillcolor=yellow, style="rounded,filled", shape=diamond]
  node3 [shape=record, label="{ a | b | c }"]

  node1 -> node2 -> node3
}
----
eNo9jjEOwjAMRfee4itzGKBzuEjVIaldWsnEVQBBVXp3AqQdLFlP 32bxkvy04BeFUsFRCVGc7vPwi7pIxJTW Ax88FP7IK NnZC048inYomN7OIPi3 tim6 QaYTOY m0Z 1bi31ltr4k4TWYgPLM4s8Hgj5Omwmrbanzicy Wy1NX6AUS2QVQ=

Macro form

Use the macro form to reference an external diagram file:

vegalite::chart.vlite[svg,role=chart,opts=interactive]
Vega-Lite chart example

Include directive

Use the include directive to embed a diagram file inline:

[plantuml,alice-bob,svg,role=sequence]
----
include::alice-bob.puml[]
----
PlantUML diagram example

Antora: references and includes

If you use Asciidoctor Kroki with Antora, all file references and includes must use Antora Resource IDs. Place diagram source files (.puml, .vlite, etc.) in the partials directory of your module.

Block macros

vegalite::partial$chart.vlite[svg,role=chart,opts=interactive]

Includes

[plantuml,alice-bob,svg,role=sequence]
----
include::partial$alice-bob.puml[]
----