From d5036b0a2531a84a0381053b1927aa1a23984ed0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Tue, 16 Sep 2008 20:42:38 +0200 Subject: [PATCH] Generating HTML div instead of whole page. --- lib/librarian/book2html.xslt | 12 +++++++----- lib/librarian/html.py | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/librarian/book2html.xslt b/lib/librarian/book2html.xslt index 827c696b8..c8cf2c979 100644 --- a/lib/librarian/book2html.xslt +++ b/lib/librarian/book2html.xslt @@ -1,17 +1,18 @@ - + - + +
@@ -32,8 +33,9 @@
- - +
+
diff --git a/lib/librarian/html.py b/lib/librarian/html.py index 3dd70f56e..9763428d0 100644 --- a/lib/librarian/html.py +++ b/lib/librarian/html.py @@ -55,7 +55,7 @@ def transform(input_filename, output_filename): result = doc.xslt(style) add_anchors(result.getroot()) add_table_of_contents(result.getroot()) - result.write(output_filename, xml_declaration=True, pretty_print=True, encoding='utf-8') + result.write(output_filename, xml_declaration=False, pretty_print=True, encoding='utf-8') class Fragment(object): @@ -117,9 +117,9 @@ def extract_fragments(input_filename): fragment = Fragment(id=element.get('fid'), themes=element.text) # Append parents - if element.getparent().tag != 'body': + if element.getparent().get('id', None) != 'book-text': parents = [element.getparent()] - while parents[-1].getparent().tag != 'body': + while parents[-1].getparent().get('id', None) != 'book-text': parents.append(parents[-1].getparent()) parents.reverse() -- 2.20.1