diff --git a/src/calibre/ebooks/conversion/plugins/epub_output.py b/src/calibre/ebooks/conversion/plugins/epub_output.py index 25ad711fa1..6f6a9103b3 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_output.py +++ b/src/calibre/ebooks/conversion/plugins/epub_output.py @@ -49,6 +49,7 @@ class EPUBOutput(OutputFormatPlugin): author = 'Kovid Goyal' file_type = 'epub' commit_name = 'epub_output' + ui_data = {'versions': ('2', '3')} options = set([ OptionRecommendation(name='extract_to', @@ -118,7 +119,7 @@ class EPUBOutput(OutputFormatPlugin): help=_('Title for any generated in-line table of contents.') ), - OptionRecommendation(name='epub_version', recommended_value='2', choices=('2', '3'), + OptionRecommendation(name='epub_version', recommended_value='2', choices=ui_data['versions'], help=_('The version of the EPUB file to generate. EPUB 2 is the' ' most widely compatible, only use EPUB 3 if you know you' ' actually need it.') diff --git a/src/pyj/book_list/conversion_widgets.pyj b/src/pyj/book_list/conversion_widgets.pyj index 161133ed57..b4630dc81b 100644 --- a/src/pyj/book_list/conversion_widgets.pyj +++ b/src/pyj/book_list/conversion_widgets.pyj @@ -526,6 +526,23 @@ def txt_input(container): )) # }}} +# EPUB Output {{{ +@ep +def epub_output(container): + g = E.div(class_='simple-group') + container.appendChild(g) + g.appendChild(checkbox('dont_split_on_page_breaks', _('Do not &split on page breaks'))) + g.appendChild(checkbox('no_default_epub_cover', _('No default &cover'))) + g.appendChild(checkbox('epub_flatten', _('&Flatten EPUB file structure'))) + g.appendChild(checkbox('no_svg_cover', _('No &SVG cover'))) + g.appendChild(checkbox('preserve_cover_aspect_ratio', _('Preserve cover &aspect ratio'))) + g.appendChild(checkbox('epub_inline_toc', _('Insert inline &Table of Contents'))) + g.appendChild(checkbox('epub_toc_at_end', _('Put inserted Table of Contents at the &end of the book'))) + g.appendChild(lineedit('toc_title', _('&Title for inserted ToC:'))) + g.appendChild(int_spin('flow_size', _('Split files &larger than:'), unit='KB', max=1000000, step=20)) + g.appendChild(choices('epub_version', _('EP&UB version:'), ui_data.versions)) +# }}} + def restore_defaults(): for setting in registry: set(setting, get_option_default_value(setting))