summaryrefslogtreecommitdiff
path: root/doc/build/templates/genindex.mako
blob: 4f535f4b4e62471ea870e52fc8da39c420521124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<%inherit file="pre_layout.mako"/>

<%block name="show_title" filter="util.striptags">
    ${_('Index')}
</%block>

   <h1 id="index">${_('Index')}</h1>

   % for i, (key, dummy) in enumerate(genindexentries):
    ${i != 0 and '| ' or ''}<a href="#${key}"><strong>${key}</strong></a>
   % endfor

   <hr />

   % for i, (key, entries) in enumerate(genindexentries):
<h2 id="${key}">${key}</h2>
<table width="100%" class="indextable"><tr><td width="33%" valign="top">
<dl>
    <%
        breakat = genindexcounts[i] // 2
        numcols = 1
        numitems = 0
    %>
% for entryname, (links, subitems) in entries:

<dt>
    % if links:
        <a href="${links[0][1]}">${entryname|h}</a>
        % for unknown, link in links[1:]:
            , <a href="${link}">[${i}]</a>
        % endfor
    % else:
        ${entryname|h}
    % endif

    % if subitems:
  <dd><dl>
    % for subentryname, subentrylinks in subitems:
    <dt><a href="${subentrylinks[0][1]}">${subentryname|h}</a>
            % for j, (unknown, link) in enumerate(subentrylinks[1:]):
                <a href="${link}">[${j}]</a>
            % endfor
    </dt>
    % endfor
  </dl></dd>
  % endif
 <%
    numitems = numitems + 1 + len(subitems)
 %> 
 % if numcols <2 and numitems > breakat:
     <%
        numcols = numcols + 1
     %>
        </dl></td><td width="33%" valign="top"><dl>
% endif

% endfor
</dl></td></tr></table>
% endfor

<%def name="sidebarrel()">
% if split_index:
   <h4>${_('Index')}</h4>
   <p>
   % for i, (key, dummy) in enumerate(genindexentries):
       ${i > 0 and '| ' or ''}
       <a href="${pathto('genindex-' + key)}"><strong>${key}</strong></a>
   % endfor
   </p>

   <p><a href="${pathto('genindex-all')}"><strong>${_('Full index on one page')}</strong></a></p>
% endif
   ${parent.sidebarrel()}
</%def>