X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3912237450eea1aa3575751c8ae5a9b696c77334..0c1644b480a81a3b1d55efcd4fc328f7f7ed77a6:/apps/catalogue/fields.py?ds=inline 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):