X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3912237450eea1aa3575751c8ae5a9b696c77334..6e5871ce487810fa5dac891e03296c6d469ffeb3:/apps/catalogue/fields.py diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index 0e02ff90f..68aaa4025 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -105,13 +105,22 @@ class BuildTxt(BuildEbook): 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):