10-minute walkthrough

Build one letter you can trust.

Start with docc’s built-in ch_letter example. The same flow works with your firm’s own document types and profile pack.

Before you begin

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.

Using your own profile already? Bind it with docc profile use <repository>. The compiler will then resolve that project’s schemas and themes. See Profiles & themes.
Step 1

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:

PartWhat you write thereWhat docc does with it
YAML frontmatterThe subject, sender, recipient, sent date and other letter facts.Checks names, types, required values, patterns and defaults against the schema.
Markdown bodyThe 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.
Step 2

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"
Build has the same gate. You can run 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.
Step 3

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.docx

The 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.

Continue

Learn only the next layer you need.