Reference generator
The reference chapters of this book are generated from the code and data in the repository by the
workspace crate crates/tappet-docgen (publish = false). This page describes what it does, for
contributors; readers of the reference do not need it.
Goals
- The reference matches the binary it documents. No hand-maintained parameter, option or endpoint tables.
- Output is deterministic: running the generator twice on the same tree produces identical bytes, so CI can fail when the committed pages are stale.
- The generator never invents text. Every sentence about a node comes from its descriptor, its connector file or its mapping file. Missing descriptions are reported, not filled in.
- No n8n material is involved. Import coverage is computed from our own mapping files and parity fixture ids only.
Running it
cargo run -p tappet-docgen # rewrite the generated pages
cargo run -p tappet-docgen -- --check # exit 1 and list stale files; writes nothing
cargo run -p tappet-docgen -- --verbose # also print every input problem
cargo run -p tappet-docgen -- --strict # exit 1 when there are input problems
mdbook build docs # build the book into target/book
python3 docs/tools/check_docs.py # links, anchors, code blocks, no emojis
Run the generator after changing node descriptors, connector files, mapping files, CLI flags, the
configuration variable table, API routes or the UI design tokens, and commit the result. CI should
run --check on pull requests that touch crates/, connectors/, mappings/ or ui/src/lib/.
Inputs
| Input | Source | Used for |
|---|---|---|
| Node descriptors | NodeRegistry built by tappet_cli::wiring::build_registry, the same function tappet serve uses | Built-in node pages and the node index |
| Connector definitions | ConnectorCatalog::embedded() | Connector pages and the connector index |
| Connector load errors | ConnectorCatalog::load_issues() | The list of connectors that did not load |
| Cassette tests | connectors/<id>/tests/*.cassette.yaml (operation: or trigger: key) | Test count per operation and trigger |
| Mapping files | mappings/n8n/*.yaml | Import sections and the import column of the indexes |
| Parity fixture index | Directory names under parity/fixtures/ | Resolving evidence: ids to verified or unverified |
| Command definitions | tappet_cli::cli::Cli through clap | Command reference in reference/cli.md |
| Configuration variables | tappet_cli::config::vars::VARS and the headings of configuration.md | reference/config-vars.md |
| API routes | tappet_server::api::openapi_document() | api/openapi.json and reference/api-endpoints.md |
| Design tokens | ui/src/lib/tokens.css | theme/tokens.css |
The generator links against the crates; it does not parse Rust source.
Outputs
Paths are relative to docs/.
reference/nodes/<prefix>/<name>.md one page per built-in node type (core.if -> core/if.md)
reference/connectors/<id>.md one page per connector: action node and trigger node together
reference/connectors.md connector index (whole file)
reference/config-vars.md configuration variable index (whole file)
reference/api-endpoints.md endpoint index (whole file)
api/openapi.json the OpenAPI document, served with the book
theme/tokens.css the UI tokens with theme selectors mapped to mdBook themes
reference/nodes.md region node-index
reference/cli.md region cli-commands
SUMMARY.md regions node-pages and connector-pages
Files under reference/nodes/ and reference/connectors/ are owned by the generator: pages for
node types or connectors that no longer exist are deleted.
Marker regions
In hand-written files the generator only rewrites the text between
<!-- BEGIN GENERATED: <name> --> and <!-- END GENERATED: <name> -->, and fails if a marker
is missing or duplicated. The END marker’s indentation is kept.
In SUMMARY.md a region must be the last child list of its parent entry: mdBook drops a nested
list that is followed, inside the same parent, by an HTML comment and another nested list. A test
in the generator checks that the line after each END marker is not a nested entry.
Page formats
Built-in node page:
# <display_name>
`<type_name>` · version <version> · <group> [· <kind> trigger] [· exec capability]
<description>
## Ports Port | Kind | Label | Required | Max connections
## Credentials Slot | Accepted kinds | Required
## Parameters Name | Type | Default | Required | Shown when | Description
## Import Source type | Version range | Status | Fixtures
Connector page: title, node types and categories, description and vendor documentation link, then Authentication (method, credential kind, auth kind, fields with secret ones marked, test request), Actions (one subsection per resource with an operation table, then each operation’s parameters), Lookups, Triggers (kind, deduplication key, signature scheme, whether webhook registration is automatic, parameters), Import and Provenance.
Rules:
- Parameters are listed in descriptor order. Nested
collectionandfixed_collectionchildren are listed under the parent with a dotted name (options.timeout). Shown whenrendersshow_whenasoperation = post, send, joining keys with;.- Defaults are compact JSON in a code span; absent defaults are an empty cell.
- Option lists of up to 12 values are listed in the description; longer lists get their own table.
- Versions use the shortest exact decimal form (
2,2.2,4.2). - Pipes,
<,>,*and mdBook{{#directives in source text are escaped; code spans are kept literal. Sentences get a final period. - A version range is verified when the mapping file says
status: verified, or when it has rules and every rule’sevidence:names an existing parity fixture.
Input problems
The generator reports, and with --strict fails on:
- a node, connector or connector operation with an empty description,
- a parameter without a display name that cannot be humanized,
- a connector without
provenance:, - a connector file that does not load,
- a mapping file whose
evidence:names a fixture that does not exist, - a mapping target that is not a registered node type,
- a configuration variable that
configuration.mddoes not document.
Two node types that would produce the same page path are always an error.
Determinism
- No timestamps, generator versions or absolute paths in the output.
- Sorted by byte order on ids; hash maps are never iterated unsorted.
\nline endings, one trailing newline, no trailing spaces.
Later extensions
reference/expression-extensions.md: the supported expression extension methods with one example each, generated from the expression engine’s method table and its fixtures.reference/credential-kinds.md: every credential kind with its fields, from the vault registry and connector auth definitions.- A “requires the
<feature>build” note for nodes registered behind cargo features.