Skip to content

doc: comline doc, the package's documentation - #111

Merged
Kinflou merged 1 commit into
mainfrom
cli/doc
Nov 1, 2026
Merged

Kinflou merged 1 commit into
mainfrom
cli/doc

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 1, 2026

Copy link
Copy Markdown
Member

Part of ComlineProject/core#145, step 5 of the autodoc cascade.

comline doc

comline doc [--out <dir>] [--version <v>] [--changelog-from <v>] [--format markdown|json]
  • Working tree by default (doc::model on the compiled package); --version documents a built version from its frozen IR and the //! headers core now freezes (doc::model_frozen + doc::read_docs, core#152). A built version has no source, so no wire summary.
  • --changelog-from <v> adds doc::changelog from that built version to the documented one.
  • --format json writes model.json; any other format is a renderer id. markdown is the official renderer (comline-doc-markdown), linked in and answered in process through the protocol (external::builtin_render), as the built-in generators are.
  • Read-only: nothing goes to .comline/.
  • No watch mode, as asked (comline generate --watch exists).

[doc] in comline.toml

Shared types from comline_codegen::config (generation#95), so the JSON Schema and the LS get it: out (default docs/api), format (default markdown), renderer, timeout, links (dependency → base URL), changelog_from. Each flag overrides its key.

renderer = "<path>" runs through the same external::External as an external generator: wasmtime sandbox, limits, path checks. It's asked to Describe first and refused, before anything is sent, unless it lists the format in renderers at the CLI's model version.

Pins

core 076cae0, generation 7b51264 (+ comline-doc-markdown at the same rev), comline-rust bef9a74, comline-typescript 47b54cc. The test-generator fixture workspace moves to the same revs and gains a renderer binary.

Tests

  • tests/cli/doc.rs: working-tree pages, a built version documented with its frozen headers after the sources changed, a changelog, [doc] settings with --format json, an unknown format.
  • tests/cli/external.rs: the Markdown renderer as an external .wasm and native program writes exactly what the built-in writes; a generator offering no renderer is refused.
  • docs/cli.md documents the command and the table.

Byte-identical generated code

comline generate with the main binary (76afd09) and this branch's, over chat_project, simple_project and validated_project × {Rust code + TS code with validate_on_decode = "collect", Rust lib, TS lib with async = true}: 39 files, sha256sum lists identical.

Local CI: cargo build, cargo test (117 CLI tests + unit), cargo fmt --check (both manifests), both clippy -D warnings runs.

Markdown pages from the official renderer (linked in like the official
generators), or the documentation model as JSON. `--version` documents a
built version from its frozen IR and `//!` headers, `--changelog-from`
adds a changelog, and comline.toml's `[doc]` table sets the defaults:
`out`, `format`, `renderer` (an external renderer, run like an external
generator through the same sandbox, limits and path checks), `timeout`,
`links` and `changelog_from`.

Pins core 076cae0, generation 7b51264, comline-rust bef9a74 and
comline-typescript 47b54cc. Generated code is unchanged.
@Kinflou
Kinflou merged commit 67241af into main Nov 1, 2026
2 checks passed
@Kinflou
Kinflou deleted the cli/doc branch November 1, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant