adoctra ports asciidoctor-diagram 3.2.1: all 58 diagram types, as blocks, block macros and inline macros, with the same attributes.

Enabling diagrams

Diagrams are enabled with the same option as in Asciidoctor:

adoctra -r asciidoctor-diagram document.adoc

Diagrams run external programs and send the diagram source to a server, so they are enabled only on request.

[graphviz, flow, svg]
----
digraph { a -> b }
----

plantuml::diagrams/sequence.puml[svg]

The inline form graphviz:icon.dot[svg] works inside text.

Supported types

a2s, actdiag, blockdiag, bpmn, bytefield, d2, dbml, diagrams, ditaa, dpic, erd, gnuplot, goat, graphviz, graphviz_py, lilypond, meme, mermaid, msc, nomnoml, nwdiag, oxdraw, packetdiag, penrose, pikchr, pintora, plantuml, rackdiag, salt, seqdiag, shaape, smcat, structurizr, svgbob, symbolator, syntrax, tape (vhs), tikz, umlet, vega, vegalite, wavedrom, and 16 barcode types: bookland, codabar, code25, code25iata, code25interleaved, code39, code93, code128, code128a, code128b, code128c, ean8, ean13, gs1_128, qrcode, upca.

Local tools

Each type runs its own tool, which must be installed:

Type Tool

Graphviz

dot (or the dot/graphvizdot attribute)

PlantUML

plantuml-full/plantuml-headless (plantuml-native), the JAR files in DIAGRAM_PLANTUML_CLASSPATH, or plantuml on PATH

Mermaid

mermaid-cli mmdc (or the mmdc attribute)

D2, svgbob, pikchr, …

the program of the same name

ditaa, JSyntrax, Structurizr

JAR files from DIAGRAM_DITAA_CLASSPATH, DIAGRAM_JSYNTRAX_CLASSPATH, DIAGRAM_STRUCTURIZR_CLASSPATH

Barcodes, QR codes

nothing: built in

Generated images and the cache go to imagesoutdir and .asciidoctor/diagram, as in Asciidoctor.

Kroki and PlantUML servers

Without local tools, render every diagram through Kroki, your own Kroki instance or a PlantUML server:

adoctra -r asciidoctor-diagram \
  -a diagram-server-url=https://kroki.io -a diagram-server-type=kroki_io \
  document.adoc

diagram-server-type is kroki_io or plantuml. The attributes can also be set in the document header or per diagram.

In the browser

The WASM bindings render diagrams through a server only: the browser cannot run programs. See WASM: diagrams. PlantUML diagrams there need preprocess=false.