RolesΒΆ
The typer role allows you to cross reference a Typer command or subcommand in your
documentation. The syntax is:
:typer:`progname-subcommand1-subcomand2`
You can also use a string identical to the :prog: setting to make the reference. For example if
:prog: is python -m progname.py subcommand1 subcommand2 this will also work:
:typer:`python -m progname.py subcommand1 subcommand2`
From Markdown documents using MyST the role is written as {typer}`progname-subcommand1`,
see Use from Markdown.
Explicit link text may be given using the usual Sphinx syntax:
:typer:`link text <progname-subcommand1>`
Commands are registered in the typer domain. This means references are also
resolvable through the any role and are exported to the objects
inventory, so other projects can link to your commands using
sphinx.ext.intersphinx:
:typer:`other-project-command`
Note
Every command rendered by the typer directive is a valid reference
target, whether or not typer:make-sections is used. When sections
are not made the link resolves to the container holding the rendered help.