0

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.

Mark
  • 4,338
  • 7
  • 58
  • 120
  • 1
    I haven't used the `qthelp` builder, but I assume that "keywords" in QtHelpEngine are the same as "index entries" as documented under [Index-generating markup](http://www.sphinx-doc.org/en/stable/markup/misc.html#index-generating-markup) in Sphinx using reStructuredText. – Steve Piercy Oct 09 '17 at 19:10

1 Answers1

1

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"/>
Timotheus.Kampik
  • 2,425
  • 1
  • 22
  • 30