publish epub/mobi with images
authorJan Szejko <j-sz@o2.pl>
Wed, 16 Mar 2016 10:14:01 +0000 (11:14 +0100)
committerJan Szejko <j-sz@o2.pl>
Wed, 16 Mar 2016 10:14:01 +0000 (11:14 +0100)
lib/librarian
src/catalogue/fields.py

index 3acdb97..6d1ec86 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3acdb97ed96bb54a04c031e017c2059f86db57e4
+Subproject commit 6d1ec864ca2ec59a74afe0f025134fdd18e4f5b5
index 1a3a3b5..5b49307 100644 (file)
@@ -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')