STD-004: AsciiDoc Conventions
Authoring rules for every .adoc file across all domus spoke repositories. These conventions ensure build reliability, attribute consistency, and cross-component xref resolution.
Principles
-
Attributes over literals. Mutable values (IPs, hostnames, ports, paths, policy names) MUST be expressed as
{attribute-name}, never hardcoded. This enables single-source-of-truth updates. -
Verify before use. Every attribute MUST be confirmed to exist in
antora.ymlbefore being used in a document. Assumed attributes are the #1 cause of build failures. -
Build before commit. No commit passes without a clean build check. Broken builds block the entire Cloudflare Pages deploy pipeline.
-
No inline TOC. Antora UI provides a global sidebar TOC. Adding
:toc:to any page creates a duplicate. -
No credentials in documents. Redact with
<REDACTED>. gopass paths and Vault policy names are acceptable; secret values are not.
Requirements
-
Every
.adocfile MUST NOT contain:toc:,:toclevels:, or:toc-title:attributes. -
Every mutable value (IP, hostname, port, MAC, VLAN, path, policy name) MUST use an
{attribute}reference, never a hardcoded literal. -
Before using any attribute, the author MUST verify it exists:
grep -i "<term>" docs/asciidoc/antora.yml. -
Code blocks containing
{attribute}references MUST includesubs=attributes+. -
Before every commit touching
.adocfiles:make 2>&1 | grep -E "WARN|ERROR"MUST return clean. -
Credentials, tokens, and secret values MUST NOT appear in any document. Redact with
<REDACTED>. -
Cross-references in nested directories MUST use full paths from
pages/root. Relative xrefs fail in subdirectories. -
Cross-component xrefs MUST use double-colon syntax:
Text.
Pre-Write Checklist
# 1. List available attributes
grep -E "^ [a-z]" docs/asciidoc/antora.yml | head -100
# 2. Search for specific attribute before using it
grep -i "<term>" docs/asciidoc/antora.yml
# 3. Build before committing
make 2>&1 | grep -E "WARN|ERROR"
Document Header Template
Every page MUST include at minimum:
= Page Title
:description: Brief description
:navtitle: Short Nav Title
:icons: font
No :toc: attributes. No hardcoded values in the header.
Attribute Usage in Code Blocks
// Correct — subs=attributes+ enables attribute interpolation
[source,bash,subs=attributes+]
\----
ssh {person-evan}@{domain}@{ws-aw-hostname}
\----
// Wrong — attributes render as literal text without subs
[source,bash]
\----
ssh {person-evan}@{domain}@{ws-aw-hostname}
\----
Cross-Reference Rules
// Same component — full path from pages/
xref:education/rhcsa/index.adoc[RHCSA]
// Cross-component — double colon
xref:infra-ops::runbooks/vyos-deployment.adoc[VyOS Deployment]
xref:ise-linux::02-pki/certificate-enrollment.adoc[Cert Enrollment]
// WRONG — relative xref in subdirectory (will fail)
xref:capitulo-001.adoc[Chapter I]
// CORRECT — full path
xref:education/literature/quijote/primera-parte/capitulo-001.adoc[Chapter I]
Compliance
| Check | Method | Pass Criterion |
|---|---|---|
No inline TOC |
|
Zero matches |
No hardcoded IPs |
|
Zero matches (excluding comments and attribute references) |
Build clean |
|
Zero output |
Attributes verified |
Every |
|
No credentials |
`grep -riE 'password |
token |
secret |
apikey' pages/ | grep -v REDACTED | grep -v gopass` |
Zero real credentials |
Exceptions
None. All requirements apply unconditionally to every .adoc file in every domus spoke repository.
Related
-
STD-003: File Naming — filename conventions
-
STD-001: Project Structure — project-level documentation standard
-
AsciiDoc Patterns — experiential patterns behind this standard
-
Antora Patterns — multi-repo conventions