Summary
The Python script in the previous section is just
a first step in fully automating any kind of EPUB conversion. For the sake of brevity, it
does not handle many common cases, such as arbitrarily nested paths, stylesheets,
or embedded fonts. Ruby fans can look at dbtoepub,
included in the DocBook XSL distribution, for a similar approach in that language.
Because EPUB is a relatively young format, many useful conversion paths still await creation. Fortunately, most types of structured markup, such as reStructuredText or Markdown, have pipelines that produce HTML or XHTML already; adapting those to produce EPUBs should be fairly straightforward, especially using the DocBook-to-EPUB Python or Ruby scripts as a guide.
Because EPUB is mostly ZIP and XHTML, there's little reason not to distribute documentation bundles as EPUB archives rather than as simple .zip files. Users with EPUB readers benefit from the additional metadata and automatic table of contents, but those without can simply treat the EPUB archive as a normal ZIP file and view the XHTML contents in a browser. Consider adding EPUB-generating code to any kind of documentation system, such as Javadoc or Perldoc. EPUB is designed for documentation at book length, so it's a perfect distribution format for the increasing number of online or in-progress programming books.




