dogbed

Knap templates

Three starters ship inside the binary — no fetching, no discovery paths. dogbed template <name> prints one to stdout so you copy it and own it; --list shows the names:

$ dogbed template --list
verdict	PR review verdict: blockers, nits, summary.
release-notes	Release notes: highlights, breaking, added, changed, fixed.
reading-note	Reading note: author, rating, quote, notes.

The three starters

The knap language

The template language is Knap — {{ }} prints (optionally through | filters), {% %} controls (if / for / else), {# #} comments. Literal text passes through as Markdown source, so # headings and *emphasis* in the template are live markup:

$ cat note.knap
{{ title | h1 }}

{{ verdict | bold }} — {{ summary }}
$ dogbed render note.knap -d note.json
<h1 id="the-machine-stops">The Machine Stops</h1>
<p><strong>essential</strong> — worth the reread</p>

Loops and guards

Loops iterate arrays; {% if %} guards whole sections — this is how release-notes drops empty sections. Keep every {% %} tag on its own line:

{% if nits %}
{{ "Nits" | h2 }}

{{ nits | list:numbered }}
{% endif %}

{% for x in items %}{{ x }} {% endfor %}

Before filling in your own data: data strings are Markdown source — *em*, `code` and [label](url) in a value render live, and a value opening with # becomes a heading. The escape_md filter walks a value back to plain text. See the document shell page.

rendered by oliver rendered by dogbed — k4o templates it, oliver renders it