Building the Documentation Site
This guide covers everything you need to generate the Book documentation site locally and understand how it is published in CI/CD.
Prerequisites
| Requirement | Version | Notes |
|---|---|---|
JDK |
21+ |
Required to run Gradle and AsciidoctorJ |
Gradle |
8.x (provided via |
The wrapper resolves the correct version automatically. |
Network access |
โ |
Maven dependencies resolve from Maven Central. |
Running the Full Pipeline
./gradlew clean :documentation:buildDocsSite
Configuration Cache Compatible:
Because all documentation tasks are implemented via customJavaExecrunners (MarkdownConverterRunner,AsciidoctorRunner,SiteAssemblerRunner,SearchIndexBuilderRunner), the documentation pipeline is 100% configuration-cache compatible and runs efficiently with configuration caching enabled.
On success you will see:
verifyDocsSite PASSED โ dist/index.html โ dist/search-index.js โ dist/*.css (1 file(s)) โ BUILD SUCCESSFUL
The assembled site is in documentation/build/dist/.
Open documentation/build/dist/index.html in a browser to review it locally.
Pipeline Architecture
The buildDocsSite task chains five steps in sequence (all implemented as pure Kotlin/JavaExec runners โ Python is not required):
convertMarkdownToAsciiDoc
โ
โผ
copyPumlSources
โ
โผ
asciidoctor
โ
โผ
assembleSite
โ
โผ
buildSearchIndex
โ
โผ
verifyDocsSite โ buildDocsSite depends on this
Step Details
| Task | Runner | Input | Output |
|---|---|---|---|
|
|
Explicit list of |
|
|
Bash inline |
|
Copies to each nesting level under |
|
|
|
|
|
|
|
|
|
|
|
|
|
Gradle |
|
Fails the build if required outputs are missing |
Output Contract (CI/CD)
The CI/CD publishing mechanism copies the contents of documentation/build/dist/ to the internal hosting target.
Required outputs (verified by verifyDocsSite):
| File | Description |
|---|---|
|
Home page (generated from |
|
Client-side search index (H2/H3 indexed entries from all pages) |
|
Site stylesheet |
|
Per-page HTML for |
|
Extension API pages |
|
PlantUML diagram PNGs |
All asset paths inside the HTML are strictly relative (./, ../) โ the site can be served from any root path without reconfiguration.
Included Source Files
All Markdown files under the project root (.md) and the docs/ directory (docs/*/.md) are processed automatically โ *no Gradle change is needed to add a new page. Files outside these scopes (e.g. prompts/, todo/, .agent/, .github/, .bk/) are naturally excluded.
The following files are explicitly excluded from the site via the exclude() list in documentation/build.gradle.kts:
Excluded Files
| File | Reason |
|---|---|
|
Internal agent configuration, not user-facing |
|
Not user-facing documentation |
|
Internal tooling reference |
|
Superseded by auto-generated sidebar |
|
Runtime AI agent prompt configs, not documentation |
Note:
.pumldiagram files underdocs/diagrams/are not standalone pages โ they are embedded in relevant pages viaplantuml::blocks and are handled separately by thecopyPumlSourcestask.
Adding a New Documentation Page
Follow these steps to add a new Markdown file to the site:
1. Write your Markdown file
Place it in the project root or anywhere under docs/. Use standard Markdown syntax โ the converter handles headings, lists, tables, code blocks, and inline links automatically.
Adhere to these conventions:
-
Start the file with a single
# H1heading โ this becomes the page title in the sidebar. -
Use
textfor internal cross-references; they are auto-converted to AsciiDocxref:links. Target filenames are normalised to the lowercased snake_case output names (e.g.ARCHITECTURE.mdโarchitecture.adoc), so casing in the link does not matter โ but the target file must exist. -
Badge images (``) are stripped automatically.
-
Blockquotes (
> text) become[NOTE]admonition boxes.
2. No Gradle change required
The convertMarkdownToAsciiDoc task auto-discovers all .md files in the project root and all docs/*/*.md files. Simply dropping your file into one of those locations is sufficient โ it will be picked up automatically on the next build.
If you need to suppress a file from the site instead, add its root-relative path to the exclude() list inside the convertMarkdownToAsciiDoc task in documentation/build.gradle.kts:
val sourcesTree = fileTree(projectRoot) {
include("*.md", "docs/**/*.md")
exclude(
// existing exclusions ...
"docs/YOUR_FILE_TO_SUPPRESS.md" // โ add here to exclude
)
}
3. Rebuild
./gradlew clean :documentation:buildDocsSite --no-configuration-cache
The new page appears automatically in the sidebar under the appropriate group (root-level or docs/ group), ordered alphabetically.
Sidebar Ordering
The sidebar navigation is generated by SiteAssemblerRunner.kt using these conventions:
-
index.html(fromREADME.md) โ always first. -
Other root-level pages โ alphabetical by filename.
-
docs/top-level pages โ alphabetical, grouped under "Docs". -
docs/subdirectory groups โ alphabetical by directory name; files within each group alphabetical.
No manual configuration of the sidebar is required.
Syntax Highlighting
Code blocks use highlight.js via the AsciidoctorJ HTML5 backend (:source-highlighter: highlight.js). The following languages are fully supported:
-
Kotlin / Kotlin Script (
.kts) -
Bash / Shell
-
JSON
-
YAML
No Ruby or external tools are required for syntax highlighting.
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
|
JDK not on |
Set |
|
Network access to Maven Central unavailable |
Verify network connectivity |
Diagrams missing from pages |
|
Verify |
Search returns no results |
|
Run |
|
One or more required output files absent |
Inspect prior task failures in the build log |