%!
title = ""
uses_toc = False
%>
<%
page_text = capture(next.body)
%>
<%inherit file="/root.mako" />
## content
${self.attr.title}
% if self.attr.uses_toc:
${self.preface()}
${self.toc()}
% endif
${page_text}
## functions
<%def name="h2(tag='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 = "#"
%>
<${tag}>ยป ${caller.body()}${tag}>
%def>
<%def name="toc()">
% for url, name in self.attr.tlist:
- ${name}
% endfor
%def>
<%def name="preface()">%def>