At a glance
cat -> dog -> bird
That’s a complete diagram: three boxes, two links. Lini fills in the rest.
| Form | Means |
|---|---|
|type#id| | Identity — a type, an optional #id. Always in bars: an instance (|oval#cat|), a rule (|oval| { … }), a define (|cat::oval| { … }). |
"…" | The label — what the node is called, placed by its type (text, a caption, a symbol, a chart title). |
{ … } | A style block — key: value; declarations. |
[ … ] | A content list — a node’s children. |
.name | A class — define it (.hot { … }), wear it (|box| .hot). |
#name | An id — declare it (|box#cat|), select it (#cat { … }), reference it bare (cat -> b). |
--name | A themeable variable (fill: --accent). |
a -> b | A link. |
Three defaults make small diagrams trivial:
- Omit the type →
|box|(a rounded, framed card);|#cat|is a default box. - Omit the label → the box is empty.
- Name an undeclared id in a link → it’s auto-created as a labelled
|box|(cat -> dogadds|box#cat| "cat").
A file is a stylesheet, then drawn statements. The stylesheet is one { } block at the
top — setup that draws nothing. After it come the instances and links, in source order
(usually instances first, then links — a layout: sequence reads the order as time, SPEC 13):
{ // the stylesheet — setup only
layout: grid; columns: repeat(3); gap: 30; // scene config
|box| { radius: 6; } // a rule — style every box
.hot { stroke-width: 2; } // a class
}
|box#server| "Server" .hot // the canvas, two instances
|box#client| "Client"
server -> client "requests" // a link, with a label
The language every node and every layout shares. Read top-to-bottom once; the layout sections (Part II) and the reference (Part III) build on it and never restate it.