Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Writing diagrams

Every input becomes the same model, so the same diagram renders to the same SVG whichever you write.

InputUse it for
Markdown (.md)writing diagrams by hand; says everything svugy draws
d2 (.d2)existing d2 v0.9.0 files: render them as they are, or svugy import them to Markdown
Rustprograms that build diagrams, through the svugy crate
JSON (.json)tools that generate diagrams; svugy import FILE -o model.json writes one from any input
  • Run svugy validate after each edit: a misspelt key, style or reference comes back with the name you probably meant.
  • Leave position out at first. The automatic layout places each hop of a chain one rank further along the plan’s x axis, which draws as a long diagonal; pin position only where that shape is wrong.

Next: Markdown