Introduction
Lini draws figures from plain text. Diagrams, mindmaps, charts, sequences, ER schemas, engineering drawings, floor plans and circuit schematics are all layouts of one small language, and every one of them compiles to clean, themeable SVG. From mindmap to blueprint, in the same file format.
{
gap: 70; clearance: 20;
.step { direction: column; gap: 6; padding: 6; }
|icon| { width: 46; height: 46; }
#coffee |icon| { fill: --amber-soft; stroke: --amber-ink; }
#code |icon| { fill: --sky-soft; stroke: --sky-ink; }
#bug |icon| { fill: --rose-soft; stroke: --rose-ink; }
#ship |icon| { fill: --lime-soft; stroke: --lime-ink; }
|-| { stroke: --gray-deep; font-size: 12; }
}
|block#coffee| .step [ |icon| "coffee"; "Coffee" ]
|block#code| .step [ |icon| "code"; "Code" ]
|block#bug| .step [ |icon| "bug"; "Bug" ]
|block#ship| .step [ |icon| "rocket-launch"; "Ship" ]
coffee -> code -> bug
bug ~> coffee
code -> ship "tests pass"
That fence is the figure’s whole source: four steps, four wires, and a wavy one back to the kettle. You say what there is and what connects to what. Lini sizes the boxes, routes the wires around whatever is in the way, slides the label to where it fits, and paints from a palette that already knows about dark mode. Every one of those choices has a property that overrides it, resolved through a CSS-like cascade, so a figure starts pretty and stays yours.
The same six forms — a capsule for identity, a string for the label, braces for style, brackets for content, a class, a link — carry every layout:
| Family | The layout reads… | Tour |
|---|---|---|
| Diagrams | boxes and the wires between them | Diagrams, Links |
| Trees & mindmaps | nesting as hierarchy | Trees & mindmaps |
| Tables & entities | rows and columns; a titled field list | Tables & entities |
| Sequences | source order as time | Sequences |
| Charts | data as bars, lines, areas, bubbles and slices | Charts |
| Drawings | geometry it can measure — the dimensions read themselves | Drawings |
| Floor plans | walls, openings and fixtures at true size | Floor plans |
| Schematics | parts on a lattice, wires on pins | Schematics |
Install
cargo install lini
lini figure.lini -o figure.svg # compile to SVG
lini serve figure.lini # live-reloading preview
lini fmt figure.lini # canonical formatting (--check for CI)
Or skip the install: the playground runs the same compiler in your browser, and every fence in this book pastes straight into it.
Where to go
- The Tour starts with the language — six forms, one page — then walks each family in a few minutes apiece, and ends with style, colour & themes and the tooling.
- The Reference is the full language specification, one section per
chapter, split straight from the repository’s
SPEC.md. - The gallery shows every sample the language ships, source beside figure.