CRYSTAL-DOC(1)

NAME
crystal-doc - Generate API docs for Crystal code

SYNOPSIS

crystal build [options] [programfile] [--] [arguments]

DESCRIPTION

Generate documentation from comments using a subset of markdown. The output is saved in html format on the created docs/ folder. More information about documentation conventions can be found at

OPTIONS

--project-name NAME
    Set the project name. The default value is extracted from shard.yml if available.

    In case no default can be found, this option is mandatory.

--project-version VERSION
    Set the project version. The default value is extracted from current git commit or shard.yml if available.

    In case no default can be found, this option is mandatory.

--json-config-url URL
    Set the URL pointing to a config file (used for discovering versions).

--source-refname REFNAME
    Set source refname (e.g. git tag, commit hash). The default value is extracted from current git commit if available.

    If this option is missing and can’t be automatically determined, the generator can’t produce source code links.

--source-url-pattern URL
    Set URL pattern for source code links. The default value is extracted from git remotes ("origin" or first one) if available and the provider’s URL pattern is recognized.

    Supported replacement tags:

    %{refname}
        commit reference

    %{path}
        path to source file inside the repository

    %{filename}
        basename of the source file

    %{line}
        line number

    If this option is missing and can’t be automatically determined, the generator can’t produce source code links.

-o DIR, --output DIR
    Set the output directory (default: ./docs).

-b URL, --canonical-base-url URL
    Indicate the preferred URL with rel="canonical" link element.

-b URL, --sitemap-base-url URL
    Set the sitemap base URL. Sitemap will only be generated when this option is set.

--sitemap-priority PRIO
    Set the priority assigned to sitemap entries (default: 1.0).

--sitemap-changefreq FREQ
    Set the changefreq assigned to sitemap entries (default: never).