Docs as Code Reference
Curated reference for documentation-as-code patterns used in the Domus ecosystem.
Related Documentation
| Resource | Description |
|---|---|
Complete AsciiDoc reference from daily essentials to expert techniques. Progressive learning guide covering attributes, conditionals, substitutions, includes, tables, STEM math, and community contribution. |
|
Advanced patterns combining D2 diagrams, AsciiDoc, and Unix tooling for documentation workflows. |
|
Validated design for multi-repository documentation aggregation with Antora. |
|
Domus-specific AsciiDoc conventions and style guide. |
|
Validated design for D2 diagram integration in documentation. |
|
Runbook for setting up the documentation aggregation system. |
| New to AsciiDoc? Start with Level 1: Daily Essentials in the AsciiDoc Mastery guide. |
AsciiDoc Basics
Document Header
= Document Title
:description: Page description for SEO
:navtitle: Short Nav Title
:keywords: comma, separated, keywords
:author: Your Name
:revdate: 2026-02-12
:icons: font
Admonitions
NOTE: Informational note.
TIP: Helpful tip.
IMPORTANT: Important information.
WARNING: Warning message.
CAUTION: Danger zone.
Renders as:
| Informational note. |
| Helpful tip. |
| Important information. |
| Warning message. |
| Danger zone. |
Source Code Blocks
Tables
Collapsible Blocks
.Click to expand
[%collapsible]
====
Hidden content here.
Can include any AsciiDoc content:
* Lists
* Code blocks
* Tables
====
Renders as:
Click to expand
Hidden content here.
Can include any AsciiDoc content:
-
Lists
-
Code blocks
-
Tables
Links and Cross-References
Internal Cross-References (Same Component)
xref:page.adoc[Link Text]
xref:folder/page.adoc[Link Text]
xref:page.adoc#section-id[Link to Section]
Includes (Antora)
Diagrams as Code
D2
[d2,my-diagram,svg]
----
client -> server: request
server -> database: query
database -> server: results
server -> client: response
----
D2 Shapes
# Basic shapes
rectangle: Rectangle
oval: Oval {shape: oval}
cylinder: Database {shape: cylinder}
cloud: Cloud {shape: cloud}
hexagon: Hexagon {shape: hexagon}
# Connections
rectangle -> oval: arrow
oval <-> cylinder: bidirectional
cylinder -- cloud: line (no arrow)
cloud -> hexagon: labeled arrow {
style.stroke-dash: 3
}
Mermaid
[mermaid]
----
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
----
Keyboard and Menu Macros
Press kbd:[Ctrl+C] to copy.
Select menu:File[Save As > PDF].
Click btn:[OK] to confirm.
Renders as:
Press Ctrl+C to copy. Select . Click OK to confirm.
Comments
// Single line comment (not rendered)
////
Multi-line comment block.
Nothing here is rendered.
////
Antora Component Structure
docs/
├── antora.yml # Component descriptor
└── modules/
└── ROOT/
├── nav.adoc # Navigation
├── pages/ # Content pages
│ ├── index.adoc
│ └── topic/
│ └── page.adoc
├── partials/ # Reusable fragments
├── examples/ # Includable code
├── images/ # Images
└── attachments/ # Downloadable files
antora.yml Example
name: component-name
title: Component Title
version: '2026'
start_page: index.adoc
nav:
- modules/ROOT/nav.adoc
nav.adoc Example
* xref:index.adoc[Overview]
* Section Name
** xref:page1.adoc[Page 1]
** xref:page2.adoc[Page 2]
* Another Section
** xref:folder/page3.adoc[Page 3]