Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Common link targets in Sphinx

I have a lot of Sphinx pages which have the same links on them. Like those:

.. _CC-BY: https://creativecommons.org/licenses/by/3.0/
.. _MIT: http://opensource.org/licenses/MIT

Currently, I have those two lines in every file that has a MIT_ in it. Is it possible to have a central file in the project where I can put those link targets? That way, I could write MIT_ anywhere and it would link to that.

like image 867
Martin Ueding Avatar asked Jan 13 '23 13:01

Martin Ueding


1 Answers

Put your link definitions in rst_epilog in conf.py:

rst_epilog = """
.. _CC-BY: https://creativecommons.org/licenses/by/3.0/
.. _MIT: http://opensource.org/licenses/MIT
"""
like image 133
mzjn Avatar answered Feb 06 '23 15:02

mzjn