nicer full html ofop
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Mar 2012 09:37:48 +0000 (10:37 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Mar 2012 09:37:48 +0000 (10:37 +0100)
librarian/html.py
librarian/xslt/book2html.xslt

index e04790f..604c92a 100644 (file)
@@ -261,7 +261,11 @@ def add_table_of_contents(root):
                 subsection_element = etree.SubElement(subsection_list, 'li')
                 add_anchor(subsection_element, "s%d" % n, with_target=False, link_text=text)
 
+    if root.tag == 'html':
+        # in case of full-page output
+        root = root[-1][0]
     root.insert(0, toc)
+    
 
 
 def extract_annotations(html_path):
index f81f981..c7b7215 100755 (executable)
@@ -18,8 +18,7 @@
             <head>
                 <title><xsl:apply-templates mode="inline" select="//nazwa_utworu" /></title>
                 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
-            </head>
-            <style>
+                <style>
                 body {
                     font-size: 16px;
                     font: Georgia, "Times New Roman", serif;
                 @media print {
                     #menu {display: none;}
                 }
-            </style>
+                </style>
+            </head>
             <body>
                 <xsl:call-template name="book-text" />
             </body>