Front-matter reference
Front-matter is the optional YAML block at the very top of a Markdown Source. It
carries the Brand Theme — title, logo, brand colors, header/footer — plus render options. The
schema is a strict whitelist: unknown fields and out-of-range values are rejected before any
Credit is charged, with an error naming the exact field path.
Getting started ·
REST & MCP reference ·
Front-matter reference ·
Error codes
Minimal example
---
template: report
title: Q3 Field Report
header:
left: "{title}"
right: Acme Analytics
footer:
center: Confidential
page_number: page/total
---
# Q3 Field Report
Body text starts here. The Front-matter block never enters the rendered Document.
Template resolution
Front-matter fields overlay the chosen Template — unset fields simply inherit it. The Template
name resolves in this order: the template request parameter (REST) or tool argument
(MCP), then the Front-matter template declaration, then default. Lookup
covers the built-in Templates first, then your own private Templates; another account's private
Template is indistinguishable from a missing one. A name that resolves nowhere returns
template_not_found.
| Built-in Template | font | font_size | line_height | margins (mm) | page_number | header |
default | serif | 10.5 pt | 1.75 |
24 / 20 / 22 / 20 | none | none |
report | serif | 11 pt | 1.85 |
24 / 20 / 22 / 20 | page/total | left {title}, divider |
resume | sans | 10 pt | 1.62 |
14 / 14 / 16 / 14 | none | none |
Margins read top / right / bottom / left. The tables below state each field's
constraints; every field's default is “inherited from the resolved Template” unless noted.
Top-level fields
| Field | Type | Default | Constraints | Description |
template | string | default |
≤ 64 chars; must resolve (see above) |
Which Template the Brand Theme overlays. |
title | string | empty |
trimmed, ≤ 300 chars |
Document metadata: feeds the PDF title and the {title} placeholder in
header/footer. Never injected into the body. |
font | enum | from Template |
serif · sans · mono |
Body type family; each key maps to a fixed font stack with CJK coverage. Headings keep
their display stack regardless. |
font_size | number | from Template |
8–16 pt | Body font size; headings and code scale with it. |
line_height | number | from Template |
1.2–2.5 | Body line height. |
page_number | enum | from Template |
none · page · page/total |
Footer page number. Any value other than none counts as footer content and
triggers the bottom-margin rule below. |
color
| Field | Type | Default | Constraints | Description |
color.ink | color | from Template |
#RRGGBB | Body text. |
color.muted | color | from Template |
#RRGGBB | Secondary text: header/footer copy and captions. |
color.accent | color | from Template |
#RRGGBB | Links and emphasis. The built-ins set it to ink — links are
ink with an underline, in keeping with the paper aesthetic. |
color.wash | color | from Template |
#RRGGBB | Background for tables and code blocks. |
color.line | color | from Template |
#RRGGBB | Hairlines and separators. |
header and footer
Two symmetric edge blocks with three text slots each. Header sits above a hairline (when
divider is on); footer below. Any non-empty slot — or a divider, or a logo in the
header, or a page number in the footer — activates that edge and triggers the margin rule below.
| Field | Type | Default | Constraints | Description |
header.left
header.center
header.right |
string | from Template | trimmed, ≤ 120 chars |
Header text slots; empty slots stay empty. The {title} placeholder is
replaced by the document title. |
header.divider | boolean | from Template | — |
Hairline between header and body. |
footer.left
footer.center
footer.right |
string | from Template | trimmed, ≤ 120 chars |
Footer text slots; same placeholder rule as the header. |
footer.divider | boolean | from Template | — |
Hairline between body and footer. |
logo
| Field | Type | Default | Constraints | Description |
logo.url | string | none |
https: URL ≤ 2,048 bytes on a public host, or a
data:image/* URI ≤ 512 KB |
Header logo. Fetched and embedded server-side at Render time; an unreachable https logo
degrades to a text-only header rather than a broken frame. |
logo.height | number | — |
4–24 mm; required when logo.url is set |
Logo height in millimeters. |
margins
| Field | Type | Default | Constraints | Description |
margins.top | number | from Template | 5–40 mm |
Top margin. With a header: ≥ 10 mm, and ≥ logo height + 2 mm when a logo is set. |
margins.right | number | from Template | 5–40 mm |
Right margin. |
margins.bottom | number | from Template | 5–40 mm |
Bottom margin. With a footer (content or page number): ≥ 10 mm. |
margins.left | number | from Template | 5–40 mm |
Left margin. |
Cross-field rules
- Header active (any slot, divider or logo) requires
margins.top ≥ 10 mm —
and ≥ logo.height + 2 mm with a logo, so the header never overlaps the body.
- Footer active (any slot, divider or
page_number ≠ none) requires
margins.bottom ≥ 10 mm.
- Violations report the offending field (e.g.
margins.top) as
invalid_source — see the error codes.