Skip to content

usage generate markdown

Generate Markdown documentation from a usage spec

One page by default, or a page per command with --multi. Every part of the output comes from a Tera template that --template can replace.

Flags

  • -f --file <FILE> — A usage spec file, or a script with a usage shebang; "-" reads stdin

  • --view <VIEW> — Render one spec-declared executable view

  • -m --multi — Render each subcommand as a separate markdown file

  • --html-encode — Escape HTML in markdown

  • --out-dir <OUT_DIR> — Directory for the per-command pages (required with --multi)

    Effect: modifies state

  • --out-file <OUT_FILE> — Output file path for single-file markdown generation, or "-" for stdout (default)

    Effect: modifies state

  • --indented-blocks-to-code-fences — Turn four-space indented blocks in help text into markdown code fences

    --replace-pre-with-code-fences is the former name and still works. It was always a misnomer: this has never looked at <pre> tags.

  • --url-prefix <URL_PREFIX> — Prefix for the links between pages, such as /cli/reference

  • --link-extension <LINK_EXTENSION> — Extension for page links (including the dot); empty means extensionless URLs

    Default: .md

  • --template <TEMPLATE> — Replace a built-in Tera template, as NAME=PATH; the names are spec, index, command, argument, flag, and config

  • -h --help — Print help

MIT LicenseCopyright © 2026jdx.dev