Generation

Code generation framework


The Generation framework produces files from structured inputs. Each generator targets a specific output format and integrates with Bazel for incremental, cacheable builds.


Generators

Web

HTML, CSS, syntax highlighting, and WebAssembly from Rust DSL

Author documentation pages as .document.rs files using the Composition trait. The web generator renders complete HTML with automatic table-of-contents, syntax-highlighted code blocks, golden-ratio styling, and optional WASM interactivity.

more →

Autotest

JSON-driven test generation for Rust

Eliminate test boilerplate by generating Rust test functions from templates and JSON case definitions. Write the logic once, define test data declaratively, and produce exhaustive test suites with parameter shadowing and tag organization.

more →

Extract

Code extraction via tree-sitter queries

Pull code snippets from source files at build time using tree-sitter queries. Extracted snippets become constants in generated Rust libraries, keeping documentation in sync with the codebase.

more →


Source

Deploys generated files to the workspace via a manifest-driven copy. Supports verification mode to detect drift between generated output and committed source.

bazel run //:distribute.documentation

These docs were generated with this framework — authored as .document.rs files and rendered to HTML by the web generator.