SWE·2 FLASH
04 — the compiler

dogbed

The reason this site exists at all. dogbed is a document compiler: Knap templates plus JSON data go in, finished HTML documents come out. It lives in this folder as a single 1.8 MB binary — and it built every page you're reading.

document compiler zig 0.17.0 mit licensed v0.1.0
knap template your .knap file — HTML with {{ }} / {% %} tags. You own it; edit freely.
k4o engine interpolates data, runs loops and filters → emits Markdown.
oliver engine renders the Markdown (plus Obsidian extensions) → emits HTML.
dogbed the two halves joined: data → finished document. One static binary.
usage

Three commands.
That's the whole tool.

commandwhat it does
dogbed render <t.knap> -d <data.json>Render one template with one JSON object to an HTML fragment — or a full document when you pass --title/--css/--head/--lang. Flags: --profile html|xhtml, --wikilink-href, --escape, --max-output.
dogbed template <name>Print an embedded starter template to stdout so you copy it and own it. --list shows: verdict, release-notes, reading-note.
dogbed initScaffold a working site skeleton into the current directory: routes.txt, src/, data/, assets/, build.sh, README. Strictly additive — never overwrites; superseded files get archived to a timestamped dir.
§

verdict

PR review verdict: blockers, nits, summary.

≡

release-notes

Highlights, breaking changes, added/changed/fixed — empty sections disappear.

✎

reading-note

Author, rating, quote, notes.

why it exists

Every week is
the same dance.

oliver renders documents but can't template; k4o templates but only emits Markdown. dogbed is the two halves joined: data → finished document. PR verdicts, audit reports, release notes — the weekly artifacts that are all the same shape.

Design constraints are the point: one static binary, no runtime, no JavaScript, no database, no edit button. Output is boring, fast, and impossible to accidentally break at 2am. This site is what that philosophy looks like when a model with a CSS habit gets hold of it.

  • language: Zig 0.17.0 — zig build produces zig-out/bin/dogbed
  • license: MIT — copyright 'draw me an elephant'
  • pipeline: k4o (template → Markdown) + oliver (Markdown → HTML)
  • front matter: leading --- YAML block is metadata, never rendered
  • wikilinks: [[page#heading]] resolve via --wikilink-href, default {slug}.html
  • escape hatch: --escape sanitizes untrusted JSON; <!-- dogbed:raw --> marks trusted regions
  • output cap: --max-output default 256 MiB, enforced mid-render
  • extensions: Obsidian-flavored Markdown: callouts, footnotes, highlights, task lists, wikilinks
field report

Every byte of this site passed through it: five routes, five templates, five JSON files, one stylesheet — compiled by the very binary sitting in this directory. The compiler compiled its own field guide. Chefs kiss, presumably.

“The dog builds its own docs.”

dogbed — draw me an elephant