Badges#

Badges are colored pill-shapes containing text, like this. Used judiciously, they’re effective for conveying information at a glance. The Rubin user guide configuration enables your to use badges from the Sphinx Design extension.

Badge styles#

Example

Syntax

Plain badge

:bdg:`Plain badge`

Primary

:bdg-primary:`Primary`

Primary line

:bdg-primary-line:`Primary line`

Secondary

:bdg-secondary:`Secondary`

Secondary line

:bdg-secondary-line:`Secondary line`

Info

:bdg-info:`Info`

Info line

:bdg-info-line:`Info line`

Warning

:bdg-warning:`Warning`

Warning line

:bdg-warning-line:`Warning line`

Danger

:bdg-danger:`Danger`

Danger line

:bdg-danger-line:`Danger line`

Light

:bdg-light:`Light`

Light line

:bdg-light-line:`Light line`

Dark

:bdg-dark:`Dark`

Dark line

:bdg-dark-line:`Dark line`

Reusable badges#

It’s a good idea to use badges consistently throughout your documentation. To do this, create substitutions for your badges in the rst epilog:

_rst_epilog.rst#
.. |done| replace:: :bdg-success:`Done`
.. |todo| replace:: :bdg-primary-line:`To-do`
.. |inprogress| replace:: :bdg-seconday-line:`To-do`

Now you can use those badges throughout your documentation project:

Project milestones
==================

- |done| Task 1
- |todo| Task 2
- |inprogress| Task 2

See Using the rst epilog for common links and substitutions for configuration details.