X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/26fba30d99a051b3779a36f332993795d7f1c376..c3cfacbfd878f8a26750f22f701f4ac23fa98163:/librarian/epub.py?ds=sidebyside diff --git a/librarian/epub.py b/librarian/epub.py index 8ef436e..bf2d4d9 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -501,9 +501,14 @@ 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 - document.edoc.getroot().set('editors', u', '.join(sorted( - editor.readable() for editor in document.editors()))) + editors = document.editors() + if editors: + document.edoc.getroot().set('editors', u', '.join(sorted( + editor.readable() for editor in editors))) if document.book_info.funders: document.edoc.getroot().set('funders', u', '.join( document.book_info.funders)) @@ -518,6 +523,8 @@ def transform(wldoc, verbose=False, output_file = NamedTemporaryFile(prefix='librarian', suffix='.epub', delete=False) zip = zipfile.ZipFile(output_file, 'w', zipfile.ZIP_DEFLATED) + functions.reg_mathml_epub(zip) + # write static elements mime = zipfile.ZipInfo() mime.filename = 'mimetype' @@ -639,7 +646,7 @@ def transform(wldoc, verbose=False, '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' )) - if not flags or not 'without-fonts' in flags: + if not flags or 'without-fonts' not in flags: # strip fonts tmpdir = mkdtemp('-librarian-epub') try: