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

The map

Parsers output a Model; layout, geometry and render take only a Model. Adding an input language touches only svugy-parse.

LayerTakesReturns
Modelbuilder callsan admitted Model, cut into layers
ParsingMarkdown, d2, JSONImport: model, errors, warnings
LayoutModelLevelPlans: footprints, routes, stubs in plan space
GeometryModel, LevelPlansScene: projected faces, arcs, labels in paint order
RenderSceneSVG text
Runtimethe interactive SVGnavigation, in the browser
  • StaticSvg::render: lay out, project, write the whole model.
  • InteractiveSvg::render: cut the model into layers, lay out and project each, write all of them into one file.
  • Output is deterministic: same input, same bytes on Linux, macOS and wasm.

Crates

  • svugy-model: Model, ModelBuilder, validation, layers. No svugy dependency.
  • svugy-parse: markdown, d2, json.
  • svugy: layout, geometry, render; embeds the runtime.
  • svugy-cli: the svugy binary.
  • svugy-wasm: Markdown or d2 to interactive SVG in the browser; runs this book’s live editors.
  • svugy-dagre: LeftToRightLayout::node_centres, dagre’s layered layout cut down from dagre-dgl-rs to what svugy uses, deterministic.

svugy, drawn by svugy

Source: examples/svugy/svugy.md, also the golden test.