Skip to content
FutureBlitz

    Install

    Tools

    fb doc

    Writes a package's public API as JSON, with its docs.

    fb doc [options] [file.fb | package folder | std]

    fb doc writes what a package’s users see, its Public declarations with their signatures and doc comments, as JSON, to build/<name>.json in the package’s folder. With no file or folder, it works on the package the current folder is in: the nearest folder, from the current one up, with a project.toml. fb doc std writes the standard library’s, to std.json in the current folder.

    It warns about each [Name] link that names nothing, and each doc comment that’s on no declaration. Doc comments describes the JSON.

    Options

    Option
    -o, --output <path>Where to write the JSON, or - for stdout
    --checkChecks that each module and declaration has a doc comment, and writes no JSON
    --releaseDocuments the code a release build compiles, where #If tests it
    --offlineUses only the registry packages in the cache
    --color <when>Colors the output: auto, always, or never

    Examples

    fb doc
    fb doc -o api.json
    fb doc std -o -
    fb doc --check

    fb doc --check fails when a module has no //! doc or a Public declaration has no /// doc, so a package’s CI can require docs.

    Report an issue with this page or with FutureBlitz on GitHub.