python-sphinx - Sphinx 中的常见链接目标

标签 python-sphinx

我有很多 Sphinx 页面,它们都有相同的链接。像那些:

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

目前,我在每个文件中都有这两行 MIT_在里面。项目中是否可以有一个中央文件,我可以在其中放置这些链接目标?这样,我就可以写 MIT_任何地方,它都会链接到那个。

最佳答案

将您的链接定义放在 rst_epilog 中在 conf.py 中:

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

关于python-sphinx - Sphinx 中的常见链接目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18398548/

相关文章:

python - sphinx-build 失败 - autodoc 无法导入/查找模块

python - 将 sphinx autodoc 用于 fabfile

python - 如何在 sphinx 中包含模块

python-sphinx - 如何在 Python-sphinx(文档工具)中插入元数据

tensorflow - 如何在 Tensorflow 和 numpydoc 中使用 intersphinx?

python - Sphinx 将段落标签添加到无序列表项

python - rtype在Python中是什么意思?

python - 如何在 Sphinx 的 Python 文档字符串中指定变量类型?

python - 可以告诉 Sphinx "automodule"在成员之间自动插入分节符吗?

python - 如何在 Sphinx 中正确定义新的警告?