# Those will be generated for all books.
EBOOK_FORMATS_WITH_CHILDREN = ['pdf', 'epub', 'mobi']
# Those will be generated when inherited cover changes.
-EBOOK_FORMATS_WITH_COVERS = ['mobi']
+EBOOK_FORMATS_WITH_COVERS = ['pdf', 'epub', 'mobi']
EBOOK_FORMATS = EBOOK_FORMATS_WITHOUT_CHILDREN + EBOOK_FORMATS_WITH_CHILDREN
class BuildPdf(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
- return wldoc.as_pdf(morefloats=settings.LIBRARIAN_PDF_MOREFLOATS)
+ return wldoc.as_pdf(morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
+ cover=True)
def build(self, fieldfile):
BuildEbook.build(self, fieldfile)
clear_cache(fieldfile.instance.slug)
+@BuildEbook.register('epub')
+@task(ignore_result=True)
+class BuildEpub(BuildEbook):
+ @staticmethod
+ def transform(wldoc, fieldfile):
+ return wldoc.as_epub(cover=True)
+
+
@BuildEbook.register('html')
@task(ignore_result=True)
class BuildHtml(BuildEbook):