'\" t .\" Title: crystal-docs .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.26 .\" Date: 2026-07-23 .\" Manual: Crystal Compiler Command Line Reference Guide .\" Source: crystal 1.21.0 .\" Language: English .\" .TH "CRYSTAL\-DOC" "1" "2026-07-23" "crystal 1.21.0" "Crystal Compiler Command Line Reference Guide" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" crystal-doc \- Generate API docs for Crystal code .SH "SYNOPSIS" .sp \fBcrystal build\fP [options] [programfile] [\-\-] [arguments] .SH "DESCRIPTION" .sp 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 \c .URL "https://crystal\-lang.org/docs/conventions/documenting_code.html" "" "." .SH "OPTIONS" .sp \fB\-\-project\-name\fP \fINAME\fP .RS 4 Set the project name. The default value is extracted from shard.yml if available. .sp In case no default can be found, this option is mandatory. .RE .sp \fB\-\-project\-version\fP \fIVERSION\fP .RS 4 Set the project version. The default value is extracted from current git commit or shard.yml if available. .sp In case no default can be found, this option is mandatory. .RE .sp \fB\-\-json\-config\-url\fP \fIURL\fP .RS 4 Set the URL pointing to a config file (used for discovering versions). .RE .sp \fB\-\-source\-refname\fP \fIREFNAME\fP .RS 4 Set source refname (e.g. git tag, commit hash). The default value is extracted from current git commit if available. .sp If this option is missing and can\(cqt be automatically determined, the generator can\(cqt produce source code links. .RE .sp \fB\-\-source\-url\-pattern\fP \fIURL\fP .RS 4 Set URL pattern for source code links. The default value is extracted from git remotes ("origin" or first one) if available and the provider\(cqs URL pattern is recognized. .sp Supported replacement tags: .sp \fB%{refname}\fP .RS 4 commit reference .RE .sp \fB%{path}\fP .RS 4 path to source file inside the repository .RE .sp \fB%{filename}\fP .RS 4 basename of the source file .RE .sp \fB%{line}\fP .RS 4 line number .RE .sp If this option is missing and can\(cqt be automatically determined, the generator can\(cqt produce source code links. .RE .sp \fB\-o\fP \fIDIR\fP, \fB\-\-output\fP \fIDIR\fP .RS 4 Set the output directory (default: ./docs). .RE .sp \fB\-b\fP \fIURL\fP, \fB\-\-canonical\-base\-url\fP \fIURL\fP .RS 4 Indicate the preferred URL with rel="canonical" link element. .RE .sp \fB\-b\fP \fIURL\fP, \fB\-\-sitemap\-base\-url\fP \fIURL\fP .RS 4 Set the sitemap base URL. Sitemap will only be generated when this option is set. .RE .sp \fB\-\-sitemap\-priority\fP \fIPRIO\fP .RS 4 Set the priority assigned to sitemap entries (default: 1.0). .RE .sp \fB\-\-sitemap\-changefreq\fP \fIFREQ\fP .RS 4 Set the changefreq assigned to sitemap entries (default: never). .RE