From: Jan Szejko Date: Wed, 16 Mar 2016 10:14:01 +0000 (+0100) Subject: publish epub/mobi with images X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/37e0abac697f5dee3c1301eb3b6f94de7a3104fb?ds=inline publish epub/mobi with images --- diff --git a/lib/librarian b/lib/librarian index 3acdb97ed..6d1ec864c 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 3acdb97ed96bb54a04c031e017c2059f86db57e4 +Subproject commit 6d1ec864ca2ec59a74afe0f025134fdd18e4f5b5 diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 1a3a3b5d7..5b49307a3 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -130,7 +130,15 @@ class BuildPdf(BuildEbook): class BuildEpub(BuildEbook): @staticmethod def transform(wldoc, fieldfile): - return wldoc.as_epub(cover=True) + return wldoc.as_epub(cover=True, ilustr_path=gallery_path(wldoc.book_info.url.slug)) + + +@BuildEbook.register('mobi') +@task(ignore_result=True) +class BuildMobi(BuildEbook): + @staticmethod + def transform(wldoc, fieldfile): + return wldoc.as_mobi(cover=True, ilustr_path=gallery_path(wldoc.book_info.url.slug)) @BuildEbook.register('html')