I have lots of clickable images in my documentation. And most of them have the same base URL.
base-url = "https://github.com/username/repository/tree/master"
.
In Sphinx, we can add links(target-url
) to the image as below:
.. image:: <image-url>
:target: <target-url>
I want this target-url
to be substituted by a global variable defined in conf.py, so that I can substitute it like:
.. image:: <image-url>
:target: <base-url>/<relative-path>
I know that links can be substituted with the help of sphinx.ext.extlinks extension. But it is not working for above said purpose. I don't know if this is possible or not. Any alternatives are welcome too.