lini 0.18.0

Pretty diagrams, charts, and technical drawings from plain text, with fine-grained control. Compiles to clean, themeable SVG.
Documentation
// A cute, unreal little PCB: a central MCU, peripherals, dark passives, and lots
// of parallel copper traces. Not functional — a pretty demo of parallel routing.
{
  fill: gradient(--green-ink, --teal-ink);
  // the board
  layout: grid; columns: repeat(5, 80); rows: repeat(5, 60); gap: 30; padding: 34; font-size: 12;

  |chip::box| {
    width: 60; height: 60; stroke: none; radius: 5; color: white; padding: 0;
  }
  |pad::box| {
    width: 150; height: 56; stroke: none; fill: --amber-soft; color: --amber-ink;
  }
  |passive::box| {
    width: 54; height: 42; stroke: none; fill: #222428; color: #c9ced6; radius: 2; padding: 0;
  }

  clearance: 10;
  |-| { stroke: --amber; stroke-width: 2; }
}

// the hero: a big gradient MCU spanning the centre
|chip#mcu| "MCU" {
  cell: 2 2; span: 3 3; width: 180; height: 180; fill: gradient(--blue, --purple); font-size: 24;
}

// peripherals + passives around the ring
|passive#c1| "C" { cell: 1 1; }
|pad#usb| "USB-C" { cell: 2 1; span: 2 1; }
|passive#r1| "R" { cell: 4 1; }
|chip#rf| "RF" { cell: 5 1; fill: --purple; }

|chip#flash| "FLASH" { cell: 1 2; fill: --indigo; }
|chip#pwr| "PWR" { cell: 1 3; fill: --rose; }
|passive#c2| "C" { cell: 1 4; }

|passive#osc| "OSC" { cell: 5 2; }
|chip#motor| "MOTOR" { cell: 5 3; fill: --sky; }
|passive#r2| "R" { cell: 5 4; }

|passive#c3| "C" { cell: 1 5; }
|chip#adc| "ADC" { cell: 2 5; fill: --green; }
|chip#sens| "SENS" { cell: 3 5; fill: --teal; }
|passive#r3| "R" { cell: 4 5; }
|chip#imu| "IMU" { cell: 5 5; fill: --amber; color: --amber-ink; }

// ── copper traces ──
// USB data bus (top)
usb:bottom -> mcu:top
usb:bottom -> mcu:top
usb:bottom -> mcu:top
usb:bottom -> mcu:top
mcu:top -> rf:bottom
rf:bottom -> r1:bottom

// power rails + flash bus (left)
pwr:right -> mcu:left
pwr:right -> mcu:left
pwr:right -> mcu:left
pwr:right -> mcu:left
flash:right -> mcu:left
flash:right -> mcu:left
flash:right -> mcu:left

// motor control bus (right)
mcu:right -> motor:left
mcu:right -> motor:left
mcu:right -> motor:left
mcu:right -> motor:left
osc -> motor:top
osc:left -> mcu:right

// sensor + adc buses (bottom)
mcu:bottom -> sens:top
mcu:bottom -> sens:top
mcu:bottom -> adc:top
mcu:bottom -> adc:top

// passives — short decoupling hops
usb:left -> c1:right
pwr:bottom -> c2:top
motor:bottom -> r2:top
imu:top -> r2:bottom
imu -> mcu:right
adc:left -> c3:right
sens -> r3:top