Python-Sphinx: how to fill the keyword fields for qthelp builder

311 Views Asked by At

I'm using Sphinx for generating the documentation of my application, to be viewed using the QtHelpEngine. Hence I'm using the qthelp builder.

I don't understand how to properly create the keyword section of the qhp file from the reStructuredText used as source.

By default sphinx create an empty tag:

<keywords>

</keywords>

and then the linksForIdentifier() and linksForKeyword() return an empty QMap.

1

There are 1 best solutions below

0
Timotheus.Kampik On BEST ANSWER

Sphinx fills the keywords with the same content it uses in the index of the documentation project. You find an overview of how to create index-generating markup markup here in the Sphinx documentation (Steve Piercy's assumption is correct).

For example, if we have a the file this/is/an/example.rst, which contains this Python domain directive:

.. py:function:: lorem(ispsum)

   Lorems the provided ipsum.

, our keywords tag in the .qhp file contains the following keyword:

<keyword name="lorem() (built-in function)" ref="this/is/an/example.html#lorem"/>

An example for an explicitly created index entry is:

.. index::
   single: lorem

, which creates the following keyword (let's again assume the file is this/is/an/example.rst):

<keyword name="lorem" ref="this/is/an/example.html#index-0"/>