EPUB3 / DTBook Migrator

Development and Demo


by Jostein Austvik Jacobsen / josteinaj@gmail.com

What? Why?

  • Convert between EPUB3 and DTBook
  • Conforming to the Nordic Markup Guidelines
  • Use existing DTBook-tools for as long as you like
  • Start using EPUB3-tools whenever you want

First, a demonstration...

Open Pipeline 2

Script components

Script components

Script components

Script components

Script components

Script components

Script components

Script components

Script components

Script components

OpenDyslexic

The OpenDyslexic font is used by default when converting to EPUB3.

Alternating paragraph shading helps users stay on track while reading.

Black text and an off-white background color is used to reduce "glare".

Mapping DTBook to EPUB3

DTBook is HTML4 with some added elements and attributes

Mapping DTBook to EPUB3

There are 72 elements in DTBook


a abbr acronym address annoref annotation author bdo blockquote bodymatter book br bridgehead byline caption cite code col colgroup covertitle dateline dd dfn div dl docauthor doctitle dt dtbook em epigraph frontmatter h1-h6 hd head img imggroup kbd level level1-level6 li lic line linegroup linenum link list meta note noteref p pagenum poem prodnote q rearmatter samp sent sidebar span strong sub sup table tbody td tfoot th thead title tr w

Mapping DTBook to EPUB3

Many elements exist in both DTBook and HTML


a abbr acronym address annoref annotation author bdo blockquote bodymatter book br bridgehead byline caption cite code col colgroup covertitle dateline dd dfn div dl docauthor doctitle dt dtbook em epigraph frontmatter h1-h6 hd head img imggroup kbd level level1-level6 li lic line linegroup linenum link list meta note noteref p pagenum poem prodnote q rearmatter samp sent sidebar span strong sub sup table tbody td tfoot th thead title tr w

Mapping DTBook to EPUB3

Some elements have different names in HTML


annoref → a
book → body
dtbook → html
hd → h1-h6
imggroup → figure
level → section
level1-level6 → section
list → ol, ul
noteref → a

Mapping DTBook to EPUB3

The default EPUB3 type vocabulary can be used for some elements


acronymabbr epub:type="acronym"
annotationaside epub:type="annotation"
bodymatter → epub:type="bodymatter"
bridgeheadp epub:type="bridgehead"
doctitleh1 epub:type="fulltitle"
epigraphp epub:type="epigraph"
frontmatter → epub:type="titlepage|cover|frontmatter"
noteaside epub:type="note"
pagenumspan epub:type="pagebreak"
rearmatter → epub:type="backmatter"
sidebaraside epub:type="sidebar"

Mapping DTBook to EPUB3

And the ZedAI (DAISY 4) vocabulary can also be used as the EPUB3 type for some elements


authorspan epub:type="z3998:author"
covertitleh1 epub:type="z3998:covertitle"
docauthorp epub:type="z3998:author"
poemsection/div epub:type="z3998:poem"
prodnoteaside epub:type="z3998:production"
sentspan epub:type="z3998:sentence"
wspan epub:type="z3998:word"

Mapping DTBook to EPUB3

The remaining elements lack a good semantic equivalent in HTML, and are simply annotated with classes


bylinespan class="byline"
datelinespan class="dateline"
licspan class="lic"
linespan class="line"
linegroupsection/div class="linegroup"
linenumspan class="linenum"
titlestrong class="title"

Mapping DTBook to EPUB3

There are challenges in mapping attributes as well.


showin="*" → class="showin-*"
pronounce="yes" → CSS: -epub-speak-as: spell-out;
etc.

GitHub development

  • Source code on GitHub
  • Mapping implemented in XSLT
  • Scripts implemented in XProc
  • Source can be viewed and issues can be submitted on GitHub

How to install the Nordic Pipeline 2 modules locally

  • Download and install Pipeline 2 using the installer
  • Download the Nordic Migrator modules from GitHub
  • Place the Nordic Migrator modules (the *.jar-files) into the daisy-pipeline/modules directory


NOTE: Pipeline 2 v1.7 is required (not released yet). Also, the Nordic Migrator *.jar files are not yet made available for download.

</presentation>

This presentation is also available from beta.nlb.no/div/2013/nordic-migrator