#1147627 python3.14-doc: devhelp keyword-search index entry titles are incomplete

#1147627#5
Date:
2026-09-13 22:24:56 UTC
From:
To:
debian/pyhtml2devhelp.py generates an index for the HTML documentation,
in devhelp format, by screen-scraping Sphinx's HTML output.
Unfortunately it makes some assumptions about the HTML that are no
longer true. When a function of the same name exists in multiple places,
which is quite common in Python, index entries in genindex-*.html look
like this:

The first of the multiple entries for `exists()` gets into the devhelp
index correctly, as something like this (this is with my patch sent to a
separate bug to generate devhelp2 format, currently it's a <function>
but the content is otherwise equivalent):

But the others lose the information that the method is named "exists",
making the index entries unhelpful to search or browse:

It looks as though maybe Sphinx output used to emit these disambiguation
entries wrapped in <dl>/<dt>? But now they are in <ul>/<li>, for
example:

One way to fix this, which would probably be the most reliable in the
long term, would be to use the python3-sphinxcontrib.devhelp Sphinx
plugin to generate HTML with an accompanying devhelp index, instead of
generating the index separately. That would offload responsibility for
generating the devhelp index onto code that is already designed to
handle it.

Or failing that, perhaps the index could be generated from
searchindex.js or objects.inv, or some intermediate file used by Sphinx
during the build, instead of parsing the HTML?

Or, the heuristic for screen-scraping the HTML could be updated to
understand the new <ul>/<li>-based formatting.

Thanks,
    smcv