From: Radek Czajka Date: Tue, 2 Mar 2021 13:10:44 +0000 (+0100) Subject: Epub: fixes #4164, #4166 X-Git-Tag: 1.15 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/8df0bad21a18b56933084288320fa35e2a3fce6f Epub: fixes #4164, #4166 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 4efa62a..f441e50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ This document records all notable changes to Librarian. +## 1.15 (2021-03-02) + +### Fixed +- Epub: translator marked with MARC Relators role 'trl'. +- Epub: authors and translators dc:creator elements had duplicate `id`. +- Epub: 'Start' element in TOC was added inconsistently and in wrong order. + + ## 1.14 (2021-02-05) ### Changed diff --git a/setup.py b/setup.py index 5b6f487..c02c054 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def whole_tree(prefix, path): setup( name='librarian', - version='1.14', + version='1.15', description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats', author="Marek Stępniowski", author_email='marek@stepniowski.com', diff --git a/src/librarian/epub.py b/src/librarian/epub.py index 5a88d5a..e2cdae7 100644 --- a/src/librarian/epub.py +++ b/src/librarian/epub.py @@ -448,6 +448,14 @@ def transform(wldoc, verbose=False, style=None, output.add_item(item) spine.append(item) + toc[-1][1].append( + epub.Link( + "part1.xhtml", + "Początek utworu", + "part1" + ) + ) + elif wldoc.book_info.parts: # write title page for every parent if sample is not None and sample <= 0: @@ -541,16 +549,18 @@ def transform(wldoc, verbose=False, style=None, output.set_identifier(six.text_type(document.book_info.url)) output.set_language(functions.lang_code_3to2(document.book_info.language)) output.set_title(document.book_info.title) - for author in document.book_info.authors: + for i, author in enumerate(document.book_info.authors): output.add_author( author.readable(), - file_as=six.text_type(author) + file_as=six.text_type(author), + uid='creator{}'.format(i) ) for translator in document.book_info.translators: output.add_author( translator.readable(), file_as=six.text_type(translator), - role='translator' + role='trl', + uid='translator{}'.format(i) ) for publisher in document.book_info.publisher: output.add_metadata("DC", "publisher", publisher) @@ -670,15 +680,6 @@ def transform(wldoc, verbose=False, style=None, toc, chunk_counter, chars, sample = transform_file(document, sample=sample) output.toc = toc[0][1] - if len(toc) < 2: - output.toc.append( - epub.Link( - "part1.xhtml", - "Początek utworu", - "part1" - ) - ) - # Last modifications in container files and EPUB creation if len(annotations) > 0: output.toc.append(