Formatting
The DocuBook authoring contract — common markdown, fenced code, and directives (double, triple, quad colon), with explicit closing rules.
DocuBook content is authored in markdown. Three syntaxes coexist, and each has a clear role:
Common Markdown (GFM)
Native markdown — no special syntax, styled by the framework automatically.
Typography
Lists
Task lists (checkboxes)
GFM task lists — - [ ] unchecked, - [x] checked. A task item is just a
list item starting with a checkbox marker:
- done item
- pending item
- another pending item
Paragraph breaks
Links, tables, and images use their standard GFM syntax — the framework styles them; no component syntax needed.
Internal Links & Assets
Author internal references with the /docs/ prefix, exactly as they sit on
disk:
Flame resolves them for the deployment at compile time:
Because the /docs/ prefix is re-based rather than matched literally, one
docu.json keeps working at the default /docs, at a custom prefix, and at the
deployment root. See Base Path & Subpaths for
how the prefix and the host's deployment root are configured.
Fenced Code
Fenced code blocks are delimited by backticks and render as code — the content is never parsed as markdown or directives.
Triple vs quad fences
The closing fence must repeat the same number of backticks as the opening one. Inside a quad fence you can nest triple fences freely; inside a triple fence a triple-backtick sequence would close the block early:
Syntax highlighting
Use a language identifier to enable highlighting, optionally with a title
for the code header (lang:filename):
Mermaid diagrams
Mermaid uses the fenced convention (same as GitHub/GitLab) — no directive:
Directives
Directives are the DocuBook component syntax. Three colon counts, each with a distinct role — and every directive that opens must close.
Double colon (::) — leaf
Self-closing components without children. No closing marker needed — the directive is complete on its line.
Inline tooltip — the one single-colon exception
Tooltips are the one component that reads naturally inside a paragraph.
:tooltip is the only inline (single-colon) directive; every other single
colon stays literal text:
[label] is the visible trigger (dotted underline); {tip="…"} is the hover
bubble and defaults to the label. The bubble auto-positions itself — no
side prop needed.
Triple colon (:::) — item
Components that hold content, one at a time: callouts, card, tab, step,
accordion. Open with ::: and always close with :::
Items nest inside their plural wrapper — the wrapper is ::::, the item
inside is :::
Callout variants: :::tip, :::info, :::danger, :::warning, :::success
— the only prop is title (optional, falls back to the variant label).
GFM alert blockquotes (> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING],
> [!CAUTION]) render as the same callouts with the GitHub label as title
(IMPORTANT keeps GitHub's purple accent) — see Callout.
Quad colon (::::) — wrapper
Wrappers that contain other components: tabs, accordions, steps, cards,
tree. Open with :::: and always close with ::::.
Why you must always close
-
Nothing gets trapped. Without a close, a component swallows every sibling that follows it — including the next section. An explicit close bounds the component exactly, so content after it always belongs to the document, never to the component.
-
Nesting is deterministic. A container is closed by the first colon fence of equal length.
:::tabinside:::tabscloses the wrapper — so wrappers use::::and items:::to nest unambiguously. Without the close marker, the parser cannot tell where an item ends. -
Mirrors fenced code. Fenced code opens with
```and closes with```— the same mental model. An unclosed code block is broken; an unclosed directive is broken the same way. -
Author intent is explicit. Closing makes it clear to readers (and agents) exactly which content belongs to which component.
No headings inside components
Headings make up the page outline: the frontmatter title is the h1, and
##–###### are the page's sections. A component never renders an
<h1>–<h6>. A #…###### line inside a callout, card, tab, accordion,
step or GFM alert renders as a plain paragraph that keeps its text and
inline markup. It gets no anchor and no table-of-contents entry, and search
indexes it as content of the section around it.
This matters most for tabs and accordions. A heading in a hidden tab or a
collapsed accordion would add a TOC link to content the reader cannot see.
Name a component with its title prop, and put the section heading above
the component:
File tree
A file tree is a fenced code block with the filetree language, not a
directive. Write one entry per line and indent children under their parent;
no connector characters are needed.
The older ::::tree directive still renders, but the markdown parser strips
its leading spaces. See File Tree for folders,
notes and the screen reader label.
File extensions
.mdx and .md are treated identically — the pipeline parses markdown,
fenced code, and directives in both. The extension is purely a preference.
No JSX tags in v2
The JSX tag API is gone. Authoring components with React tags like
<Accordion>, <Card>, or <Tabs> is not supported in v2 — the
parser drops the tag and keeps only the text content. Components are
written exclusively with directives.
If you are migrating v1 content that uses JSX tags, use this mapping:
Directives cover every component — see the Components index for the full list.
Last updated Nov 10, 2026