Example - Programming Ruby 1.9 & 2.0

This page provides specific information regarding the EPUB variant used in "Programming Ruby 1.9 & 2.0".

Overview

This book uses Version 2.0 of the EPUB standard. The variant used by this book largely matches that described in EPUB 3 Best Practices, but there are some exceptions.

Because this is an EPUB 2.0 document:

  • There is no NAV file (defined in EPUB 3).

  • There is an NCX file (defined in EPUB 3).

The hierarchy in the NCX file (toc.ncx) covers only the Chapter and Section levels: each "Part" page is treated as a minimal "chapter".

Details

The Pragmatic Bookshelf produces a large number of high-quality technical reference works for software developers. Let's examine their EPUB archive for Programming Ruby 1.9 & 2.0.

Directory Tree

The file tree contains about 500 files. Directories (e.g., css, fonts, images, scripts) are used to contain several dozen ancillary files, but about 450 HTML files reside in the main directory (tsk).

.../ex_pr1920/tree/
| META-INF/            # EPUB metadata
| | ...options.xml     # specified-fonts = true (XML)
| | container.xml      # media type, paths (XML)
| content.opf          # Open Packaging Format (XML)
| cover.xhtml          # XHTML for book cover
| css/                 # Cascading Style Sheets
| | book_local.css     # CSS for this book
| | bookshelf.css      # CSS for all books
| f_????.html          # HTML web pages (435)
| fonts/               # font definitions
| | *.ttf              # TrueType fonts (13)
| images/              # raster image files
| | *.{gif,jpg,png}    # miscellaneous (10)
| | */                 # usage categories (9)
| | | *.{gif,jpg,png}  # raster image files
| mimetype             # "application/epub+zip"
| scripts/             # JavaScript (minimized)
| | book_local.js      # JS for this book
| toc.ncx              # table of contents (XML)

Package Document

Per META-INF/container.xml, content.opf is our package document. This is a large file (2338 lines!), so here's another summary:

package       # unique-identifier, version, xmlns
| metadata    # xmlns:dc, xmlns:opf
| | dc:*      # creator, identifier, language, ...
| | meta      # name="cover" content="cover-image" ?
| | meta      # content="cover-image" name="cover" ?
| manifest    # list of files included in document
| | item      # id, href, media-type
| | ...
| spine       # toc="ncx"
| | itemref   # idref=cover
| | itemref   # idref=f_0001
| | ...
| guide
| | reference # href, title, type

Spine

The spine entry lists the enclosed content files, in the "normal" reading order. The toc attribute's value (ncx) tells us to look for toc.ncx, a file which contains EPUB 2 navigation hints and other metadata.

Guide

The guide entry lists only one reference:

  • The cover page ("Cover") is "cover.xhtml".

NCX file

Programming Ruby 1.9 & 2.0
...
Preface
| Why Ruby?
| ...
| 
Road Map
Part 1: Facets of Ruby
Chapter 1: Getting Started
| The Command Prompt
| ...


This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r10 - 27 Oct 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email