<%! 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()} <%def name="toc()"> <%def name="preface()">