- High-level or cross-cutting developer documentation: this
docs/directory. - Key design decisions: the Decisions file.
- Code snippets: src/test/kotlin directory.
- Snippets are compiled as part of the build to ensure they stay fresh.
- Mark snippet regions in test code with
// BEGIN:snippet-nameand// END:snippet-name - Reference in Markdown with
<!-- SNIPPET:snippet-name --> - The
buildDocstask extracts and injects snippets automatically. - See Snippets for an example.
- Diagrams: Use Mermaid syntax in Markdown files.
- GitHub can render Mermaid diagrams natively in Markdown files.
- See Mermaid Live Editor for previewing diagrams.
- See Diagrams for an example.
- Module-specific design/dev documentation: in their respective module directories, typically in a
README.mdfile.- Use
README.mdas the entry point for module docs. - Use specific Markdown files for larger topics as needed. E.g.,
ARCHITECTURE.md,INSTALLATION.md, etc. - These files will be copied into the assembled docs site under
modules/.
- Use
- API/Code documentation: generated Javadoc/KDoc
- public classes and methods should have comprehensive Javadoc/KDoc comments.
- private/internal classes and methods should have concise comments explaining non-obvious logic.
Documentation is assembled and published via GitHub Pages:
- Source: Markdown lives close to code (this
docs/folder + module READMEs) - Build:
./gradlew buildDocsassembles the site intobuild/site/:- Copies cross-cutting docs from
docs/ - Copies module
READMEs (and other Markdown) intomodules/ - Extracts and injects code snippets
- Generates an index with navigation
- Copies cross-cutting docs from
- Deploy: GitHub Actions pushes
build/site/to thegh-pagesbranch - Serve: GitHub Pages runs Jekyll to render Markdown as HTML
Basic CQL translation:
Example Mermaid diagram:
graph TD
A[Start] --> B{Is it working?}
B -- Yes --> C[Celebrate]
B -- No --> D[Debug]
D --> B