On this page
The short answerHow Antora holds examplesWhy Antora examples driftClassify what the reader seesWhat a raw scan coversConvert the relevant source blocksTriage findingsTest the examples folder as real codeWhere DocsAlive fitsThe sources we checkedFAQThe short answer
Build the Antora site, test example files directly, and prepare a reviewed Markdown copy if you want DocsAlive to run page examples. Engine 0.6.3 scans Markdown and MDX files, not AsciiDoc pages. An Antora site therefore gets no coverage of its .adoc pages in a raw scan. The verified copy script below handles a useful subset, but it does not implement all Antora or AsciiDoc behavior.
An Antora page can show only selected lines from a file stored elsewhere. That keeps the source and documentation close, but a selected region can omit an import or setup that made the full file work. A successful site build also does not establish that a reader can run the displayed fragment. Test both the real file and the code assembled for the page.
The same distinction applies to renamed files and substituted attributes. A page can still build with an error in its log unless the build is configured to fail at the appropriate severity. For related workflows, see static-site docs testing, Jekyll and Fumadocs.
How Antora holds examples
An Antora playbook identifies content sources and the site UI. Each content source has an antora.yml component descriptor. In this layout, pages live under modules/ROOT/pages, runnable source files under modules/ROOT/examples, and navigation in nav.adoc. A page can include an example by resource ID and select tagged regions. Source blocks use a language declaration followed by delimiter lines; attributes are substituted inside a block when its substitution settings request that behavior.
The illustrative build below commits the content first because the verified local Antora build reads the local Git content source.
git init -q && git add -A && git commit -qm "docs"
npm init -y >/dev/null && npm i -D -E antora@3.2.2
npx antora antora-playbook.yml
This illustrative playbook points to the local content source with docs as its start path.
site:
title: Example Docs
start_page: example::index.adoc
content:
sources:
- url: .
start_path: docs
branches: HEAD
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
The illustrative component descriptor provides navigation and a minimum Python value. A changed attribute can alter the command the reader sees without changing the page itself.
name: example
version: ~
title: Example
nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
min-python: '3.10'
The illustrative navigation file identifies the page in the site navigation.
* xref:index.adoc[Getting started]
The illustrative example file contains separately tagged import and demo regions. It also runs as a complete file, which provides an independent check of its source.
# tag::imports[]
import json
# end::imports[]
# tag::demo[]
settings = {"retries": 3, "timeout": 10}
print(json.dumps(settings, sort_keys=True))
# end::demo[]
The illustrative page selects both regions, substitutes the configured attribute in its shell block, and includes a Python interpreter session. Antora rendered the selected import and demo lines together in the verified build.
= Getting started
Check that Python is at least {min-python}.
[source,bash,subs="attributes+"]
----
python3 -c "import sys; assert sys.version_info >= tuple(map(int, '{min-python}'.split('.')))"
----
The settings example is included from the examples folder.
[source,python]
----
include::example$client.py[tags=imports;demo]
----
A quick check in the interpreter:
[source,pycon]
----
>>> 2 + 3
5
----
The Antora directory reference and example include documentation describe these locations and resource IDs. The AsciiDoc source-block and tagged-region references explain the page-level constructs.
Why Antora examples drift
Antora encourages a healthy habit: keep runnable code in real files and show it on pages through includes. That habit removes copy-and-paste drift, but it creates a different kind of drift that is easy to miss in review.
Tagged regions hide the setup. A page that includes only the demo region shows the lines the author wanted to discuss. The import, the client construction or the configuration that made those lines work may sit in another region that the page does not include. When someone adds a new dependency to the full file, the file keeps working and the page silently loses a step. A reader who copies the displayed lines gets an undefined name.
Renamed example files break pages far from the diff. Moving client.py to a new folder is a one-line change in a pull request about code. Every page that includes it by resource ID now points at nothing. With the default log failure level the build still finishes. In our test, the published page then showed the text "Unresolved include directive in modules/ROOT/pages/index.adoc" followed by the include line, where the code should have been.
Attributes change commands everywhere at once. A minimum version or package name stored in antora.yml is substituted into every block that asks for attribute substitution. One edit to the descriptor changes the command on every such page, which is useful until the value is wrong. Blocks that do not request attribute substitution show the raw reference instead, which is a different kind of mistake that only appears on the rendered page.
Examples that live outside the page are run by nobody. Because the examples folder is not a test suite by default, files there can be stale for a long time. They look like source code, so readers trust them, but no CI job imports or runs them unless someone sets that up.
Versioned components multiply all of this. A playbook can list several branches of a content source, for example one per release, and Antora publishes each as a version of the component. A fix made on the main branch does not repair the same example in an older published version, and an example that was correct for an older release can be broken by a dependency that has since changed.
Each of these is a reason to test two things: the real example files, and the code that each page actually assembles from them.
Classify what the reader sees
| Kind | Appropriate check |
|---|---|
| Complete source block | Run it with the page’s prerequisites and in its documented sequence. |
| Included regions | Test the selected combination as displayed, including imports and setup. |
| Example file | Run or test the real file independently of the page. |
| Attribute-dependent command | Verify the value and substitution settings used for the build. |
| Configuration | Parse it and validate behavior with the relevant tool. |
| Output or intentional fragment | Review its meaning and state clearly what is omitted. |
A real-file test and a page-level test answer different questions. The complete example may pass because it contains an import outside the selected region. The page can fail because the selection omits that import. Conversely, a displayed snippet can work in isolation while another part of the maintained example file has become broken.
What a raw scan covers
The following command plans the illustrative raw repository scan. It does not execute examples without the execution flag.
docsalive scan .
In the verified repository, DocsAlive detected a plain Markdown layout and found one page, the root README, with no blocks. It did not scan any .adoc page. This is a coverage limit, not a clean result for the Antora site.
| Antora/AsciiDoc construct | What Antora renders | What the engine does in 0.6.3 |
|---|---|---|
.adoc page |
A site page | Does not scan it. |
| Source block | Highlighted source in the page | Cannot extract it from the raw AsciiDoc page. |
| Example resource include | Content from the examples folder | Does not resolve it in the raw page. |
| Tagged regions | Selected lines | Does not assemble or test the selection in the raw page. |
| Attribute substitution | A value inserted according to the block’s substitutions | Does not evaluate it in the raw page. |
| Markdown copy | Not the Antora page itself | Scans eligible fenced blocks, subject to language and runner limits. |
A label unknown to the engine can be reported as passing without being run or parsed. This is an engine limitation in 0.6.3. Check the language and the actual coverage rather than interpreting every green result as execution.
Convert the relevant source blocks
The following illustrative preparation script was verified for the layout above. It needs a YAML parser in its environment. It converts supported source blocks, resolves example includes and selected tags, and fills component attributes only where the block requests attribute substitution.
"""Write a scan-ready Markdown copy of Antora source blocks.
For every page in docs/modules/*/pages, each [source,LANG] or [,LANG]
block delimited by ---- becomes a fenced Markdown block. Lines such as
include::example$FILE[] and include::example$FILE[tags=a;b] are replaced
with the file (or its tagged regions) from the module's examples folder. Attribute references are
filled in from antora.yml only when the block sets subs with attributes.
"""
import re
import sys
from pathlib import Path
import yaml
root = Path(sys.argv[1] if len(sys.argv) > 1 else "docs")
out = Path(sys.argv[2] if len(sys.argv) > 2 else "scan-docs")
attrs = (yaml.safe_load((root / "antora.yml").read_text()).get("asciidoc") or {}).get("attributes") or {}
SOURCE = re.compile(r"^\[(?:source)?,\s*([\w+-]+)([^\]]*)\]\s*$")
INCLUDE = re.compile(r"^include::example\$([^\[]+)\[(.*)\]\s*$")
problems = 0
def region(path, tags):
lines = path.read_text().splitlines()
if not tags:
return lines
keep, active = [], set()
for line in lines:
m = re.search(r"(tag|end)::([\w-]+)\[\]", line)
if m:
(active.add if m.group(1) == "tag" else active.discard)(m.group(2))
continue
if active & set(tags):
keep.append(line)
return keep
for page in sorted(root.glob("modules/*/pages/**/*.adoc")):
module = page.relative_to(root).parts[1]
lines = page.read_text().splitlines()
md = [f"<!-- generated from {page} -->"]
i = 0
while i < len(lines):
m = SOURCE.match(lines[i])
if m and i + 1 < len(lines) and lines[i + 1].strip() == "----":
lang, opts = m.group(1), m.group(2)
body, j = [], i + 2
while j < len(lines) and lines[j].strip() != "----":
inc = INCLUDE.match(lines[j])
if inc:
target = root / "modules" / module / "examples" / inc.group(1)
tags = re.findall(r"tags?=([\w;-]+)", inc.group(2))
tags = tags[0].split(";") if tags else []
if target.exists():
body += region(target, tags)
else:
print(f"{page}:{j + 1}: missing example {target}")
problems += 1
else:
body.append(lines[j])
j += 1
text = "\n".join(body)
if "attributes" in opts:
text = re.sub(r"\{([\w-]+)\}", lambda a: str(attrs.get(a.group(1), a.group(0))), text)
md += ["", f"```{lang}", text, "```"]
i = j + 1
continue
if lines[i].startswith("= "):
md += ["", "# " + lines[i][2:]]
i += 1
dest = out / module / page.relative_to(root / "modules" / module / "pages").with_suffix(".md")
dest.parent.mkdir(parents=True, exist_ok=True)
dest.write_text("\n".join(md) + "\n")
print(f"wrote {dest}")
sys.exit(1 if problems else 0)
Create the copy and plan its scan as follows:
python3 scripts/adoc_scan_copy.py docs scan-docs
docsalive scan . --docs-dir scan-docs
The verified script run produced this file list:
wrote scan-docs/ROOT/index.md
The resulting scan covered two pages, including the root README, and three blocks. When executed, the shell version check, Python block and interpreter session passed. The engine compares printed output only in Python pycon or python-repl sessions. Findings point to the generated copy, so map them back to the original page and example file.
The next illustrative block is broken on purpose: it selects the demo region without the import. The copied Python block failed as depending on context because the required name was not defined; the rendered page also displays the incomplete selection.
[source,python]
----
include::example$client.py[tag=demo]
----
This illustrative diagnostic is also broken on purpose: the include names a file that does not exist. The preparation script reported the missing example and exited with a failure status.
docs/modules/ROOT/pages/index.adoc:14: missing example docs/modules/ROOT/examples/clients.py
In the verified build, Antora logged the missing include as an error but still exited successfully under the initial command. The following command makes that error fail the build:
npx antora --log-failure-level=error antora-playbook.yml
The Antora CLI options document the failure-level setting. Make the build gate explicit in your own CI, and review its logs as well as its exit status.
Know the conversion limits
The script is a focused aid, not a general Antora renderer. It does not handle partials, cross-module or cross-component resource IDs, conditionals, callout markers, or literal and listing blocks without a source language. Check those examples separately and compare representative copied blocks with the rendered site.
downdoc alone is not enough for this workflow: its documentation says it drops include directives. It suggests an Asciidoctor preprocessing step, but that step does not resolve Antora resource IDs. A conversion that silently loses an include cannot establish that the reader’s assembled example was tested.
Run the files in the examples folder using their own language’s test tools. Include dependencies, fixtures and supported versions in that test. Then test the selected page fragments separately, because a complete file’s setup may not appear in the selected regions.
Triage findings
| Finding | What to check next |
|---|---|
| Missing include | Correct the resource ID or restore the file; make the build fail on the logged error. |
| Undefined name in a selected region | Check whether an import or setup region was omitted from the page. |
| Attribute-dependent command fails | Compare the configured value and block substitutions with the rendered command. |
| Full file passes but page fails | Test the selected lines together, in the order shown. |
| Copy lacks a block | Determine whether it uses a construct the script does not support. |
| Credential or fixture needed | Record the gap and use an appropriate authorized test separately. |
Keep test setup visible. If the test installs a dependency that the page never mentions, decide whether that dependency is a documented prerequisite or an omission. A successful run with extra setup is useful evidence, but it does not by itself prove that a new reader can follow the page.
Use this checklist during review:
[ ] Build the Antora site with an appropriate log failure level.
[ ] Check changed example files and resource IDs.
[ ] Run examples as real files with their intended dependencies.
[ ] Review tagged selections for imports, setup and ordering.
[ ] Verify attribute values and substitution settings.
[ ] Create a fresh scan-ready Markdown copy and inspect its coverage.
[ ] Execute supported copied blocks and trace findings to source.
[ ] Test unsupported constructs and skipped examples separately.
Test the examples folder as real code
The examples folder is the easiest part of an Antora site to test well, because the files are already real source files. Treat it like a small project.
Give the folder the same dependency file and version pins a reader would use, and run each example as a program or import it from a test. The verified example in this guide runs as a complete file and prints its result, which is the simplest possible check. Larger examples usually benefit from a test file that imports them and asserts on a result, so that a change in behavior fails loudly instead of printing something slightly different.
Keep tagged regions meaningful. If a page shows only the demo region, put everything a reader needs for that region in it, or include the setup region on the page as well. A useful review rule is that every region a page includes should run when its regions are concatenated in the order shown. The scan-ready copy checks exactly that combination for the pages it supports.
Make the Antora build part of the same job. Set the log failure level so that a missing include stops the build, and run the build on pull requests that touch either pages or examples. A rename that breaks an include then fails in the pull request that caused it, not weeks later on the published site.
For versioned components, run the checks on each branch that still publishes, not only on the default branch. An older version's examples are still read and copied, and dependency changes can break them even when nobody edits that branch.
Finally, keep the conversion honest. When a page uses a construct the copy script does not support, record it as tested another way or not tested, rather than letting it disappear from the count. The docs testing checklist and the GitHub Actions guide show how to keep such a record in a release routine, and the Python docs testing guide covers testing example files directly.
Where DocsAlive fits
DocsAlive can run supported fenced examples in the reviewed Markdown copy and classify findings. It preserves supported Python block order within a page and runs each page in a fresh container. See the CLI reference and findings guide for the execution and triage model.
Keep the Antora build and direct example-file tests alongside that scan. The copy is an input prepared for testing, and its fidelity must be checked whenever the site uses a construct outside the script’s supported subset. A health check is a one-off report for an eligible public repository; account for the conversion and coverage limits when interpreting it. Plans and limits are on the pricing page; the Open source plan is $0 per month for a public OSI-licensed repository.
The sources we checked
These sources were read on November 13, 2026. Engine behavior was checked against engine 0.6.3 on the same day.
| Source | What it covers |
|---|---|
| Antora standard directories | Component and module layout |
| Include an example | Example resource IDs |
| Antora installation and build | Building a site |
| Antora CLI options | Build logging and failure level |
| AsciiDoc source blocks | Source block syntax |
| Tagged regions | Selecting included regions |
| downdoc | Conversion and include limitations |
FAQ
Does DocsAlive scan Antora pages directly?
No. Engine 0.6.3 scans Markdown and MDX, not .adoc pages. A raw Antora scan gives the AsciiDoc pages no coverage.
Why test both the example file and its selected regions?
The full file may contain setup or imports that the page omits. Testing both checks the maintained source and the fragment a reader actually sees.
Does a successful Antora build prove includes are present?
Not under every logging configuration. In the verified case a missing include was logged as an error while the build exited successfully; setting the log failure level to error made it fail.
Can downdoc alone prepare the scan?
Its documented conversion drops include directives. Resolve Antora resources with an appropriate preparation step and verify the generated copy against the rendered site.
Does the provided script support every Antora site?
No. It handles the stated source-block, example-include, tag and attribute patterns for this layout. Partials, cross-component resources and other unsupported constructs need separate handling.
What does a passing copied block prove?
It provides evidence for the supported check performed on that copied block under the test setup. Review the copy, skipped examples and direct file tests before drawing conclusions about the site.




