/kai/templates/docs/genindex.mako

https://bitbucket.org/bbangert/kai/ · Mako · 63 lines · 61 code · 2 blank · 0 comment · 13 complexity · 355126f3f0ab360dd5acb7f2ff4b48a9 MD5 · raw file

  1. <div class="yui-b sphinx content">
  2. <h1>Index</h1>
  3. <%
  4. ind_len = len(c.doc['genindexentries']) - 1
  5. %>
  6. % for index, (key, dummy) in enumerate(c.doc['genindexentries']):
  7. <a href="#${key}"><strong>${key}</strong></a>
  8. % if index != ind_len:
  9. |
  10. % endif
  11. % endfor
  12. % for loc, (key, entries) in enumerate(c.doc['genindexentries']):
  13. <h2 id="${key}">${key}</h2>
  14. <table width="100%" class="indextable"><tr><td width="33%" valign="top">
  15. <dl>
  16. <%
  17. breakat = c.doc['genindexcounts'][loc] // 2
  18. numcols = 1
  19. numitems = 0
  20. length = len(c.doc['genindexcounts'])
  21. %>
  22. % for entryname, (links, subitems) in entries:
  23. <dt>
  24. % if links:
  25. <a href="${links[0]}">${entryname}</a>
  26. % for here, link in enumerate(links[1:]):
  27. , <a href="${link}">[${here+1}]</a>
  28. % endfor
  29. % else:
  30. ${entryname}
  31. % endif
  32. </dt>
  33. % if subitems:
  34. <dd><dl>
  35. % for subentryname, subentrylinks in subitems:
  36. <dt><a href="${subentrylinks[0]}">${subentryname}</a>\
  37. % for here, link in enumerate(subentrylinks[1:]):
  38. , <a href="${link}">${here+1}</a>
  39. % endfor
  40. % endfor
  41. </dl></dd>
  42. % endif
  43. <%
  44. numitems = numitems + 1 + len(subitems)
  45. %>
  46. % if numcols < 2 and numitems > breakat:
  47. <%
  48. numcols += 1
  49. %>
  50. </dl></td><td width="33%" valign="top"><dl>
  51. % endif
  52. % endfor
  53. </dl></td></tr></table>
  54. % endfor
  55. </div>
  56. <%def name="title()">${parent.title()} - Documentation - Index</%def>
  57. <%inherit file="../layout.mako" />
  58. <%def name="styles()">
  59. ${parent.styles()}
  60. ${h.stylesheet_link('/css/sphinx.css')}
  61. </%def>