reStructuredText and Sphinx Reference

Example based gentle reference of the reStructuredText and Sphinx syntax, directives, roles and common issues. It demonstrates almost all the markup making it also good for testing Sphinx themes. Free and open-source.

substitution

Actually there are “subsitution definition” and “subsitution reference” (usage) that uses it.

Definition and reference

For example, if some product has a really long name:

1.. |product-name| replace:: Compliance recording for Microsoft Teams
2
3The |product-name| is software that enables organizations that adopted online calling to manage recordings according their corporate or regulatory policies.

The Compliance recording for Microsoft Teams is software that enables organizations that adopted online calling to manage recordings according their corporate or regulatory policies.

Reference in unusual places

In section titles, rubrics.

1|product-name|
2##############
3
4.. rubric:: |product-name|
5
6#. Install |product-name|
7#. Import users to |product-name|
8#. Enjoy |product-name|

Compliance recording for Microsoft Teams

Compliance recording for Microsoft Teams

  1. Install Compliance recording for Microsoft Teams

  2. Import users to Compliance recording for Microsoft Teams

  3. Enjoy Compliance recording for Microsoft Teams

References not allowed

Image alt:

.. image:: /img/cupcake.png
   :width: 25%
   :alt: |product-name| has the same taste.

Global subsitutions available everywhere

conf.py:

rst_epilog = f'''
.. |project| replace:: {project}
.. |rst| replace:: reStructuredText
'''

Previous: subscript | Next: superscript

On this page