Before you start
This tutorial guides you through creating eBooks in the EPUB format. EPUB is an XML-based, developer-friendly format that is emerging as the de facto standard for digital books. But EPUB isn't just for books: With it, you can:
- Bundle documentation for offline reading or easy distribution
- Package blog posts or other Web-native content
- Build, search, and remix using common open source tools
You start this tutorial by generating an EPUB book manually to help you learn all the components and required files. Next, the tutorial shows how to bundle the finished digital book and validate it against the specification as well as how to test it in various reading systems.
Then, it covers generating EPUB from DocBook XML—one of the most widely used standards for technical documentation—and how to use Python to completely automate EPUB creation with DocBook from end to end.
In this tutorial, you:
- Learn what EPUB is, who's behind it, and who's adopting it
- Explore the structure of an EPUB bundle, including its required files and their schemas
- Create a valid EPUB file from scratch using simple content
- Use open source tools to produce EPUB files from DocBook, a widely used schema for technical documentation and books
- Automate EPUB conversion using Python and DocBook
No particular operating system is assumed for this tutorial, although you should be familiar with the mechanics of creating files and directories. Use of an XML editor or integrated development environment (IDE) is strongly recommended.
For the later parts of the tutorial on automating EPUB creation, this tutorial assumes that you know one or more basic XML processing skills—XSLT, DOM, or SAX-based parsing—and how to construct an XML document using an XML-native API.
No familiarity with the EPUB file format is necessary to complete this tutorial.
To complete the examples in this tutorial, you need a Java interpreter (version 1.5 or later) and a Python interpreter (version 2.4 or later) as well as the required XML libraries for each. However, experienced XML developers should be able to adapt the examples to any programming language with XML libraries.