Code documentation $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#code-documentation">
Sphinx can generate reference documentation from docstrings in your source code.
The Awesome Theme documentation makes use of this function on the page Theme options. This page lists a few additional examples for command line options.
Command line options $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#command-line-options" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#command-line-options'">
If you want to document command-line options, you have two choices:
The
option
directive (Sphinx)An option list (docutils)
Option directive $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#option-directive" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#option-directive'">
Sphinx comes with the option
directive. This renders every option
into its own element, including permalinks:
- -h, --help $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#cmdoption-h" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#cmdoption-h'">
Display a (hopefully) useful message.
- -i FILE, --input FILE $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#cmdoption-i" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#cmdoption-i'">
Specify an input file.
Option lists $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#option-lists" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#option-lists'">
A compact way to display command-line options is built into the docutils
module and works in Sphinx too:
- -h, --help
Display a helpful message.
- -i FILE, --input FILE
Specify an input file.
- -v, --verbose
Increase the verbosity.