Formatting Reference
How synced docs pages are written - frontmatter, headings, links, payload-markdown directives, reference entries and what the sync checks.
Formatting Reference
Docs are plain .md files rendered by payload-markdown (1.9.2 or later for everything on this
page). Keep them readable in Git first: directives enhance the page without turning the source
into MDX, and every page still reads as Markdown on GitHub and in llms-full.txt.
Page shape
- frontmatter with the fields this plugin supports (Frontmatter);
- one H1 that names the page topic;
- short sections under
##and###headings: they make the page's anchors, its table of contents and the "On this page" rail; - directives only where they help a reader scan, compare or follow steps.
1---2title: Quick Start3navTitle: Quick Start4description: Run the default docs workflow.5order: 206status: published7tags:8 - getting-started9---10 11# Quick Start12 13Introductory paragraph.14 15## Validate Local Docs16 17Run the validator before syncing.
Heading ids are payload-markdown's slugs of the heading text (## Validate Local Docs is
#validate-local-docs; repeats get -1, -2). Links to a section use them.
Links
Prefer root-relative links inside the docs set; the page rewrites them to the docs set's routes:
1[Publishing](/workflow/publishing)2[Strict checks](/workflow/diagnostics#strict-checks)
Relative links to files (../workflow/publishing.md, ./index.md) are rewritten too, and read
on GitHub, but break silently when files move; use them sparingly. Do not hardcode the site's
domain for internal links, and do not link to Payload admin records.
Every sync checks links and anchors against the routes the docs set will have (Markdown diagnostics).
Directives
Directives, their attributes, theme names and diagnostics are defined by payload-markdown, not by
this plugin. The payload-markdown agent skill (installed next to this plugin's skill) and its
reference/directive-spec.json, or getDirectiveSpec() from payload-markdown/render, are the
reference; never invent a directive, attribute, theme or MDX component.
What payload-markdown 1.9.2 offers, by purpose:
| Purpose | Directives |
|---|---|
| Notes, warnings, optional detail | :::callout, :::details |
| Procedures | :::steps |
| Page maps and related pages | :::cards / :::card, :::related |
| Alternatives | :::tabs (with sync to switch tab sets together) |
| Calls to action and status | ::button, ::badge, :::badges |
| Navigation | :::toc |
| Layout | :::section, :::2col, :::3col, :::cell (sparingly) |
| Reference material | docs-table, :::entry, :::index, ::usage, :::exchange |
| Inside sentences and cells | :kbd, :since, :deprecated, :ref, :fact |
Code fences take meta: title="…", highlighted lines {3-4}, ins={…} / del={…}, wrap,
nolines, and terminal on shell fences so copying takes only the commands.
Container markers start a top-level line (never inside a list item, a blockquote or a table
cell) and close with :::. Keep blank lines around nested directive content.
Reference entries
Reference material (options, commands, configuration keys, environment variables, paths, exit
codes, support matrices, terms) goes in a docs-table or an :::entry. Each row is an entry
with a stable id that links resolve to:
1::docs-table[orbit prune]{kind="options"}2| Option | Type | Default | Summary |3| --- | --- | --- | --- |4| `--keep` | `int` | `3` | Versions to keep per file. |5| `--mode` | `string` | `fast` | How to prune. :since[1.5] |
:ref[orbit prune --keep]links to an entry by name, from anywhere on the docs site: the page, another page of the docs set, or another docs set (Cross-Page References).:::index{kind="option"}lists the entries of the page;:::index{scope="set"}lists those of the whole docs set.- Rows can be bound to facts extracted from the code, so CI keeps their values true (Source-Backed Reference Tables).
Write each table where it belongs in the page and keep only the rows readers need. Name entries so a reference to them is unique on the site.
Checks at sync
Every sync renders the pages it creates or changes with payload-markdown and reports what the
renderer finds (unknown themes, malformed or misplaced directives, reference-table problems,
:ref targets that resolve nowhere, code languages that are not loaded), plus links that go
nowhere (broken_link) and #fragments that match no element on the target page
(broken_anchor). pmdocs plan --endpoint ... and pmdocs push print them as
path:line:col severity code message. They do not block a sync unless strict checks apply. See
Markdown diagnostics.
Locally, the payload-markdown skill's scripts/check_payload_markdown_doc.py checks what one line
shows. It does not know pmdocs' scope attribute on :::index and reports it; that one finding
is expected in a docs package.
What not to add
.mdxfiles or MDX components- arbitrary YAML frontmatter objects
- inline frontmatter arrays such as
tags: [api, sync] - HTML scripts, iframes, or client-side widgets
- one Payload Page per Markdown file
- hidden docs files as a substitute for clean navigation metadata
- links to generated Payload admin records as if they were public docs routes
- values copied from the code by hand where a fact binding can keep them true
Agent skills
Agent skill files are not human docs pages. Keep them under /skills or in the project-local
agent install directory, and keep /docs focused on rendered Markdown documentation.