<%! trans = {ord(" "):u"-", ord("/"):u"-", ord("(") : None, ord(")"):None} 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.translate(trans) tlist = getattr(self.attr, "tlist", []) tlist.append((str(name), str(c))) self.attr.tlist = tlist id_tag = "id=\"%s\"" % name else: id_tag = '' %> <${tag}>ยป ${caller.body()} <%def name="toc()"> <%def name="preface()">