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

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.

antora-playbook.yml
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

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.generator is the package or script that produces the site. The default is @antora/site-generator. The matching CLI option is --generator.

  • antora.extensions is the list of Antora extensions that listen to the generator events. Each entry is either a require string or an object with a require key 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

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

site.title

Title of the site, available to the UI as site.title.

--title

site.url

Base URL, either an absolute URL or a pathname, without a trailing slash. When set, Antora generates a sitemap, the robots.txt file and absolute links where needed. Since Antora 3.2 a trailing slash is stripped automatically.

--url, variable URL

site.start_page

Page the site index redirects to, written as a page ID such as pocket-units::index.adoc.

--start-page

site.robots

Generates robots.txt when site.url is set. Use allow, disallow or a custom string.

none

site.keys

Map of API keys passed to the UI model, such as google_analytics. Values are primitives.

--key name=value, repeatable

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

content.sources

Array of sources. Each entry has at least a url (a remote repository or a local path) and may set branches, tags, worktrees, start_path or start_paths, edit_url and version.

content.branches

Default branch pattern for sources that do not set their own. Default value [HEAD, v{0..9}*].

content.tags

Default tag pattern. No default, so tags are ignored unless you set it.

content.worktrees

Default worktree pattern for local repositories. The default is ., the current worktree only.

content.edit_url

Default for the Edit this Page link: true (default) derives the URL from the repository, a string supplies a template, false turns the link off.

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

ui.bundle.url

URL or filesystem path of the bundle. Required.

--ui-bundle-url

ui.bundle.snapshot

Set to true when the URL never changes but its content does. With snapshot: true, the bundle is downloaded again whenever fetching is enabled (--fetch or runtime.fetch: true). Default false.

none

ui.bundle.start_path

Folder inside the bundle where the UI files begin. Default is the root of the archive.

none

ui.output_dir

Folder, relative to the site root, where UI files are written. Default _.

none

ui.default_layout

Layout applied to pages that do not select one. No default is set in the schema; the Default UI uses its own default layout.

none

ui.supplemental_files

Either a directory of files or a list of virtual files (each with a path and optional contents) that are layered over the bundle.

none

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.

A supplemental UI described inline
ui:
  bundle:
    url: ./ui-bundle.zip
    snapshot: true
  supplemental_files:
  - path: ui.yml
    contents: |
      static_files:
      - .nojekyll
  - path: .nojekyll

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

asciidoc.attributes

Map of document attributes applied to every page in every component. An empty string ('') turns a flag attribute on.

--attribute name=value, repeatable

asciidoc.extensions

List of Asciidoctor.js extensions to register, each a require string. This site registers @djencks/asciidoctor-mathjax.

none

asciidoc.sourcemap

When true, blocks carry file and line information. Needed by some extensions. Default false.

--asciidoc-sourcemap

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

urls.html_extension_style

default keeps .html, drop removes it, indexify publishes each page as a folder with an index.html.

--html-url-extension-style

urls.latest_version_segment

Text that replaces the version segment of the latest stable version of each component, for example latest.

none

urls.latest_prerelease_version_segment

Text that replaces the version segment of the latest prerelease version.

none

urls.latest_version_segment_strategy

How the replacement happens: replace publishes only at the replaced URL; redirect:to publishes at the versioned URL and redirects the replaced one to it; redirect:from publishes at the replaced URL and redirects the versioned one.

none

urls.redirect_facility

How redirects for page aliases and the start page are produced: static (default, HTML meta refresh files), disabled, gitlab, httpd, netlify or nginx.

--redirect-facility

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

output.dir

Folder of the primary filesystem destination. Default build/site.

--to-dir

output.clean

When true, the destination folder is removed before publishing. Default false.

--clean

output.destinations

List of destinations, each with a provider and optionally path and clean. Required for several destinations, for an archive or for a custom provider.

none

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

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

runtime.fetch

Downloads updates of remote repositories and the UI bundle. Default false: without it, cached content is reused.

--fetch

runtime.cache_dir

Cache folder. Default is an antora folder in the user cache directory.

--cache-dir, variable ANTORA_CACHE_DIR

runtime.quiet

Suppresses output on stdout.

--quiet

runtime.silent

Suppresses all messages. Also sets quiet and the log level to silent.

--silent

runtime.stacktrace

Appends the stack trace to the message of a fatal error.

--stacktrace

runtime.log.level

Minimum level that is logged: all, trace, debug, info, warn, error, fatal or silent. Default warn.

