- book_info = document.book_info
-
- # provide a cover by default
- if not cover:
- cover = DefaultEbookCover
- cover_file = NamedTemporaryFile(suffix='.png', delete=False)
- bound_cover = cover(book_info)
- bound_cover.save(cover_file)
-
- if bound_cover.uses_dc_cover:
- if document.book_info.cover_by:
- document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
- if document.book_info.cover_source:
- document.edoc.getroot().set('data-cover-source', document.book_info.cover_source)
-
- if not flags:
- flags = []
- flags = list(flags) + ['without-fonts']
- epub = document.as_epub(verbose=verbose, sample=sample, html_toc=True,
- flags=flags, style=get_resource('mobi/style.css'))