lini 0.22.0

Pretty diagrams, charts, and technical drawings from plain text, with fine-grained control. Compiles to clean, themeable SVG.
Documentation
// The annotation tour [SPEC 15.6, 15.7] on one fixture's two parts.
// Dimensions: `(-)` spans and chains pack into rows outside the geometry
// (source order, innermost free row), values are measured on the seated model
// in pre-scale drawing units, `unit:` suffixes the linear ones, `tol:`
// composes the tolerance, a patterned hole's `(o)` counts its copies, and
// `side:` steers a row or a leader (a corner side aims it). Leaders: tips
// ray-cast onto the drawn outline and land past a horizontal elbow — `<-`
// arrow, `*-` dot (within a face), `>-` the filled datum triangle; `(<)` arcs
// the angle between two edges; `(o)` reads a fillet's radius; a `|balloon|`
// wires with `-*` and a `|note|` with an ordinary arrow. The `(-)` selector —
// the |-| subtype — dresses dimensions alone, so they part company from the
// leaders' wires.

{
  gap: 56;
  |-| { stroke: --gray-ink; }
  // every wire — the leaders and balloon fly-outs
  (-) { stroke: --blue-ink; }
  // dimensions only — beats |-|, the more specific type
}

|drawing#plate-view| "COVER PLATE" { unit: mm; } [
  |rect#plate| { width: 150; height: 70; } [
    |hole#bolt| { width: 10; translate: -50 -15; pattern: grid(2, 2, 100, 30); }
    |hole#dowel| { width: 6; translate: 0 15; }
  ]

  plate:left (-) plate.bolt (-) plate:right { side: bottom; }
  // 25 · 125 — a chain, one row
  plate:left (-) plate:right { side: bottom; }
  // 150 — the outer row
  plate:top (-) plate.dowel { side: left; }
  // 50 — to the dowel's centre
  plate:top (-) plate:bottom { side: left; tol: 0.2 -0.05; }
  // 70, stacked deviations
  plate.bolt (o) "H7"
  // 4× ⌀10 H7 — the copies counted
  plate.dowel (o) { side: top-right; }
  // ⌀6 — the leader steered
]

|drawing#bracket-view| "CLAMP BRACKET" { scale: 0.75; } [
  |sketch#bracket| {
    draw: move(-40, 30) right(80):base fillet(6):heel up(60):wall
          line(-80, 60):flank close();
  }
  |hole#eye| { width: 16; translate: 20 25; }

  bracket:flank (<) bracket:base
  // → 36.87° — the flank's rise off the base
  bracket:heel (o)
  // → R6 — the fillet knows its radius
  eye:top (o)
  // → ⌀16 — the diametral line through the eye
  bracket:base >- "A"
  // datum A on the base face
  bracket:flank *- "GRIND" { side: left; }
  // a dot lands within the face
  bracket:top-left <- "BREAK EDGES 0.5"
  // an arrow leader onto the corner
  |balloon#b1| "1" { translate: 55 -35; }
  b1 -* bracket:wall
  |note#hint| "DEBURR AFTER MILLING" { translate: -70 -20; }
  hint -> bracket:bottom-left
]