4

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.

4

1 回答 1

9

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
"""
于 2013-08-23T09:16:09.730 回答