How do I define multiple global substitutions in Sphinx?
I see in this question how to create global substitutions using rst_prolog
in conf.py. E.g.,
rst_prolog = '.. |my_conf_val| replace:: 42'
All examples of this that I can find only define one substitution in rst_prolog
, but I want to do more than one. I tried this:
rst_prolog = """.. |sub1| replace:: mine1\
.. |sub2| replace:: mine2"""
When I put |sub1|
into text in an rst file, |sub1|
is (not surprisingly) replaced with:
mine1 .. |sub2| replace:: mine2
What is the correct syntax here?
Make sure that the alignment of the substitution definitions is consistent. Backslashes are not needed. This works:
rst_prolog = """
.. |sub1| replace:: mine1
.. |sub2| replace:: mine2
"""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With