User Manual in azw3

This commit is contained in:
Kovid Goyal 2012-05-30 12:18:38 +05:30
parent 8f8e0018aa
commit 6544129bc9
2 changed files with 7 additions and 3 deletions

View File

@ -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 <calibre.epub>`_.
**An ebook version of this user manual is available in** `EPUB format <calibre.epub>`_ and `AZW3 (Kindle Fire) format <calibre.azw3>`_.
Sections
------------

View File

@ -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)