--log-level, variable ANTORA_LOG_LEVEL

runtime.log.level_format

label (default) or number for the level in structured messages.

--log-level-format, variable ANTORA_LOG_LEVEL_FORMAT

runtime.log.failure_level

Level that, once exceeded, makes the run fail on exit: warn, error, fatal (default) or none.

--log-failure-level, variable ANTORA_LOG_FAILURE_LEVEL

runtime.log.format

pretty or json. When not set, the format is pretty if CI=true or stdout is a terminal, and json otherwise.

--log-format, variable ANTORA_LOG_FORMAT

runtime.log.destination.file

File or stream receiving the messages. Defaults to stderr for pretty output and stdout otherwise.

--log-file, variable ANTORA_LOG_FILE

runtime.log.destination.append

Whether to append to an existing log file. Default true.

none

runtime.log.destination.buffer_size

Size of the buffer that must be exceeded before a chunk is written. Default 0.

none

runtime.log.destination.sync

Whether to flush as soon as the buffer size is exceeded. Default true.

none

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

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

git.credentials.path

Path of a file in the format of git-credential-store.

--git-credentials-path, variable GIT_CREDENTIALS_PATH

git.credentials.contents

Credentials as text in the same format, optionally comma-separated.

variable GIT_CREDENTIALS

git.ensure_git_suffix

Appends .git to a repository URL that lacks it. Default true.

none

git.fetch_concurrency

Maximum number of clone or fetch operations at once. 0 is unlimited. Default 1.

none

git.fetch_depth

Number of commits to fetch from a remote repository. 0 fetches full history. Default 1.

none

git.read_concurrency

Maximum number of Git indexes held in memory at once. 0 is unlimited. Default 0.

none

git.plugins.credential_manager

Require string of a plugin that replaces the credential manager.

none

git.plugins.http

Require string of a plugin that replaces the HTTP client.

none

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

network.http_proxy

Proxy URL for HTTP requests.

--http-proxy, variable http_proxy

network.https_proxy

Proxy URL for HTTPS requests.

--https-proxy, variable https_proxy

network.no_proxy

Comma-separated list of domains and addresses that bypass the proxy.

--noproxy, variable no_proxy

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:

  1. a CLI option;

  2. an environment variable;

  3. the playbook file;

  4. 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

site.title, site.url, site.start_page, site.keys

site.robots

ui.bundle.url

ui.bundle.snapshot, ui.bundle.start_path, ui.output_dir, ui.default_layout, ui.supplemental_files

asciidoc.attributes, asciidoc.sourcemap

asciidoc.extensions

urls.html_extension_style, urls.redirect_facility

urls.latest_version_segment, urls.latest_prerelease_version_segment, urls.latest_version_segment_strategy

output.dir, output.clean

output.destinations

runtime.fetch, cache_dir, quiet, silent, stacktrace, log.level, log.level_format, log.failure_level, log.format, log.destination.file

runtime.log.destination.append, runtime.log.destination.buffer_size, runtime.log.destination.sync

git.credentials.path

git.credentials.contents (variable only), git.ensure_git_suffix, git.fetch_concurrency, git.fetch_depth, git.read_concurrency, git.plugins.*

network.*

none

antora.generator, antora.extensions

none

none

content.*

All environment variables supported by the schema are collected here.

Variable Sets

URL

site.url

GOOGLE_ANALYTICS_KEY

site.keys.google_analytics

ANTORA_CACHE_DIR

runtime.cache_dir

ANTORA_LOG_LEVEL

runtime.log.level

ANTORA_LOG_LEVEL_FORMAT

runtime.log.level_format

ANTORA_LOG_FAILURE_LEVEL

runtime.log.failure_level

ANTORA_LOG_FORMAT

runtime.log.format

ANTORA_LOG_FILE

runtime.log.destination.file

GIT_CREDENTIALS_PATH

git.credentials.path

GIT_CREDENTIALS

git.credentials.contents

http_proxy, https_proxy, no_proxy

network.http_proxy, network.https_proxy, network.no_proxy

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 default fatal lets warnings such as unresolved xrefs pass silently; use warn in CI. Since 3.2 the exit code for a failure caused by this threshold is 2.

  • The URL environment variable overrides site.url silently. A CI job that happens to define URL for another purpose changes the published addresses.

  • A bundle served from a fixed URL needs ui.bundle.snapshot: true together 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 the versionSegment of 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.