Chapter 3. Generating EPUBs and Kindle Books from DITA Content
The D4P EPUB and Kindle book generation Open Toolkit plugins enable generation of delivery-ready EPUBs and Kindle books from any conforming DITA content.
The DITA for Publishers EPUB generation plugin (org.dita4publishers.epub) generates EPUBs that conform to the IDPF EPUB EPUB2 and EPUB3 standards. You can generate pure EPUB2, pure EPUB3, or dual EPUB2/3 as required.
The plugin works with any conforming DITA content. The resulting EPUBs may be used with any EPUB reader software or hardware. The EPUBs have been tested on a number of devices and readers, including iBooks and Adobe Digital Editions.
The DITA for Publishers Kindle book generation plugin (org.dita4publishers.kindle) generates Kindle books (Mobipocket format) that can pass the kindlegen checks on Kindle book content and organization. The plugin works with any conforming DITA content. The resulting Kindle books may be used any Kindle reader or published through Amazon. The Kindle books have been tested with several different Kindle emulators and Mobipocket readers, as well as by publishing a sample book through Amazon's Kindle publishing process.
See Installing the Toolkit Plugins for instructions on how to install the EPUB and Kindle plugins to the DITA Open Toolkit.
The plugins do not require any specific markup in order to get a usable EPUB or Kindle book. However, the plugin does take advantage of specific markup in order to generate EPUB- and Kindle-specific features such as cover graphics, book identifiers, and so on.
The EPUB plugin defines the transformation type "epub" (Ant target "dita2epub"). It is based on the standard XHTML transformation type and therefore takes all the same parameters as the XHTML transformation type. All EPUB-specific parameters are optional.
The Kindle plugin defines the transformation type "kindle" (Ant target "dita2kindle"). It is an extension of the base EPUB transform, using the generated EPUB as the input to the kindlegen process. The Kindle generation process attempts to use the Amazon-provided "kindlegen" command-line tool to construct a publishable Kindle book. You must acquire and install kindlegen separately. The kindlegen tool is proprietary Amazon software and therefore is not licensed in a way that is consistent with the Open Toolkit's open source license. The kindlegen tool can be downloaded from Amazon. Google "kindlegen" to find the exact download location.
You can use the EPUB transformation type by simply specifying a transtype value of "epub" rather than "html" and use the same parameters you would use for HTML generation.
You can use the Kindle transformation type by simply specifying a transtype value of "kindle" rather than "html" and use the same parameters you would use for HTML generation.
The EPUB transformation provides a number of extension points by which you can extend or customize the details of EPUB generation.