Skip to content

Commit 6940445

Browse files
authored
Documentation search improvements (#3378)
* Try adding `genindex.html` to toc * Try making a new genindex template * Completely copy over the basic template genindex * Hacks to make index fully qualified * Oops
1 parent e27a303 commit 6940445

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% extends "!genindex.html" %}
2+
3+
{# check sphinx/themes/basic/genindex if this snippet has become outdated #}
4+
5+
{% block body %}
6+
7+
<h1 id="index">{{ _('Index') }}</h1>
8+
9+
<div class="genindex-jumpbox">
10+
{% for key, dummy in genindexentries -%}
11+
<a href="#{{ key }}"><strong>{{ key }}</strong></a>
12+
{% if not loop.last %}| {% endif %}
13+
{%- endfor %}
14+
</div>
15+
16+
{%- for key, entries in genindexentries %}
17+
<h2 id="{{ key }}">{{ key }}</h2>
18+
<table style="width: 100%" class="indextable genindextable"><tr>
19+
{%- for column in entries|slice_index(2) if column %}
20+
<td style="width: 33%; vertical-align: top;"><ul>
21+
{%- for entryname, (links, subitems, _) in column %}
22+
{% set name = links[0][1].rsplit('#', 1)[1] if links else '' %}
23+
<li>{{ indexentries(name if name and '-' not in name else entryname, links) }}
24+
{%- if subitems %}
25+
<ul>
26+
{%- for subentryname, subentrylinks in subitems %}
27+
{% set sname = subentrylinks[0][1].rsplit('#', 1)[1] if subentrylinks else '' %}
28+
<li>{{ indexentries(sname if sname and '-' not in sname else subentryname, subentrylinks) }}</li>
29+
{%- endfor %}
30+
</ul>
31+
{%- endif -%}</li>
32+
{%- endfor %}
33+
</ul></td>
34+
{%- endfor %}
35+
</tr></table>
36+
{% endfor %}
37+
38+
{% endblock %}

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Vital statistics:
8686
contributing.rst
8787
releasing.rst
8888
code-of-conduct.rst
89+
genindex
8990

9091
====================
9192
Indices and tables

0 commit comments

Comments
 (0)