Playbook
|
This content was generated with the assistance of AI and should be verified against the official documentation of each tool before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
This page was written against Antora 3.2.1 and checked on 2026-10-26. The playbook is the single input that tells Antora
what to build: which repositories to read, which UI to apply, how to convert AsciiDoc, how URLs look, and where the
site goes. Every key below was read from the schema of @antora/playbook-builder 3.2.1 and the official playbook
reference, and the override behaviour was tested with that package.
What the playbook is and why it exists
Antora separates the content (kept in the repositories of each product), the presentation (the UI bundle) and the
assembly instructions. The playbook holds the assembly instructions, so one team can build the same content with
different settings, for example a production build with site.url set and a local build without it, without touching a
single content repository. A playbook is a file, but most of its keys can also be overridden per run from the command
line or from environment variables, which is how continuous integration jobs adjust a shared file.
The file can be written in YAML, JSON or TOML. YAML is by far the most common format and is used in this page. The
file name is yours to choose; this site and the Pocket Units example use antora-playbook.yml. When the name given to
the generator has no extension, the playbook builder tries the extensions .yml, .json and .toml in that order. A
relative path in a playbook value resolves from the current working directory by default; prefixing it with ./
resolves it from the directory of the playbook file instead, which makes the playbook portable between machines.
The playbook is passed to the generator on the command line:
npx antora generate antora-playbook.yml
# the generate command is optional when the playbook is the only argument
npx antora antora-playbook.yml
Source: Antora docs: Antora CLI
Antora validates the playbook against a schema before doing any work. An unknown key is an error, so a typo is caught
immediately. This was checked with a playbook containing site.titel:
Error: configuration param 'site.titel' not declared in the schema for .../bad.yml
A value of the wrong type or outside the allowed choices is reported with the key path and the file it came from:
Error: runtime.log.level: must be one of the possible values: ["all","trace","debug","info","warn","error","fatal","silent"]: value was "loud" in .../antora-playbook.yml
The only key that must always be provided is the UI bundle URL (ui.bundle.url). A playbook without it fails with
ui.bundle.url: must be of type String. A site also needs at least one entry in content.sources to have pages.
A complete playbook for Pocket Units
The running example, Pocket Units, is a tiny units-conversion library documented from two release branches (v1.0 and
v2.0) of one repository plus a shared component. The playbook below sets one key from each group. It was built with
Antora 3.2.1 against local repositories and the Antora Default UI built from source; the build finished with exit
code 0.
site:
title: Pocket Units Docs
url: https://docs.example.org/pocket-units
start_page: pocket-units::index.adoc
robots: allow
keys:
google_analytics: G-EXAMPLE0000
content:
branches: [v1.0, v2.0]
edit_url: false
sources:
- url: ./pocket-units
- url: ./shared
branches: main
ui:
bundle:
url: ./ui/antora-ui-default/build/ui-bundle.zip
snapshot: true
asciidoc:
attributes:
experimental: ''
sectanchors: ''
sourcemap: false
urls:
html_extension_style: indexify
latest_version_segment_strategy: redirect:to
latest_version_segment: current
redirect_facility: static
output:
dir: ./public
clean: true
runtime:
fetch: false
log:
level: info
failure_level: warn
format: pretty
git:
fetch_depth: 1
network:
no_proxy: localhost
Source: Antora docs: Playbook
The result is a public folder with the component versions published under pocket-units/1.0 and
pocket-units/current, a robots.txt containing Allow: /, one sitemap per component and an index.html that
redirects to the start page. The start page redirect points at pocket-units/current/, which shows the effect of
latest_version_segment on the newest version.
Top-level and generator keys
Two keys sit outside the groups below and are normally left alone.
-
antora.generatoris the package or script that produces the site. The default is@antora/site-generator. The matching CLI option is--generator. -
antora.extensionsis the list of Antora extensions that listen to the generator events. Each entry is either a require string or an object with arequirekey plus the extension’s own options. The CLI option is--extension, which may be repeated. Extensions are the subject of Antora extensions.
antora:
extensions:
- '@sntke/antora-mermaid-extension'
- require: '@antora/lunr-extension'
index_latest_only: true
Source: Antora docs: Antora keys
The extension options shown (index_latest_only) belong to the extension, not to Antora. This snippet was not executed
as shown because the Lunr extension was installed in the scratch project but not exercised.
Site keys
The site keys describe the site as a whole.
| Key | Meaning | CLI option and variable |
|---|---|---|
|
Title of the site, available to the UI as |
|
|
Base URL, either an absolute URL or a pathname, without a trailing slash. When set, Antora generates a sitemap, the |
|
|
Page the site index redirects to, written as a page ID such as |
|
|
Generates |
none |
|
Map of API keys passed to the UI model, such as |
|
Source: Antora docs: Site keys
A few details are worth knowing. Without site.url there is no sitemap and the siteMapped generator event does not
fire; a site built that way is intended for local preview. The environment variable for the Google Analytics key is
GOOGLE_ANALYTICS_KEY, and it fills site.keys.google_analytics, so the account key can stay out of the file.
Environment variables are named URL for the site URL, which is easy to clobber in a shell that already defines it.
The effect of the 3.2 trailing-slash normalisation was checked by passing a URL that ends in a slash:
node show.js antora-playbook.yml --url https://x.org/
{"site":{"title":"Pocket Units Docs","url":"https://x.org","keys":{}}, ...}
Here show.js is a throwaway script calling @antora/playbook-builder and printing parts of the resulting playbook.
Content keys
The content keys list where the documentation comes from. They are covered key by key in
Content sources; this section only lists them so the playbook
reference is complete.
| Key | Meaning |
|---|---|
|
Array of sources. Each entry has at least a |
|
Default branch pattern for sources that do not set their own. Default value |
|
Default tag pattern. No default, so tags are ignored unless you set it. |
|
Default worktree pattern for local repositories. The default is |
|
Default for the Edit this Page link: |
Source: Antora docs: Content keys
A source that sets its own
branches replaces the default for that source only, as ./shared does in the Pocket Units playbook above. Antora 3.2
added git.fetch_depth, linked worktrees, submodules, HEAD@<worktree> and a commits filter; the commits filter
is part of the playbook model but cannot be written in a playbook file.
UI keys
The ui keys select and adjust the UI bundle, the ZIP archive with the page templates, CSS and JavaScript.
| Key | Meaning | CLI option |
|---|---|---|
|
URL or filesystem path of the bundle. Required. |
|
|
Set to |
none |
|
Folder inside the bundle where the UI files begin. Default is the root of the archive. |
none |
|
Folder, relative to the site root, where UI files are written. Default |
none |
|
Layout applied to pages that do not select one. No default is set in the schema; the Default UI uses its own
|
none |
|
Either a directory of files or a list of virtual files (each with a |
none |
Source: Antora docs: UI keys
A remote bundle is cached by URL. That is why snapshot: true matters for a bundle published under a fixed URL. This
site also sets the key, but its ui.bundle.url is the local path ui-bundle.zip, which Antora reads on every build, so
snapshot has no effect here; it only matters for remote URLs. Supplemental files are used
here to ship .nojekyll, which stops GitHub Pages from dropping the _ folder. The UI bundle itself is covered in the
UI bundle subsection.
ui:
bundle:
url: ./ui-bundle.zip
snapshot: true
supplemental_files:
- path: ui.yml
contents: |
static_files:
- .nojekyll
- path: .nojekyll
Source: Antora docs: Supplemental UI
Supplemental files are given either as a directory or as a list, never both. A file at the same path as a file in the
bundle overrides it, and a supplemental ui.yml replaces the one in the bundle. This example mirrors what this site
does and was not built separately.
AsciiDoc keys
The asciidoc keys control the conversion of every page.
| Key | Meaning | CLI option |
|---|---|---|
|
Map of document attributes applied to every page in every component. An empty string ( |
|
|
List of Asciidoctor.js extensions to register, each a require string. This site registers
|
none |
|
When |
|
Source: Antora docs: AsciiDoc keys
Attributes defined here sit at the bottom of a precedence order that the descriptor of each component, and finally the page header, can override; the full order is explained in AsciiDoc attributes and extensions. Since Antora 3.2, values are no longer stripped of their quotes and a value is only parsed as YAML when it carries a YAML tag, so write plain scalars when in doubt.
URL keys
The urls keys shape the addresses of pages.
| Key | Meaning | CLI option |
|---|---|---|
|
|
|
|
Text that replaces the version segment of the latest stable version of each component, for example |
none |
|
Text that replaces the version segment of the latest prerelease version. |
none |
|
How the replacement happens: |
none |
|
How redirects for page aliases and the start page are produced: |
|
Source: Antora docs: URLs keys
In the Pocket Units build, html_extension_style: indexify produced addresses such as
pocket-units/current/getting-started/index.html, linked as pocket-units/current/getting-started/. This is the
style GitHub Pages and most static hosts serve cleanly. Antora 3.2 also changed output paths and URLs so they follow the
versionSegment of the component version, covered in
Versioning and prerelease. The redirect facilities other
than static produce redirect rules for the named server instead of HTML pages.
Output keys
The output keys say where the site goes.
| Key | Meaning | CLI option |
|---|---|---|
|
Folder of the primary filesystem destination. Default |
|
|
When |
|
|
List of destinations, each with a |
none |
Source: Antora docs: Output keys
The providers are fs, which writes files, and archive, which writes a ZIP. A site was published to both with this
fragment, and the run finished with exit code 0:
output:
clean: true
destinations:
- provider: fs
path: ./public
- provider: archive
path: ./site.zip
Source: Antora docs: Output keys
Listing the archive contents afterwards printed entries such as pocket-units/current/changelog/index.html. Setting
destinations: [] disables publishing, which is useful when an extension handles delivery itself.
Runtime keys
The runtime keys control how the generator behaves while it runs.
| Key | Meaning | CLI option and variable |
|---|---|---|
|
Downloads updates of remote repositories and the UI bundle. Default |
|
|
Cache folder. Default is an |
|
|
Suppresses output on stdout. |
|
|
Suppresses all messages. Also sets |
|
|
Appends the stack trace to the message of a fatal error. |
|
|
Minimum level that is logged: |
|
|
|
|
|
Level that, once exceeded, makes the run fail on exit: |
|
|
|
|
|
File or stream receiving the messages. Defaults to stderr for |
|
|
Whether to append to an existing log file. Default |
none |
|
Size of the buffer that must be exceeded before a chunk is written. Default |
none |
|
Whether to flush as soon as the buffer size is exceeded. Default |
none |
Source: Antora docs: Runtime keys
The fetch key explains the repository rule: a plain npx antora antora-playbook.yml only reads what is already in the
cache, and npx antora --fetch antora-playbook.yml first pulls the latest branches of the remote sources. That matters
when the cache persists between builds; this site’s nightly workflow runs npx antora antora-playbook.yml on a fresh
runner whose cache starts empty, so every remote source is cloned anyway. failure_level is the key to adopt in a continuous integration job. Setting it to warn makes
a broken cross-reference fail the build, and since Antora 3.2 the process then exits with code 2 rather than 1.
The stack trace option is a global option of the antora command, written before the command name:
npx antora --stacktrace generate antora-playbook.yml --log-failure-level warn
Source: Antora docs: Antora CLI
This command line was not run as such; the options individually were exercised with a throwaway script and a full build.
Git keys
The git keys tune the built-in Git client.
| Key | Meaning | CLI option and variable |
|---|---|---|
|
Path of a file in the format of |
|
|
Credentials as text in the same format, optionally comma-separated. |
variable |
|
Appends |
none |
|
Maximum number of clone or fetch operations at once. |
none |
|
Number of commits to fetch from a remote repository. |
none |
|
Maximum number of Git indexes held in memory at once. |
none |
|
Require string of a plugin that replaces the credential manager. |
none |
|
Require string of a plugin that replaces the HTTP client. |
none |
Source: Antora docs: Git keys
The default fetch_depth of 1 limits how much history is downloaded from remote repositories; use a larger value, or
0 for the full history, when you need more commits. Private
repositories are authenticated over HTTPS through a credentials file or the GIT_CREDENTIALS variable; SSH keys are not
supported and SSH URLs are converted to HTTPS. Never write a real token into a playbook. Keep the value in a CI secret:
export GIT_CREDENTIALS="https://oauth2:<YOUR_ACCESS_TOKEN>@gitlab.com"
npx antora --fetch antora-playbook.yml
This example was not executed because it needs a private remote repository and a real token.
Network keys
The network keys configure a proxy for the Git client and for downloading the UI bundle.
| Key | Meaning | CLI option and variable |
|---|---|---|
|
Proxy URL for HTTP requests. |
|
|
Proxy URL for HTTPS requests. |
|
|
Comma-separated list of domains and addresses that bypass the proxy. |
|
Source: Antora docs: Network keys
The proxy variables use the lower-case names common to other tools. These keys were checked against the schema; no proxy was available to test them.
Precedence of the playbook, environment variables and CLI options
Each value comes from the first source that defines it, in this order, highest priority first:
-
a CLI option;
-
an environment variable;
-
the playbook file;
-
the default in the schema.
The order was tested by loading the Pocket Units playbook, which sets a title, a URL, a log level of info and an
attribute version-label, with progressively more overrides. With no overrides the values come from the file:
{"site":{"title":"Pocket Units Docs","url":"https://docs.example.org/pocket-units",...},"level":"info",
"attrs":{"version-label":"from-file"}}
The environment variables URL=https://env.example.org and ANTORA_LOG_LEVEL=debug replace the URL and the level:
{"site":{"title":"Pocket Units Docs","url":"https://env.example.org",...},"level":"debug",
"attrs":{"version-label":"from-file"}}
Adding CLI options on top of the same environment (--url https://cli.example.org --title "CLI title" --attribute
version-label=cli --attribute extra=1 --log-level error --fetch --to-dir out --html-url-extension-style indexify)
replaced everything that was set on the command line, including the log level that the environment had changed:
{"site":{"title":"CLI title","url":"https://cli.example.org",...},"level":"error","fetch":true,
"attrs":{"version-label":"cli","extra":"1"},"htmlStyle":"indexify","outdir":"out"}
Two details from the output matter. Attributes passed with --attribute are merged key by key into the attributes of
the file: version-label was replaced, and a new key extra was added, while keys that the command line did not
mention stay. Repeatable options such as --attribute, --key and --extension collect all the occurrences.
Not every key can be overridden. The table lists what the command line and the environment can set, taken from the schema of 3.2.1.
| Overridable from the CLI | File only |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
none |
|
none |
none |
|
Source: Antora docs: Playbook
All environment variables supported by the schema are collected here.
| Variable | Sets |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Source: Antora docs: Playbook
No variable names the playbook file itself; it is chosen only by the command argument. The table of overridable keys is
derived from the schema shipped with @antora/playbook-builder 3.2.1 and reflects that version.
Pitfalls and version notes
-
A missing or misspelled key stops the build with a schema error, as shown earlier. This is a feature: fix the key rather than ignoring it.
-
The build exit code reflects
runtime.log.failure_level. The defaultfatallets warnings such as unresolved xrefs pass silently; usewarnin CI. Since 3.2 the exit code for a failure caused by this threshold is 2. -
The
URLenvironment variable overridessite.urlsilently. A CI job that happens to defineURLfor another purpose changes the published addresses. -
A bundle served from a fixed URL needs
ui.bundle.snapshot: truetogether with--fetch, or updated bundles are never picked up from the cache. -
Antora 3.2 requires Node.js 20 or later, strips a trailing slash from
site.url, builds paths from theversionSegmentof each component version, and stopped removing the quotes from attribute values. -
The playbook accepts relative paths from the working directory. A path that begins with
./is relative to the playbook, so CI scripts that change directory still find the files. -
Playbook keys for content sources, descriptors, navigation and extensions are expanded in their own pages. This page is a map of the whole playbook, not a replacement for them.