More kroki formats

Beyond PlantUML, eight formats render through the same kroki backend: D2, C4-PlantUML, Structurizr, erd, ditaa, pikchr (Kernighan 1984), svgbob, and TikZ. Each was verified working end-to-end before being enabled — and several kroki formats were deliberately excluded as broken or unsuitable (see Formats). One example of each, below; click to zoom.

D2

D2 (docs) is Terrastruct’s declarative diagram language — the most modern entry in the boxes-and-arrows space, with clean syntax, first-class containers, and multiple layout engines. It excels at software architecture and system diagrams where you want good-looking output without thinking about layout. Figure 1 is authored inline in this page’s source:

Figure 1: The render pipeline, in D2

C4-PlantUML

C4-PlantUML layers the C4 model’s vocabulary — person, system, container, component — over PlantUML as ready-made macros. It excels at architecture documentation that stays visually consistent across teams, because the notation enforces C4’s abstraction levels instead of leaving styling to each author.

Figure 2: System context in C4

view source: context.c4

Structurizr

The Structurizr DSL takes C4 further with a model-once, view-many philosophy: you describe the model (people, systems, containers, relationships) and then declare as many views of it as you need, each auto-laid-out. It excels when an architecture is documented from multiple angles that must never drift apart.

Figure 3: The same idea in the Structurizr DSL

view source: workspace.structurizr

erd

erd is a minimal entity-relationship notation: entities in brackets, one attribute per line, cardinality in a single 1--* line. It excels at quick relational sketches during schema design — when DBML feels like more ceremony than the idea deserves.

Figure 4: Entity-relationship, tersely

view source: schema.erd

ditaa

ditaa converts ASCII-art boxes and arrows into polished, rounded, color-tagged diagrams (cGRE, cBLU mark fill colors). It excels when the source must stay legible as plain text — README diagrams, code comments — while still rendering nicely in published output.

Figure 5: ASCII art in, polished boxes out

view source: flow.ditaa

pikchr

pikchr (manual) is D. Richard Hipp’s modern descendant of Kernighan’s PIC (Kernighan 1984), built for and used throughout the SQLite and Fossil documentation. It excels at precise technical line diagrams where relative placement (“arrow; box; arrow right”) beats coordinates.

Figure 6: PIC’s modern descendant

view source: pipeline.pikchr

svgbob

svgbob vectorizes ASCII drawings while preserving their hand-typed aesthetic — where ditaa polishes, svgbob stays faithful. It excels when the ASCII drawing itself is the artifact you care about and you just want it crisp at any size.

Figure 7: ASCII art, faithfully vectorized

view source: boxes.svgbob

TikZ

TikZ is LaTeX’s native graphics system and the gold standard for publication figures: mathematical precision, typographic consistency with the surrounding document, and an enormous package ecosystem. It excels at academic figures that must match the paper’s typography exactly. Sources must be complete \documentclass{standalone} documents.

Figure 8: A complete standalone LaTeX document

view source: nodes.tikz


Every kroki format also works as a file reference or inline block, with the same captions, cross-references, and caching as local backends. Network is needed only on cache misses; self-host with livefigures: kroki-url: for private diagrams.

References

Kernighan, Brian W. 1984. PIC — a Graphics Language for Typesetting: Revised User Manual. Computing Science Technical Report 116. Bell Laboratories.