Python sphinx 斯芬克斯:自动标记标题?
在Sphinx中,是否可以自动为标题定义标签?我发现我的文档最终看起来非常像这样: .._doing stuff: Doing Stuff ----------- You might also want :ref:`other stuff`. .._other stuff: Other Stuff ----------- No, you want :ref:`doing stuff`. ……你在做什么 做事 ----------- 您可能还需要:ref:`other stuff`。 ……其他材料: 其他东西 ----------- 不,您需要:ref:‘做事情’。Python sphinx 斯芬克斯:自动标记标题?,python-sphinx,Python Sphinx,在Sphinx中,是否可以自动为标题定义标签?我发现我的文档最终看起来非常像这样: .._doing stuff: Doing Stuff ----------- You might also want :ref:`other stuff`. .._other stuff: Other Stuff ----------- No, you want :ref:`doing stuff`. ……你在做什么 做事 ----------- 您可能还需要:ref:`other stuff`。 …
如果能删除该重复项,那就太好了。在同一文档中,您可以始终使用传统的参考:
Doing Stuff
-----------
You may want to try `Doing Stuff`_ -section again.
但如前所述,此方法不适用于文档文件。Sphinx 1.4已添加,支持此功能。它包括一个选项,该选项将在标签前添加文档名称,以避免跨文档冲突。问题在于链接文本无法更改: