Fix title page not identified in sphinx generated epub

This commit is contained in:
Kovid Goyal 2020-07-31 13:43:59 +05:30
parent 1e6d8cee00
commit c098a23a36
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -77,6 +77,13 @@ class EPUBHelpBuilder(EpubBuilder):
cover_id = rmap['_static/' + self.config.epub_cover[0]]
for item in container.opf_xpath('//opf:item[@id="{}"]'.format(cover_id)):
item.set('properties', 'cover-image')
for item in container.opf_xpath('//opf:item[@href="epub-cover.xhtml"]'):
item.set('properties', 'svg calibre:title-page')
for item in container.opf_xpath('//opf:package'):
prefix = item.get('prefix') or ''
if prefix:
prefix += ' '
item.set('prefix', prefix + 'calibre: https://calibre-ebook.com')
# Remove any <meta cover> tag as it is not needed in epub 3
for meta in container.opf_xpath('//opf:meta[@name="cover"]'):