Python-Sphinx:如何填充qthelp构建器的关键字字段
问题描述:
我正在使用Sphinx生成我的应用程序的文档,使用QtHelpEngine进行查看。因此我使用qthelp构建器。Python-Sphinx:如何填充qthelp构建器的关键字字段
我不明白如何从用作源的reStructuredText正确创建qhp文件的关键字部分。
Sphinx默认创建一个空的标签:
<keywords>
</keywords>
,然后linksForIdentifier()
和linksForKeyword()
返回一个空QMap
。
答
Sphinx使用它在文档项目索引中使用的相同内容填充关键字。您会发现如何创建索引生成标记标记here in the Sphinx documentation(Steve Piercy's假设是正确的)的概述。
例如,如果我们有一个文件this/is/an/example.rst
,其中包含这条巨蟒域指令:
.. py:function:: lorem(ispsum)
Lorems the provided ipsum.
,我们在.qhp
文件keywords
标签包含以下关键字:
<keyword name="lorem() (built-in function)" ref="this/is/an/example.html#lorem"/>
的明确创建索引条目的示例是:
.. index::
single: lorem
,创建以下关键字(让我们再次假设该文件是this/is/an/example.rst
):
<keyword name="lorem" ref="this/is/an/example.html#index-0"/>
我没用过'qthelp'建设者,但我认为“关键词”在QtHelpEngine是一样的“指数条目“,如使用reStructuredText在Sphinx中的[Index-generating markup](http://www.sphinx-doc.org/en/stable/markup/misc.html#index-generating-markup)中所记录的。 –