dump_tree(child, stream)
if child.tail:
stream.write(child.tail)
- stream.write("</%s>" % elem.tag)
+ if elem.tag != 'html':
+ stream.write("</%s>" % elem.tag)
def dump_mako_tag(elem, stream):
tag = elem.tag[5:]
<%def name="printtoc(root, paged, extension, current=None, children=True, anchor_toplevel=False)">
+ % if root.children:
<ul>
- % for item in root.children:
+ % for item in root.children:
<%
anchor = anchor_toplevel
if paged and item.filename != root.filename:
anchor = False
%>
- <li><A style="${item is current and "font-weight:bold;" or "" }" href="${item.get_link(extension=extension,anchor=anchor, usefilename=paged) }">${item.description}</a></li>
+ <li><a style="${item is current and "font-weight:bold;" or "" }" href="${item.get_link(extension=extension,anchor=anchor, usefilename=paged) }">${item.description}</a></li>
- % if children:
- ${printtoc(item, current=current, children=True,anchor_toplevel=True, paged=paged, extension=extension)}
- % endif
- % endfor
+ % if children and item.children:
+ <li>
+ ${printtoc(item, current=current, children=True,anchor_toplevel=True, paged=paged, extension=extension)}
+ </li>
+ % endif
+ % endfor
</ul>
+ % endif
</%def>