DAISY 2.02 to EPUB3
The "DAISY 2.02 to EPUB3" script will convert a DAISY 2.02 DTB (Digital Talking Book) into an EPUB3 publication. This page describes the steps, comments and issues related to this transformation.
Synopsis
Options
| name | description | |:---------|:----------------| | href (required) | The URI to the input NCC. | | output (required) | The URI to the output directory for the EPUB. | | mediaoverlay | Whether or not to include media overlays and associated audio files. Can be either 'true' (default) or 'false'. | | compatibility-mode | Whether or not to include NCX-file, OPF guide element and ASCII filenames. Can be either 'true' (default) or 'false'. |
Example running from command line
On Linux and Mac OS X:
cli/dp2 daisy202-to-epub3 --x-href samples/daisy202/dontworrybehappy/ncc.html --x-output ~/Desktop/out --x-mediaoverlay false --x-compatibility-mode false
On Windows:
cli\dp2.exe daisy202-to-epub3 --x-href samples\daisy202\dontworrybehappy\ncc.html --x-output C:\Pipeline2-Output --x-mediaoverlay false --x-compatibility-mode false
Notes
This command will create two entries in the output directory. One is a folder called "epub", which is a temporary directory created by the converter. The second is the resulting EPUB3 file. The EPUB3 file is given a name based on the dc:identifier and dc:title metadata elements from the original NCC; "dc:identifier - dc:title.epub".
Outline
The high-level conversion workflow is as follows:
- Get the SMIL-based reading order from the NCC
- Load all the SMILs and upgrade them to EPUB3 Media Overlays
- Extract content document references from each SMIL
- Make a content-based reading order
- Load all the content documents, upgrade them to EPUB3 Content Documents
- If mediaoverlay = 'true'
- Rearrange the Media Overlays to match the Content Documents
- Get all referenced audio, images, etc.
- Make the EPUB3 Navigation Document based on the NCC
- Make the EPUB3 Package Document
- Store the EPUB3 Publication in a OCF ZIP Container
Errors
This is a list of defined errors for this script. Each error has a unique error code for easy identification.
PDE01
: href must be a valid URI. In practice this simply means that the path must be prefixed with "file://", and in Windows, all directory separators () must be replaced with forward slashes (/).PDE02
: output must be a valid URI. In practice this simply means that the path must be prefixed with "file://", and in Windows, all directory separators () must be replaced with forward slashes (/).PDE03
: When given, mediaoverlay must be either "true" (default) or "false".PDE04
: When given, compatibility-mode must be either "true" (default) or "false".
See Also
Main Specifications
DAISY 2.02 Specification * The Navigation Control Center (NCC) document * The text content document (XHTML) * The SMIL document
EPUB3 Overview * EPUB Publications 3.0 * EPUB Content Documents 3.0 * EPUB Navigation Documents * XHTML Content Documents * EPUB Open Container Format (OCF) 3.0 * EPUB Media Overlays 3.0
Related Specifications
Explicit Dependencies
- HTML Utilities
- px:html-load
- Media Overlay Utils
- px:mediaoverlay-upgrade-smil - upgrade SMIL documents to EPUB3 Media Overlays
- px:mediaoverlay-join - join multiple EPUB3 Media Overlays
- px:mediaoverlay-rearrange - rearrange a set of EPUB3 Media Overlays to correspond to a content document
- smil-to-text-fileset.xsl - get an ordered fileset of all the referenced content documents from the SMILs
- smil-to-audio-fileset.xsl - get an ordered fileset of all the referenced audio files from the SMILs
- Fileset Utils
- px:fileset-join - join multiple filesets
- px:fileset-create - create a fileset
- px:fileset-add-entry - add a file entry to a fileset
- Media Type Utils
- px:mediatype-detect - detect the media type of all files in a fileset
- EPUB3 Nav Utils
- ncc-to-nav.xsl - convert a DAISY 2.02 NCC into an EPUB3 Navigation Document
- EPUB3 Pub Utils
- px:epub3-pub-create-package-doc - create the EPUB3 Package Document
- fileset-to-manifest.xsl - convert a fileset into a OPF manifest
- fileset-to-manifest.xsl - convert a OPF manifest into a OPF spine
- EPUB3 OCF Utils
- px:epub3-ocf-finalize - create files required by the EPUB3 Open Container Format
- px:epub3-ocf-zip - compress the fileset into an EPUB-file
Other
- EPUB3 Production Overview
- ZedAI to EPUB3
Issues / Future additions
- Option to rearrange the content documents based on the media overlays instead of the other way around. This depends on the implementation of
px:mediaoverlay-rearrange-content
in mediaoverlay-utils.