Custom roles

Doctools custom Sphinx roles allow better linking, such as git links, and formatting, like font coloring.

Below, every added role is explained with examples. For Sphinx’s built-in roles and references, see Documentation guidelines.

Note

Link-like roles use the :role:`text <link>` syntax, like external links, but without the underscore at the end.

Color

To print text in red or green, use :red:`text` and :green:`text`.

Badges

Use :badge:`text` to mark a text, for example:

.. _example-feature:

Example feature :badge:`new`
++++++++++++++++++++++++++++

It is styled as capitalize (transforms the first character of each word to uppercase), on titles, they also show in the table of contents. Example badge: example.

Example feature new

A heading badge can also contain since v1.23 or deprecated.