Fields
{.fields} documents configuration keys, command flags and API fields — name, type, default and description each in place, readable on a narrow screen, every entry individually linkable.Fields render “a list of named values with metadata and a description” as a responsive definition list: the name gets its own line, type / required / default sit beside it as small chips, the description starts on the next line, and every entry carries its own anchor. Use it for configuration keys, command flags and API fields. When readers need to compare many rows across the same columns, keep a plain table; when the content is a sequence of actions, use steps.
There are two spellings: a plain table plus {.fields} (the default choice),
and the fields/field shortcode, for when a description needs several
paragraphs, a list or a code block. Both render the same entries.
Shortest form
A pipe table with at least two columns and {.fields} on the next line. The
first column is the name, the last is the description, and every column in
between is metadata labelled with its own header text.
Metadata here shows as “Header: value”. The theme infers nothing from the header
— Type is only a label. The next section turns those into standard chips.
Cells accept inline Markdown (code, emphasis, links) and empty middle cells are
omitted.
Semantic columns with meta=
meta says, in order, what each middle column means: type, required,
default, or - to keep the header as a plain label. With it, the table form
renders the same chips as the shortcode form.
The rules:
metashould name a role for every middle column — exactly the column count minus two. Too many or too few warns and ignoresmeta; strict publishing rejects the warning.- A
requiredcolumn is “non-empty means true”: “yes”, “是” or “✔” all read the same, and the rendered chip is the untranslatedrequired. An empty cell shows nothing. typeanddefaultcells with no inline markup of their own are wrapped in code formatting, matching the shortcode form.- The three semantic chips always display in the order
type,required,default, whatever order the columns are in;-columns follow, in column order.
- mixes with semantic roles, which is how you keep one custom label:
Labels and container IDs
caption gives the whole list a visible label, which is also its accessible
name; id names the outer container so it can be linked to or styled.
params.ui.image_zoom
Every entry is linkable
Each entry gets an anchor of the form field-<name>, and a self-link icon
appears beside the name on hover. page_width in the first table above is
#field-page_width — a link you can send on its own when
answering a question.
Duplicate names on one page get -2, -3 suffixes, the same rule Goldmark uses
for duplicate headings. Anchors are generated in HTML only: print and RSS
assemble many pages into one document, where in-page anchors would collide.
The shortcode form
When the description needs several paragraphs, a list or a code block, a table
cell cannot hold it. Use fields/field:
Common pig flags
required=true and default=false are booleans and take no quotes. default
accepts any scalar: default=0 and default="" both display faithfully (the
empty string shows as ""), and omitting default omits the chip. Every
field needs a non-empty body and must be a direct child of fields.
Which form to use
| Situation | Use |
|---|---|
| One-sentence descriptions that fit in a table cell | table + {.fields} |
| Descriptions with paragraphs, lists or code blocks | the fields/field shortcode |
| Readers comparing many rows across the same columns | a plain table, not a field list |
| Content that is a sequence of actions | Steps |
The table form stays a readable table on GitHub, and OINK’s Markdown output keeps it as a table. That is why it is the default.
Output
| Output | Shape |
|---|---|
| HTML | <div class="td-fields"> around a semantic <dl>; entries carry #field-<name> anchors and self-links |
| The complete definition list, without entry anchors | |
| Markdown | The table form keeps the source table; the shortcode form emits a bulleted list of “name — type; required; default: value” plus the indented description |
| RSS | The complete static <dl>, without entry anchors |
No script is loaded.
Parameter reference
The table attribute line, on the row below the table:
The fields shortcode:
The field shortcode:
Limits
- The first column must be non-empty and unique within one table; a duplicate or empty name warns and skips that row, and strict publishing rejects the warning.
.fieldscannot combine with.matrix,.full-widthornum, andmetacannot appear on a table without.fields.- Block content does not fit in a table cell: paragraphs, lists and fences need the shortcode form.
requiredanddefaultare untranslated API vocabulary and stay in English in every language. They are contract words, not interface copy.- No
kind,since,deprecated,location, per-field links or nested structures, and nothing parses TypeScript or an OpenAPI schema at build time.
Related
- Tables — the rest of the attribute line and the exclusion rules
- Configuration — the full site parameter table, itself a field list
- Front matter — the full front matter table
- Steps — ordered actions do not belong in a field list