Commits

Georg Brandl committed 0d1f5e8

Fix-up genindex templates.

  • Participants
  • Parent commits e6658f5

Comments (0)

Files changed (3)

sphinx/themes/basic/genindex-single.html

 
    <h1 id="index">{% trans key=key %}Index &ndash; {{ key }}{% endtrans %}</h1>
 
-<table width="100%" class="indextable"><tr><td width="33%" valign="top">
-<dl>
-{%- set breakat = count // 2 %}
-{%- set numcols = 1 %}
-{%- set numitems = 0 %}
-{% for entryname, (links, subitems) in entries %}
-<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a>
-  {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
-  {%- else -%}
-{{ entryname|e }}
-  {%- endif -%}</dt>
-  {%- if subitems %}
-  <dd><dl>
+<table width="100%" class="indextable"><tr>
+  {%- for column in entries|slice(2) if column %}
+  <td width="33%" valign="top"><dl>
+  {%- for entryname, (links, subitems) in column %}
+    <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a>
+      {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %}
+      {%- else %}{{ entryname|e }}{% endif %}</dt>
+    {%- if subitems %}
+    <dd><dl>
     {%- for subentryname, subentrylinks in subitems %}
-    <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
-    {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
-    </dt>
+      <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a>
+      {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
+      </dt>
     {%- endfor %}
   </dl></dd>
   {%- endif -%}
-{%- set numitems = numitems + 1 + (subitems|length) -%}
-{%- if numcols < 2 and numitems > breakat -%}
-{%- set numcols = numcols+1 -%}
-</dl></td><td width="33%" valign="top"><dl>
-{%- endif -%}
 {%- endfor %}
-</dl></td></tr></table>
+</dl></td>
+{%- endfor %}
+</tr></table>
 
 {% endblock %}
 

sphinx/themes/basic/genindex-split.html

 
    <p>{{ _('Index pages by letter') }}:</p>
 
+   <div class="genindex-jumpbox">
    <p>{% for key, dummy in genindexentries -%}
    <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a>
      {% if not loop.last %}| {% endif %}
 
    <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong>
                                                ({{ _('can be huge') }})</a></p>
+   </div>
 
 {% endblock %}
 

sphinx/themes/basic/genindex.html

    {%- endfor %}
    </div>
 
-   <hr />
-
    {%- for key, entries in genindexentries %}
 <h2 id="{{ key }}">{{ key }}</h2>
 <table width="100%" class="indextable genindextable"><tr>
   <td width="33%" valign="top"><dl>
   {%- for entryname, (links, subitems) in column %}
     <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a>
-      {% for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %}
+      {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %}
       {%- else %}{{ entryname|e }}{% endif %}</dt>
     {%- if subitems %}
     <dd><dl>