From mindmap to blueprint.
One small language for every kind of figure — pretty by default, precise when it has to be.
lini.rs — the tour, the reference, the gallery, and the compiler in your browser
Thirty-odd lines of Lini — samples/hero.lini.
A compiler: plain text in, clean themeable SVG out. You say where things go, and the parts you'd rather not do by hand — routing a wire through the gaps, measuring a dimension, picking a palette — are done for you.
- One grammar, every family. Flowcharts, mindmaps, org charts, tables, ER schemas, sequences, charts, engineering drawings, floor plans, and circuit schematics are all layouts over the same nodes and links. Not ten tools with ten syntaxes — one language, so theming, baking, and diffing work identically in each.
- Themeable after export. Every colour is a live CSS variable and a
light-dark()pair, so one SVG follows the viewer's OS with no script and no re-render, and one line of host CSS recolours every diagram on a page. - Fast and deterministic. A typical figure compiles in about 2 ms, byte-identical every run, so SVGs diff cleanly in CI.
- No runtime. A single native binary. No Node, no headless browser, nothing to stand up beside it.
- Agents can write it.
SKILL.mdis the whole language as a working brief, and the property schema is generated from the compiler's own ledger.
|
Charts |
ER schemas |
|
Sequence diagrams |
Icons & signs |
|
Circuit schematics |
Engineering drawings |
|
Floor plans |
Mindmaps & trees |
More, with their source, at lini.rs/gallery.
One file, both modes — samples/palette.lini.
Eleven named hues — red rose orange amber lime green teal sky blue purple gray — each in five job-named tiers: wash for backgrounds, soft, the bare name, deep for strokes, ink for text. The names hold across the flip — --teal-ink is the high-contrast tone in both modes, where a light/dark name would invert — which is what lets one export serve both. OKLCH underneath, so every ramp is perceptually even, and gradient(--rose, --sky) blends any two at a flattering angle.
cargo install linilini diagram.lini -o diagram.svg # compile to SVG
lini serve diagram.lini # live-reloading preview
lini serve samples/ # browse and edit the bundled examplesSix lines — a type define, a container, and two links Lini routes for you:
{ |svc::box| { fill: --teal-wash; stroke: --teal-ink } }
|group| "Services" [ |svc#api| "API"; |svc#auth| "Auth" ]
|svc#db| "Postgres"
api -> db "read"
auth -> db "write"
{ } is style, [ ] is children, and naming two nodes draws an orthogonal path between them, clear of everything in the way. The rest of the grammar is the tour.
- mdbook-lini —
```linifences in an mdBook, compiled to inline SVG at build time. On crates.io. - remark-lini — the same fences anywhere remark runs: Docusaurus, Next and MDX, Gatsby, or a bare
unified()pipeline. A toggle reveals the source that drew each figure. On npm:npm install remark-lini-lang— npm refuses the short name as one edit fromremark-lint. - astro-lini — the Astro integration: one line in
astro.config.mjsand every fence in the site draws. It wrapsremark-liniand adds the front end for Astro's own Markdown processor. On npm:npm install astro-lini. - lini-wasm — the compiler itself, for JavaScript. One package, two builds, so it runs in Node, Bun, Deno, a bundler or a browser. This is what
remark-linirides on, and what to reach for to build an integration of your own. - Editors — a VS Code TextMate bundle and a Zed tree-sitter extension under
editors/, installable from the repo. Their word lists are generated from the compiler's own tables, so a new property highlights the day it lands. - As a library —
liniis a crate as well as a binary: docs.rs/lini.
Built and maintained by their own authors, on their own release schedules.
- lini-view — the Obsidian plugin: a
```linifence draws in the note itself, live in the editor, onlini-wasm.
SKILL.md— the language as a working brief: the write → compile → look at the render loop, every family, and the mistakes worth not making. Also served at lini.rs/SKILL.md.schema/lini.schema.json— every primitive, template, role, and property with its owner, value shape, resolved default, inheritance channel, and a compiled example. Generated from the same ledger the compiler reads, and CI fails on drift.schema/reference.mdis the compact human mirror.lini --json— diagnostics as JSON: stable codes, spans, and machine-applicable fixes.
- The tour — fourteen pages, start to finish.
- The reference — every property, split out of the spec.
- The gallery — finished figures, with the source that drew them.
- The playground — the compiler, compiled to wasm, in your browser.
In this repo: SPEC.md is the language contract, frozen for 1.x — syntax, property names, defaults, diagnostic codes, and the theming surface stay compatible. ROUTING.md is the routing contract. samples/ holds one file per feature area, and RELEASING.md says how the pieces ship together.
cargo test # unit, snapshot, and routing-law suites
cargo run -- serve samples/A linear pipeline, each stage independently testable: lex → parse → desugar → resolve → layout → route → render. lini desugar prints any file with its sugar lowered to primitives, so the engine's real input is always inspectable. Conventions are in AGENTS.md.
MIT — see LICENSE.

