index.rst:
.. |subst| replace:: Substitution
.. include:: a.rst
.. include:: b.rst
a.rst:
b.rst:
The output is correct:
A: Substitution
B: Substitution
But building the Sphinx projects yields these warnings:
a.rst:2: WARNING: Undefined substitution referenced: "subst".
b.rst:2: WARNING: Undefined substitution referenced: "subst".
Replacing the extension on a.rst and b.rst with .txt suppresses the warnings. This is apparently because Sphinx scans files with the .rst extension twice. I hope you agree that is very confusing, and the user should be able to use the .rst extension also for included files?
Environment info
- OS: Linux
- Python version: 3.6.9
- Sphinx version: 3.2.1
index.rst:
a.rst:
b.rst:
The output is correct:
But building the Sphinx projects yields these warnings:
Replacing the extension on a.rst and b.rst with .txt suppresses the warnings. This is apparently because Sphinx scans files with the .rst extension twice. I hope you agree that is very confusing, and the user should be able to use the .rst extension also for included files?
Environment info