Files
klammertext/doc
Andy Kopra 8b38a34841 A reference for an LLM assistant: doc/klammertext_for_llm.md
If you use a language model to help write Klammertext, give it this file.  It is
a dense reference written for a model rather than a person -- not a tutorial,
and it motivates nothing.

Two things make it different from the other documents here.

It tells the model NOT TO GUESS.  Its first section maps questions to commands,
because "kdesc" prints the live state of the machine's data structures: what
klammers exist, what arguments each takes, what the argument types accept.  The
file says outright that the parameter list kdesc prints is authoritative and
that the file is not, so a model checks rather than infers.  "kdiag --process
--check doc.kt" verifies a document without rendering it, and "kdiag --type"
settles how a fragment is being parsed.

Its second section is a table of WRONG ASSUMPTIONS.  A model that has not seen
Klammertext pattern-matches it to LaTeX, Markdown or Lisp and produces
confidently wrong syntax, so each row names the likely wrong guess and corrects
it -- braces against the bar separator, bracketed options against ":name value",
"%" against "#", backslash escapes against "^", and @document's body belonging
in its ":text" option rather than in a positional argument.

The rest is the syntax proper: the three "@" tiers, argument forms, a complete
worked document, the klammers most used when authoring, how to define one, and
the behaviour that otherwise costs a debugging session.

The README points at it.

Assembled from dev commit 6c2ff7b8fce3.
2026-08-16 13:19:34 +02:00
..