]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
generated markup fixes
authorJason Kirtland <jek@discorporate.us>
Mon, 6 Aug 2007 02:02:00 +0000 (02:02 +0000)
committerJason Kirtland <jek@discorporate.us>
Mon, 6 Aug 2007 02:02:00 +0000 (02:02 +0000)
doc/build/read_markdown.py
doc/build/templates/toc.html

index 288b7b6ac0de2ca669e0cfa25477e5208f5e12d1..53b5b12a85844d5794488d4a36107c9687985c43 100644 (file)
@@ -35,7 +35,8 @@ def dump_tree(elem, stream):
             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:]
index f4ea353ec10949ce1b6419bdcc7860411fed33eb..ab42afc0ed6a0a91d853165c32318acd4219d443 100644 (file)
 
 
 <%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>