X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/e57b146bf49e38b3bb57615110b27de5b4d1ae69..09b0a045683b6a965e83c1512f0cc99907f2c65c:/librarian/fb2.py?ds=sidebyside diff --git a/librarian/fb2.py b/librarian/fb2.py index d979566..25a4c1f 100644 --- a/librarian/fb2.py +++ b/librarian/fb2.py @@ -17,10 +17,11 @@ functions.reg_person_name() def sectionify(tree): """Finds section headers and adds a tree of _section tags.""" - sections = ['naglowek_czesc', - 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', - 'naglowek_podrozdzial'] - section_level = dict((v,k) for (k,v) in enumerate(sections)) + sections = [ + 'naglowek_czesc', + 'naglowek_akt', 'naglowek_rozdzial', 'naglowek_scena', + 'naglowek_podrozdzial'] + section_level = dict((v, k) for (k, v) in enumerate(sections)) # We can assume there are just subelements an no text at section level. for level, section_name in reversed(list(enumerate(sections))): @@ -50,6 +51,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)