Substitutions¶
Substitutions in Sphinx allow you to define reusable text, links, or content that can be inserted throughout your documentation. Using myst_substitutions, you can define substitutions once and reference them multiple times, keeping your documentation consistent and easy to maintain.
Define substitutions in conf.py¶
You can define substitutions globally in your Sphinx configuration file (conf.py) using the myst_substitutions variable. For example:
myst_substitutions = {
"project_name": "Blue Robotics"
}
Use substitutions in your content¶
Once substitutions are defined, you can use them in .rst or .md files as follows:
{{ project_name }} documentation.
Which renders:
Blue Robotics documentation.
See also¶
Last update:
29 Jan 2025