SHDOC(1)
π SHDOC(1) β the girlies' guide to shdoc π
User Commands Β· shdoc Β· v1.4 Β· June 2026
okay so bestie, welcome to shdoc(1) π
this is the manual page for shdoc, a whole little tool that lives in your terminal and turns boring shell comments into gorgeous Markdown docs. no cap. let's get into it π«Ά
β¨ NAME β¨
shdoc</purgle> β generate Markdown API documentation from shell source comments π
(no seriously that's the whole vibe. comments in, docs out. iconic.)
β¨ SYNOPSIS β¨
shdoc [-h|--help]
shdoc [--version]
shdoc [FILE]
that's it. three shapes. pick your fighter πΈ
β¨ DESCRIPTION β¨
okay so here's the tea β shdoc reads a shell script, parses up all the annotation comments, and writes GitHub-flavored Markdown documentation straight to standard output. slay.
if FILE is omitted, input gets read from standard input instead. (yes bestie, it does the pipe thing, we love a flexible queen π)
annotations are comments that begin with # @. so like, the comment has to start with a hash, then an at-sign. that's the signal π¦
here's how the pieces work:
- File annotations describe the generated document. they're about the doc as a whole β¨
- Function annotations are collected until the next shell function declaration, and it's at that point that the pending block gets rendered. so they queue up, and then boom, they render. no cap.
- Section annotations group the functions that follow them. cute little group chats for your functions π«Ά
- Function-like text inside
@exampleblocks is ignored. very important. the parser is not gonna get confused by your example code, she's smarter than that π
β¨ OPTIONS β¨
-h,--helpβ show the command-line help and then dip. exit. done. π--versionβ show version information and exit. that's it, that's the whole job β
β¨ ANNOTATIONS β¨
this is the main character section tbh. every annotation starts with # @ and here's what each one does π
@nameβ set the project name, which gets used as the document title. the whole doc's name tag π@fileβ alias for@name. same energy, different spelling π¦@briefβ set a short project summary. like a little bio, but for your project β¨@descriptionβ set a multiline description for the file, the current section, or the next function. the continuation lines get written as comment lines after the tag. so you keep going and it keeps catching it π@deprecatedβ mark the next documented function as deprecated. (oof, but we still document her, respectfully π)@sectionβ start a named section for the functions that follow. group chat time π@exampleβ add a multiline usage example for the next function. the captured block gets unindented and rendered as a Bash code fence. periodt.@optionβ describe a command-line option that the function accepts. options can be short, long, or alternatives separated by a vertical bar (|) πΈ@argβ describe a positional argument, like$1or$@. tell the people what to pass in π«Ά@noargsβ state that the function does not accept arguments. no args, no drama, we respect the boundary π@setβ describe a global variable that the function sets. side effects, but make them documented β¨@exitcodeβ describe an exit status returned by the function. spill the codes π@stdin,@stdout,@stderrβ describe expected standard input, standard output, or standard error. and listen: indented comment lines continue the previous entry. so keep indenting, bestie, she's still listening π@seeβ add a related function, anchor, or Markdown link to the function's "See also" section. the little friend group at the bottom π@internalβ skip documentation for the next annotated function. private, do not perceive π
β¨ EXAMPLES β¨
generate documentation from standard input:
shdoc < lib.sh > REFERENCE.md
generate documentation from a named file:
shdoc lib.sh > REFERENCE.md
and here's what an annotated function looks like, the whole aesthetic π:
# @description Say hello to a name.
# @arg $1 string Name to greet.
# @stdout A greeting line.
say-hello() {
echo "Hello $1"
}
see how the comments sit right above the function? that's the whole trick. she reads them, she renders them, she moves on. ate π
β¨ EXIT STATUS β¨
shdocexits 0 after successful generation, or after printing help or version information. happy ending π- it exits non-zero when GNU Awk reports an error, or when parsing fails. something went wrong, bestie, go look π
β¨ FILES β¨
contrib/shdoc.1β the manual page distributed with the source tree. (hi, that's me, that's this file π«Ά)
β¨ SEE ALSO β¨
gawk(1)β the awk that does the heavy lifting behind the scenes π
project homepage: https://github.com/reconquest/shdoc β go say hi, star the repo, it's free β¨
π quick note bestie: everything above is the real deal β every flag, every annotation, every exit code. nothing invented, nothing skipped. i just said it with my whole chest π
and that's the page, babe! shdoc v1.4, June 2026 β that's the version and date straight from the source tree, so if anyone asks, you heard it here first πβ¨ bye bestie, go document something gorgeous π π¦
π¦ where this page comes from
- epel 10: shdoc 1.4-1.el10_3 Β· MIT
- epel 9: shdoc 1.4-1.el9 Β· MIT
- fedora 43: shdoc 1.4-1.fc43 Β· MIT
- fedora 44: shdoc 1.4-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms