An Index is the description for a domain-specific index. To add an index to a domain, subclass Index, overriding the three name attributes:
name
is an identifier used for generating file names.
It is also used for a hyperlink target for the index. Therefore, users can
refer the index page using ref role and a string which is combined
domain name and name attribute (ex. :ref:`py-modindex`).localname
is the section title for the index.shortname
is a short name for the index, for use in the relation bar in
HTML output. Can be empty to disable entries in the relation bar.and providing a generate()
method. Then, add the index class to
your domain's indices
list. Extensions can add indices to existing
domains using ~sphinx.application.Sphinx.add_index_to_domain()
.
Method | generate |
Get entries for the index. |
Method | __init__ |
Undocumented |
Class Variable | localname |
Undocumented |
Class Variable | name |
Undocumented |
Class Variable | shortname |
Undocumented |
Instance Variable | domain |
Undocumented |
sphinx.domains.python.PythonModuleIndex
Get entries for the index.
If docnames is given, restrict to entries referring to these docnames.
The return value is a tuple of (content, collapse):
A sequence of (letter, entries) tuples, where letter is the "heading" for the given entries, usually the starting letter, and entries is a sequence of single entries. Each entry is a sequence [name, subtype, docname, anchor, extra, qualifier, descr]. The items in this sequence have the following meaning:
The sub-entry related type. One of:
Qualifier and description are not rendered for some output formats such as LaTeX.
Parameters | |
docnames:Iterable[ | Undocumented |
Returns | |
Tuple[ | Undocumented |