blob: 4670764bc6856aa71636d899fe20bd9689a50380 (
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
|
<%!
title = ""
uses_toc = False
%>
<%inherit file="/root.mako" />
<h1 class="title">${self.attr.title}</h1>
${next.body()}
% if self.attr.uses_toc:
<script type="text/javascript">
createToc(${h.toJS(self.attr.tlist)})
</script>
% endif
<%def name="style()">
${parent.style()}
% if self.attr.uses_toc:
<script src=${"/static/js/toc.js" | url} type="text/javascript"></script>
% endif
</%def>
<%def name="h2()">
<%
if self.attr.uses_toc:
c = capture(caller.body)
name = c.replace(" ", "_").replace("/", "_").lower()
tlist = getattr(self.attr, "tlist", [])
tlist.append((str(name), str(c)))
self.attr.tlist = tlist
else:
name = "#"
%>
<h2><a name="${name}"><span class="hstart">» </span></a>${caller.body()}</h2>
</%def>
<%def name="toc()">
<div id="toc">
<noscript class="box">
Enable JavaScript for a table of contents.
</noscript>
</div>
<noscript>
<!-- dummy paragraph to get the correct layout in noscript mode -->
<p></p>
</noscript>
</%def>
|