Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

  1. The reference matches the binary it documents. No hand-maintained parameter, option or endpoint tables.
  2. Output is deterministic: running the generator twice on the same tree produces identical bytes, so CI can fail when the committed pages are stale.
  3. 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.
  4. 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

InputSourceUsed for
Node descriptorsNodeRegistry built by tappet_cli::wiring::build_registry, the same function tappet serve usesBuilt-in node pages and the node index
Connector definitionsConnectorCatalog::embedded()Connector pages and the connector index
Connector load errorsConnectorCatalog::load_issues()The list of connectors that did not load
Cassette testsconnectors/<id>/tests/*.cassette.yaml (operation: or trigger: key)Test count per operation and trigger
Mapping filesmappings/n8n/*.yamlImport sections and the import column of the indexes
Parity fixture indexDirectory names under parity/fixtures/Resolving evidence: ids to verified or unverified
Command definitionstappet_cli::cli::Cli through clapCommand reference in reference/cli.md
Configuration variablestappet_cli::config::vars::VARS and the headings of configuration.mdreference/config-vars.md
API routestappet_server::api::openapi_document()api/openapi.json and reference/api-endpoints.md
Design tokensui/src/lib/tokens.csstheme/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 collection and fixed_collection children are listed under the parent with a dotted name (options.timeout).
  • Shown when renders show_when as operation = 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’s evidence: 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.md does 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.
  • \n line 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.