Install, then ask what exists.
docc includes a starter profile, so an unconfigured installation can already describe its types, print an example and build it. Install the command, then inspect what the compiler knows.
# Install the command. go install github.com/kevinzehnder/docc/cmd/docc@latest # List document types and see the full contract for a letter. docc types docc describe ch_letter
docc describe is the answer to “what does this document need?” It reports the schema’s frontmatter, body, blocks, spans, blanks and rules rather than making you infer them from a Word template.
docc profile use <repository>. The compiler will then resolve that project’s schemas and themes. See Profiles & themes.Generate a readable starting point.
The example belongs to the schema itself. That keeps the starter and the contract together, and docc tests that the example remains valid.
docc example ch_letter > mahnung.md
Open mahnung.md in any text editor. It has two deliberately different parts:
| Part | What you write there | What docc does with it |
|---|---|---|
| YAML frontmatter | The subject, sender, recipient, sent date and other letter facts. | Checks names, types, required values, patterns and defaults against the schema. |
| Markdown body | The salutation, reasoning, requests, lists and closing prose. | Parses the document structure and maps valid Markdown to theme styles. |
--- docc: 1 document_type: ch_letter subject: Mahnung — Rechnung 2026-114 sender: name: Muster & Partner recipient: name: Clara Muster postal_code: "3000" --- Sehr geehrte Frau Muster Wir vertreten die Muster Handels AG in der oben genannten Angelegenheit.
Compile the document before it becomes a Word file.
check parses the entire source and runs every applicable validation pass. It collects diagnostics instead of stopping at the first problem, so the author gets one useful correction list.
docc check mahnung.md
A diagnostic points to source and carries a hint. The compiler is not judging prose; it is enforcing the contract declared by the chosen document type.
$ docc check mahnung.md mahnung.md:12:16: error[DOC010]: field `postal_code` has malformed value "300" | 12 | postal_code: "300" | ^^^^^ four digits, quoted: "3000"
docc build directly; it validates first. Keeping check as a separate step is useful while drafting, in CI, and for editors or agents that want diagnostics without producing a file.Build only the passing letter.
When the check is clean, emit the document. The source does not contain page margins, an address-window position or a footer: its selected theme supplies those fixed rendering decisions.
docc build mahnung.md
# → mahnung.docxThe output is not a converted template. docc writes the .docx itself. With identical source, schema and theme, the generated file is byte-identical—useful for review, reproducible builds and knowing that an output difference means something actually changed.