From 6544129bc98fa18e6abd24591e66cfb383613d92 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 30 May 2012 12:18:38 +0530 Subject: [PATCH] User Manual in azw3 --- manual/index.rst | 2 +- setup/publish.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/manual/index.rst b/manual/index.rst index d0d6bfb9b5..fa89dba95f 100755 --- a/manual/index.rst +++ b/manual/index.rst @@ -17,7 +17,7 @@ To get started with more advanced usage, you should read about the :ref:`Graphic .. only:: online - **An ebook version of this user manual is available in** `EPUB format `_. + **An ebook version of this user manual is available in** `EPUB format `_ and `AZW3 (Kindle Fire) format `_. Sections ------------ diff --git a/setup/publish.py b/setup/publish.py index b7f1b4a597..65df51f848 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -80,8 +80,12 @@ class Manual(Command): '-d', '.build/doctrees', '.', '.build/html']) subprocess.check_call(['sphinx-build', '-b', 'myepub', '-d', '.build/doctrees', '.', '.build/epub']) - shutil.copyfile(self.j('.build', 'epub', 'calibre.epub'), self.j('.build', - 'html', 'calibre.epub')) + epub_dest = self.j('.build', 'html', 'calibre.epub') + shutil.copyfile(self.j('.build', 'epub', 'calibre.epub'), epub_dest) + subprocess.check_call(['ebook-convert', epub_dest, + epub_dest.rpartition('.')[0] + '.azw3', + '--page-breaks-before=/', '--disable-font-rescaling', + '--chapter=/']) finally: os.chdir(cwd)