【问题标题】:Change internal link labels in Sphinx更改 Sphinx 中的内部链接标签
【发布时间】:2012-07-02 17:38:57
【问题描述】:

我正在使用Sphinx 生成文档。我可以使用

更改目录中文档的链接标签
Features </resources/pages/features>

根据the toctree directive 在 toctree 指令中,但我怎样才能对文档部分的链接执行相同操作?

编辑:

这就是我想要实现的目标:

doc.rst

.. toctree::
    :maxdepth: 2

    Section - Information <info>

.. _info:

Info Section
------------

这样Section - information 会出现在目录中,而Info section 会出现在文档本身中

【问题讨论】:

    标签: python hyperlink python-sphinx sections toctree


    【解决方案1】:

    我相信你可以使用标准的 reST 标签。

    例子:

    pages/features.rst:

    .. _label1:
    
    A section
    ---------
    
    Some text
    

    otherpage.rst:

    See :ref:`label1`
    

    Cross-referencing arbitrary locations.

    【讨论】:

    • 我怎样才能在文档的 toctree 指令中做到这一点?
    • 不确定使用 toctree 是否可以实现您想要的。也许您应该手动创建目录?
    猜你喜欢
    • 2012-03-02
    • 1970-01-01
    • 2014-11-13
    • 2015-12-17
    • 2015-01-09
    • 1970-01-01
    • 1970-01-01
    • 2012-05-06
    • 1970-01-01
    相关资源
    最近更新 更多