Why the substitution |version| is not working on Sphinx

2.7k views Asked by At

I'm new using Sphinx to document my work. I want do add the number version and release to my documentation in PDF.

In the conf.py file, a version variable is defined that we can use in the .rst files like such:

|version|

But its not working for me, i don't know if I doing something wrong. Any suggestions?

1

There are 1 answers

4
Mark Hoeber On BEST ANSWER

To use a substitution, you need to have it defined in the file in the format:

.. |Version| replace:: 1.0

Then use it in text:

 "Latest version is |Version|"

I typically include all substitutions in a single file that is then included in each file in project with directive:

.. include:: substitutions-file-name