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 ./gradlew)

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 custom JavaExec runners (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

convertMarkdownToAsciiDoc

MarkdownConverterRunner.kt (JavaExec)

Explicit list of .md source files (see below)

build/docs/generated/

copyPumlSources

Bash inline

docs/diagrams/*.puml

Copies to each nesting level under generated/

asciidoctor

AsciidoctorRunner.kt (JavaExec)

build/docs/generated/

build/docs/html/ โ€” one HTML file per page, plus images/ for PlantUML PNGs

assembleSite

SiteAssemblerRunner.kt (JavaExec)

build/docs/html/ + src/site/template/

build/dist/ โ€” final multi-page site with sidebar layout

buildSearchIndex

SearchIndexBuilderRunner.kt (JavaExec)

build/dist/*.html

build/dist/search-index.js

verifyDocsSite

Gradle doLast assertions

build/dist/

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

dist/index.html

Home page (generated from README.md)

dist/search-index.js

Client-side search index (H2/H3 indexed entries from all pages)

dist/custom.css

Site stylesheet

dist/docs/*.html

Per-page HTML for docs/ source files

dist/docs/extend/*.html

Extension API pages

dist/images/

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

AGENTS.md

Internal agent configuration, not user-facing

CHANGELOG.md

Not user-facing documentation

SHELL_SCRIPTS.md

Internal tooling reference

docs/INDEX.md

Superseded by auto-generated sidebar

docs/extend/samples/**

Runtime AI agent prompt configs, not documentation

Note: .puml diagram files under docs/diagrams/ are not standalone pages โ€” they are embedded in relevant pages via plantuml:: blocks and are handled separately by the copyPumlSources task.


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 # H1 heading โ€” this becomes the page title in the sidebar.

  • Use text for internal cross-references; they are auto-converted to AsciiDoc xref: 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:

  1. index.html (from README.md) โ€” always first.

  2. Other root-level pages โ€” alphabetical by filename.

  3. docs/ top-level pages โ€” alphabetical, grouped under "Docs".

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

BUILD FAILED on asciidoctor task

JDK not on PATH or version < 21

Set JAVA_HOME to a JDK 21+ installation

asciidoctorj artifacts not resolved

Network access to Maven Central unavailable

Verify network connectivity

Diagrams missing from pages

.puml files not copied to generated/diagrams/

Verify copyPumlSources task ran; check docs/diagrams/*.puml exist

Search returns no results

search-index.js missing or empty

Run buildSearchIndex task in isolation; check dist/ HTML files exist

verifyDocsSite FAILED

One or more required output files absent

Inspect prior task failures in the build log