본문으로 건너뛰기
토파즈6.0 · 출시 전
다운로드 →

문서 검색

명세 6.0

방향키로 결과를 고르고 Enter를 눌러 여세요.

API 이름, 진단 번호, 규칙 또는 프로젝트 주제를 입력하세요.

    도구

    doc

    Generates documentation for a Topaz package.

    Invocation, options and results

    링크

    topaz doc

    호출 형식
    1. topaz doc

    입력

    topaz doc accepts no positional source operand. --root <dir> selects a package containing topaz.toml and defaults to the current directory.

    --out-dir <dir> is required and must name a nonempty directory path. --compiler selects self or rust, with self as the default. --verbose reports that selection on standard error.

    Applicable language and compiler resource options use the common compiler validation rules. --locked requests package lock verification. Source operands, output-format options, program arguments, missing values, repeated options, and attached values are rejected before documentation generation.

    옵션과 충돌

    옵션기본값계약충돌
    --compiler rust|selfself

    compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source.

    없음
    --lockedfalse

    Verify topaz.lock before compiling the selected package.

    없음
    --verbosefalse

    Reports the selected compiler and whether it was explicit or the default. For version, prints the detailed release report.

    없음
    --root <dir>.

    The explicit source root or package root for this invocation.

    없음
    --out-dir <dir>미지정

    generate deterministic package docs into --out-dir Required. doc requires --out-dir <dir>

    없음
    --language-version <5.21>5.21

    language version selector

    없음
    --compiler-memory-mib <MiB>8192

    self compiler worker memory budget (8192); overrides TOPAZ_COMPILER_MEMORY_MIB A positive integer is required. Environment input: TOPAZ_COMPILER_MEMORY_MIB.

    없음
    --compiler-time-ms <ms>1800000

    self compilation wall-clock budget (1800000); overrides TOPAZ_COMPILER_TIME_MS A positive integer is required. Environment input: TOPAZ_COMPILER_TIME_MS.

    없음

    출력 채널

    stdout

    stderr

    종료 상태

    0

    Both documentation files were generated and written.

    1

    Invalid arguments, invalid or unreadable packages, failed lock verification, parsing, resolution or checking errors, invalid compiler export products, compiler resource failures, and directory or output write failures.

    효과

    The command reads the package, imported sources, dependency content, and documentation comments. It creates the requested output directory if needed.

    After successful checking, it writes exports.json and then index.md. Existing files at those two paths may be replaced. Other files are preserved.

    A failure before output writing leaves both output files unchanged. A later I/O failure can leave one updated file or a partial file. The command returns failure and does not report completed documentation.

    Documentation generation makes no network requests and does not execute the package, fetch dependencies, or launch a documentation server.

    The same compiler and language mode, source and comment bytes, package configuration, and locked dependency identities produce identical documentation bytes. Export ordering is deterministic and output content does not include a generation timestamp.

    The completion message includes the selected destination. Path-sensitive diagnostics require identical path inputs for identical text.

    Documentation is always a package operation. --locked verifies the current lock before checking and never updates it. Registry dependencies and Lispex configuration require the applicable locked package checks.

    The command leaves the manifest, lock, dependency source, and vendor tree unchanged. The requested output directory does not become the package root.

    Operation

    링크

    Use the package root and output directory to select the package and destination.

    Option conditions

    링크

    --locked applies to package-mode check, run, emit, build, test, doc, bench, compiler observe, compiler preview. Selected-entry test also accepts it when --root contains topaz.toml.

    --compiler cannot be combined with bootstrap --producer or --self-source

    doc requires --out-dir <dir>

    Behavior contract

    링크
    규칙tools-commands-doc.rule.behavior

    Command behavior

    Arguments and rejection

    topaz doc accepts no positional source operand. --root <dir> selects a package containing topaz.toml and defaults to the current directory.

    --out-dir <dir> is required and must name a nonempty directory path. --compiler selects self or rust, with self as the default. --verbose reports that selection on standard error.

    Applicable language and compiler resource options use the common compiler validation rules. --locked requests package lock verification. Source operands, output-format options, program arguments, missing values, repeated options, and attached values are rejected before documentation generation.

    Output

    Successful generation leaves standard output empty and reports the output directory on standard error. Parse, resolver, checker, lock, and I/O diagnostics use standard error.

    exports.json contains the checked public export surface defined by check --exports-json. index.md contains the package documentation derived from those exports and their source documentation comments.

    --format json is rejected because doc has no JSON console report mode. The exports.json artifact is still produced on success because it has a distinct purpose from command presentation.

    Exit status

    Exit code 0 means both documentation files were generated and written.

    Exit code 1 covers invalid arguments, invalid or unreadable packages, failed lock verification, parsing, resolution or checking errors, invalid compiler export products, compiler resource failures, and directory or output write failures.

    Filesystem effects

    The command reads the package, imported sources, dependency content, and documentation comments. It creates the requested output directory if needed.

    After successful checking, it writes exports.json and then index.md. Existing files at those two paths may be replaced. Other files are preserved.

    A failure before output writing leaves both output files unchanged. A later I/O failure can leave one updated file or a partial file. The command returns failure and does not report completed documentation.

    Network access

    Documentation generation makes no network requests and does not execute the package, fetch dependencies, or launch a documentation server.

    Reproducibility

    The same compiler and language mode, source and comment bytes, package configuration, and locked dependency identities produce identical documentation bytes. Export ordering is deterministic and output content does not include a generation timestamp.

    The completion message includes the selected destination. Path-sensitive diagnostics require identical path inputs for identical text.

    Packages and locks

    Documentation is always a package operation. --locked verifies the current lock before checking and never updates it. Registry dependencies and Lispex configuration require the applicable locked package checks.

    The command leaves the manifest, lock, dependency source, and vendor tree unchanged. The requested output directory does not become the package root.

    이유

    Documentation follows the package's checked public exports. Requiring a package root and explicit destination avoids treating a stray source operand as an undocumented second package or output selection.

    The linked public CLI recipe checks the exact displayed argument rejection before the requested operation. It does not execute the successful operation or verify its effects.

    Successful documentation generation writes files and requires a package fixture, so it is outside the exact reviewed execution allowlist. The linked recipe exercises rejection of a positional source operand.

    Example contract

    링크
    규칙tools-commands-doc.rule.invocation

    Example contract

    The invocation topaz doc main.tpz --language-version 5.21 is expected to exit with 1.

    The command has no positional source operand. The adapter-supplied fixture operand is deliberately rejected before its operation; this is an arity example, not a successful doc session.

    이유

    Documentation is generated for the selected package and its exported API. Rejecting a source operand avoids implying that the command documents a different entry.

    Example

    링크

    Argument-rejection example

    링크
    main.tpzArgument-rejection example플레이그라운드 열기 →
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    대상 제품 5.21.3
    기대 결과

    기대 결과

    Textual rejection details remain Pending in the reference model. The independent Tools example gate expects exit 1.

    The command has no positional source operand. The adapter-supplied fixture operand is deliberately rejected before its operation; this is an arity example, not a successful doc session.

    Verification scope

    링크

    Observed with Topaz 5.21.3 on 2026-11-06T08:36:29.642Z. This invocation passed; exit 1. 3 assertions were evaluated against the independent expected result. Execution record. This result covers the displayed invocation.

    Related references

    링크

    Compiler selection →

    Packages, locks and targets →

    메뉴

    다운로드 →