rst.linker provides a routine for adding links and performing
other custom replacements to reStructuredText files as a Sphinx
extension.
In your sphinx conf file, include rst.linker as an extension
and then add a link_files configuration section describing
the substitutions to make. For an example, see rst.linker's own
conf.py
or read the source to learn more about the the linkers provided.