From: Radek Czajka Date: Fri, 4 Sep 2015 13:57:23 +0000 (+0200) Subject: Added support for X-Git-Tag: 1.7~85 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/28d85f12957a4b8609b4f419e70dd42a22b57765 Added support for --- diff --git a/librarian/epub.py b/librarian/epub.py index bf58a9f..6a1b2ce 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -501,6 +501,9 @@ def transform(wldoc, verbose=False, for flag in flags: document.edoc.getroot().set(flag, 'yes') + document.clean_ed_note() + document.clean_ed_note('abstrakt') + # add editors info editors = document.editors() if editors: diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index 1c066d9..bcb3d70 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -323,6 +323,7 @@ + diff --git a/librarian/fb2.py b/librarian/fb2.py index d979566..a1cece4 100644 --- a/librarian/fb2.py +++ b/librarian/fb2.py @@ -50,6 +50,9 @@ def transform(wldoc, verbose=False, for flag in flags: document.edoc.getroot().set(flag, 'yes') + document.clean_ed_note() + document.clean_ed_note('abstrakt') + style_filename = os.path.join(os.path.dirname(__file__), 'fb2/fb2.xslt') style = etree.parse(style_filename) diff --git a/librarian/html.py b/librarian/html.py index 6115b31..24d506f 100644 --- a/librarian/html.py +++ b/librarian/html.py @@ -50,6 +50,7 @@ def transform(wldoc, stylesheet='legacy', options=None, flags=None): document.edoc.getroot().set(flag, 'yes') document.clean_ed_note() + document.clean_ed_note('abstrakt') if not options: options = {} diff --git a/librarian/parser.py b/librarian/parser.py index e06c4d7..19ec32d 100644 --- a/librarian/parser.py +++ b/librarian/parser.py @@ -155,10 +155,10 @@ class WLDocument(object): return unmerged - def clean_ed_note(self): + def clean_ed_note(self, note_tag='nota_red'): """ deletes forbidden tags from nota_red """ - for node in self.edoc.xpath('|'.join('//nota_red//%s' % tag for tag in + for node in self.edoc.xpath('|'.join('//%s//%s' % (note_tag, tag) for tag in ('pa', 'pe', 'pr', 'pt', 'begin', 'end', 'motyw'))): tail = node.tail node.clear() diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index 4d7ff03..c278981 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -515,6 +515,7 @@ + diff --git a/librarian/xslt/book2html.xslt b/librarian/xslt/book2html.xslt index 9a2b771..ca7cdbd 100644 --- a/librarian/xslt/book2html.xslt +++ b/librarian/xslt/book2html.xslt @@ -354,6 +354,7 @@ + diff --git a/librarian/xslt/book2txt.xslt b/librarian/xslt/book2txt.xslt index a578492..a8bb9f1 100644 --- a/librarian/xslt/book2txt.xslt +++ b/librarian/xslt/book2txt.xslt @@ -342,6 +342,7 @@ +