Sphinx supports several ways to reuse content within and across projects.
Use a Substitution to reuse short, inline content.
Include a Shared File to reuse longer, more complex content.
Use a Substitution¶
For common, short content, use RST substitutions.
For example, use a substitution for a product name. To print the product name in a topic, enter
|Product|. For example:
Set |Product| configuration properties by . . .
The value of
|Product| is defined in a substitution definition:
.. |Product| replace:: SoftTech Analyzer
The generated documentation from this example is:
Set SoftTech Analyzer configuration properties by . . .
If you then change the replace value of the substitution, the new value is used in all instances when you rebuild the project.
You can define a substitution in any RST file in the project. To keep the project organized and have substitutions easily discoverable by other team members, you can include all substitutions in a file that is included in every other project file.
For more information, see the Sphinx Substitutions Documentation.