<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Threepress Consulting blog &#187; epub</title>
	<atom:link href="http://blog.threepress.org/category/epub/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.threepress.org</link>
	<description>Threepress creates software for publishers, educators and authors.</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:02:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Better support for Unicode characters in EPUB validator</title>
		<link>http://blog.threepress.org/2011/08/02/better-support-for-unicode-characters-in-epub-validator/</link>
		<comments>http://blog.threepress.org/2011/08/02/better-support-for-unicode-characters-in-epub-validator/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 15:29:40 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[epubcheck]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=2094</guid>
		<description><![CDATA[We&#8217;ve fixed a long-standing limitation in the online EPUB validator that prevented files with non-ASCII characters from being validated.  (The bug was actually not in our code but at a lower level; I&#8217;ve posted a fix that simply works around it.)
If you had problems before receiving &#8220;Site error&#8221; when uploading an EPUB with accented [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve fixed a long-standing limitation in the <a href="http://threepress.org/document/epub-validate/">online EPUB validator</a> that prevented files with non-ASCII characters from being validated.  (The bug was actually not in our code but at a lower level; I&#8217;ve posted a fix that simply works around it.)</p>
<p>If you had problems before receiving &#8220;Site error&#8221; when uploading an EPUB with accented characters, you should now be able to validate successfully.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/08/02/better-support-for-unicode-characters-in-epub-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transforming NCX into EPUB 3 Navigation Documents</title>
		<link>http://blog.threepress.org/2011/06/14/ncx-into-epub3/</link>
		<comments>http://blog.threepress.org/2011/06/14/ncx-into-epub3/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 13:30:02 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[epub3]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=2038</guid>
		<description><![CDATA[The first version of EPUB used the NCX format to describe an accessible, machine-readable Table of Contents. NCX had come to EPUB from DAISY’s DTBook standard and was a crucial navigational aide. Unfortunately, NCX was rarely understood and is not very human-readable. As part of the alignment with wider web standards, EPUB 3 has dropped [...]]]></description>
			<content:encoded><![CDATA[<p>The first version of EPUB used the <a href="http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.4.1">NCX</a> format to describe an accessible, machine-readable Table of Contents. NCX had come to EPUB from DAISY’s <a href="http://www.niso.org/workrooms/daisy/Z39-86-2005.html">DTBook</a> standard and was a crucial navigational aide. Unfortunately, NCX was rarely understood and is not very human-readable. As part of the alignment with wider web standards, EPUB 3 has dropped the NCX format and encodes the same information in a specialization of XHTML, the <a href="http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-nav">EPUB Navigation Document</a>.</p>
<p>Moving away from specialized ebook-only solutions was a big part of EPUB 3, so I am quite interested to see what these new EPUB Navigation Documents look like in the real world. It seemed like the easiest way to create a lot of them was to transform NCX files into the new format, so I’ve written an open-source (BSD) stylesheet to do just that:</p>
<p><a href="https://github.com/downloads/threepress/epub3-tools/ncx2end-0.1.xsl">ncx2end-0.1.xsl</a></p>
<p><em>Note:</em> This <code>ncx2end-0.1.xsl</code> is alpha-quality software in the worst possible way—it probably won’t work correctly on your documents and is hard to use. It does produce apparently-<a href="http://blog.threepress.org/2011/06/13/validating-epub-3-today/">valid</a> output for the 100+ NCX files I had around, but I would not put much faith in that today. Enjoy!</p>
<p>If you find this tool useful enough to discover an error, please <a href="https://github.com/threepress/epub3-tools/issues/new">submit a bug report</a> and make sure to attach your NCX file to improve the test suite.</p>
<p><span id="more-2038"></span></p>
<hr />
<p>EPUB 3 does strongly encourage Reading Systems to support EPUB (including NCX), but it would be nice to start seeing more experiments with EPUB 3 files to help encourage meaningful adoption.</p>
<hr />
<p>Here’s an example of the input and output, just for show and tell. The EPUB Navigation Document looks normal and straightforward: that’s the point.</p>
<h3>NCX in</h3>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;ncx xmlns=&quot;http://www.daisy.org/z3986/2005/ncx/&quot; version=&quot;2005-1&quot; xml:lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
    &lt;meta name=&quot;dtb:uid&quot; content=&quot;p9780316000000&quot;/&gt;
    &lt;meta name=&quot;dtb:depth&quot; content=&quot;1&quot;/&gt;
    &lt;meta name=&quot;dtb:totalPageCount&quot; content=&quot;0&quot;/&gt;
    &lt;meta name=&quot;dtb:maxPageNumber&quot; content=&quot;0&quot;/&gt;
  &lt;/head&gt;
  &lt;docTitle&gt;
    &lt;text&gt;Moby-Dick&lt;/text&gt;
  &lt;/docTitle&gt;
  &lt;docAuthor&gt;
    &lt;text&gt;Herman Melville&lt;/text&gt;
  &lt;/docAuthor&gt;
  &lt;navMap&gt;
    &lt;navPoint id=&quot;cover&quot; playOrder=&quot;1&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Cover&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;cover.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint id=&quot;titlepage&quot; playOrder=&quot;2&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Title Page&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;titlepage.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;3&quot; id=&quot;preface_001&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Original Transcriber’s Notes:&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;preface_001.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;4&quot; id=&quot;introduction_001&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;ETYMOLOGY.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;introduction_001.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;5&quot; id=&quot;epigraph_001&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;EXTRACTS (Supplied by a Sub-Sub-Librarian).&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;epigraph_001.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;6&quot; id=&quot;chapter_001&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 1. Loomings.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_001.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;7&quot; id=&quot;chapter_002&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 2. The Carpet-Bag.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_002.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;8&quot; id=&quot;chapter_003&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 3. The Spouter-Inn.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_003.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;9&quot; id=&quot;chapter_004&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 4. The Counterpane.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_004.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;10&quot; id=&quot;chapter_005&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 5. Breakfast.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_005.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;11&quot; id=&quot;chapter_006&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 6. The Street.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_006.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;12&quot; id=&quot;chapter_007&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 7. The Chapel.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_007.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint playOrder=&quot;13&quot; id=&quot;chapter_008&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Chapter 8. The Pulpit.&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;chapter_008.html&quot;/&gt;
    &lt;/navPoint&gt;
    &lt;navPoint id=&quot;copyright&quot; playOrder=&quot;14&quot;&gt;
      &lt;navLabel&gt;
        &lt;text&gt;Copyright Page&lt;/text&gt;
      &lt;/navLabel&gt;
      &lt;content src=&quot;copyright.html&quot;/&gt;
    &lt;/navPoint&gt;
  &lt;/navMap&gt;
&lt;/ncx&gt;
</pre>
<h3>EPUB Navigation Document out</h3>
<pre class="brush: xml;">
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;
      profile=&quot;http://www.idpf.org/epub/30/profile/content/&quot;&gt;
  &lt;head&gt;
    &lt;title&gt;Moby-Dick&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;nav id=&quot;toc&quot; epub:type=&quot;toc&quot;&gt;
      &lt;h1&gt;Contents&lt;/h1&gt;
      &lt;ol&gt;
        &lt;li id=&quot;cover&quot;&gt;
          &lt;a href=&quot;cover.html&quot;&gt;Cover&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;titlepage&quot;&gt;
          &lt;a href=&quot;titlepage.html&quot;&gt;Title Page&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;preface_001&quot;&gt;
          &lt;a href=&quot;preface_001.html&quot;&gt;Original Transcriber&amp;#x2019;s Notes:&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;introduction_001&quot;&gt;
          &lt;a href=&quot;introduction_001.html&quot;&gt;ETYMOLOGY.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;epigraph_001&quot;&gt;
          &lt;a href=&quot;epigraph_001.html&quot;&gt;EXTRACTS (Supplied by a Sub-Sub-Librarian).&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_001&quot;&gt;
          &lt;a href=&quot;chapter_001.html&quot;&gt;Chapter 1. Loomings.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_002&quot;&gt;
          &lt;a href=&quot;chapter_002.html&quot;&gt;Chapter 2. The Carpet-Bag.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_003&quot;&gt;
          &lt;a href=&quot;chapter_003.html&quot;&gt;Chapter 3. The Spouter-Inn.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_004&quot;&gt;
          &lt;a href=&quot;chapter_004.html&quot;&gt;Chapter 4. The Counterpane.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_005&quot;&gt;
          &lt;a href=&quot;chapter_005.html&quot;&gt;Chapter 5. Breakfast.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_006&quot;&gt;
          &lt;a href=&quot;chapter_006.html&quot;&gt;Chapter 6. The Street.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_007&quot;&gt;
          &lt;a href=&quot;chapter_007.html&quot;&gt;Chapter 7. The Chapel.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;chapter_008&quot;&gt;
          &lt;a href=&quot;chapter_008.html&quot;&gt;Chapter 8. The Pulpit.&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;copyright&quot;&gt;
          &lt;a href=&quot;copyright.html&quot;&gt;Copyright Page&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ol&gt;
    &lt;/nav&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>A more complicated book might use a lot more nesting, but it’s essentially turtles the whole way down:</p>
<pre class="brush: xml;">
&lt;li id=&quot;id2532183&quot;&gt;
  &lt;a href=&quot;pt03.html&quot;&gt;III. CSS Page Layout&lt;/a&gt;
  &lt;ol&gt;
    &lt;li id=&quot;id2532206&quot;&gt;
      &lt;a href=&quot;ch11.html&quot;&gt;11. Introducing CSS Layout&lt;/a&gt;
      &lt;ol&gt;
        &lt;li id=&quot;id2532230&quot;&gt;
          &lt;a href=&quot;ch11.html#types_of_web_page_layouts&quot;&gt;Types of Web Page Layouts&lt;/a&gt;
        &lt;/li&gt;
        &lt;li id=&quot;id2532537&quot;&gt;
          &lt;a href=&quot;ch11s02.html&quot;&gt;How CSS Layout Works&lt;/a&gt;
          &lt;ol&gt;
            &lt;li id=&quot;id2532706&quot;&gt;
              &lt;a href=&quot;ch11s02.html#the_mighty_div_tag&quot;&gt;The Mighty &amp;lt;div&amp;gt; Tag&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2532968&quot;&gt;
              &lt;a href=&quot;ch11s02.html#techniques_for_css_layout&quot;&gt;Techniques for CSS Layout&lt;/a&gt;
            &lt;/li&gt;
          &lt;/ol&gt;
        &lt;/li&gt;
        &lt;li id=&quot;id2533080&quot;&gt;
          &lt;a href=&quot;ch11s03.html&quot;&gt;Layout Strategies&lt;/a&gt;
          &lt;ol&gt;
            &lt;li id=&quot;id2533169&quot;&gt;
              &lt;a href=&quot;ch11s03.html#start_with_your_content&quot;&gt;Start with Your Content&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533229&quot;&gt;
              &lt;a href=&quot;ch11s03.html#mock_up_your_design&quot;&gt;Mock Up Your Design&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533293&quot;&gt;
              &lt;a href=&quot;ch11s03.html#identify_the_boxes&quot;&gt;Identify the Boxes&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533412&quot;&gt;
              &lt;a href=&quot;ch11s03.html#go_with_the_flow&quot;&gt;Go with the Flow&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533461&quot;&gt;
              &lt;a href=&quot;ch11s03.html#remember_background_images&quot;&gt;Remember Background Images&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533602&quot;&gt;
              &lt;a href=&quot;ch11s03.html#pieces_of_a_puzzle&quot;&gt;Pieces of a Puzzle&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533688&quot;&gt;
              &lt;a href=&quot;ch11s03.html#layering_elements&quot;&gt;Layering Elements&lt;/a&gt;
            &lt;/li&gt;
            &lt;li id=&quot;id2533747&quot;&gt;
              &lt;a href=&quot;ch11s03.html#dont_forget_margins_and_padding&quot;&gt;Don't Forget Margins and Padding&lt;/a&gt;
            &lt;/li&gt;
          &lt;/ol&gt;
        &lt;/li&gt;
      &lt;/ol&gt;
    &lt;/li&gt;
    &lt;li id=&quot;id2533808&quot;&gt;
      &lt;a href=&quot;ch12.html&quot;&gt;12. Building Float-Based Layouts&lt;/a&gt;
      &lt;ol&gt;
        &lt;li id=&quot;id2534262&quot;&gt;
          &lt;a href=&quot;ch12.html#applying_floats_to_your_layouts&quot;&gt;Applying Floats to Your Layouts&lt;/a&gt;
          ....
</pre>
<hr />
<p>Thanks to <a href="http://twitter.com/dauwhe">Dave Cramer</a> for producing one of the <a href="http://code.google.com/p/epub-revision/downloads/detail?name=9780316000000_MobyDick_r2.epub">first EPUB 3 test files</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/06/14/ncx-into-epub3/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Validating EPUB 3 experiments</title>
		<link>http://blog.threepress.org/2011/06/13/validating-epub-3-today/</link>
		<comments>http://blog.threepress.org/2011/06/13/validating-epub-3-today/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 13:30:45 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[epub3]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=2042</guid>
		<description><![CDATA[EPUB 3 is tricky to experiment with today. Like any brand-new specification, there aren’t many of the resources we often take for granted, from books to software to validation tools. However, if you’re already comfortable getting your hands dirty you can get meaningful validation for your EPUB 3 documents now. In the future, we’ll probably [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.idpf.org/epub/30/spec/epub30-overview.html">EPUB 3</a> is tricky to experiment with today. Like any brand-new specification, there aren’t many of the resources we often take for granted, from books to software to validation tools. However, if you’re already comfortable getting your hands dirty you can get meaningful validation for your EPUB 3 documents now. In the future, we’ll probably have a dedicated EPUB 3 validation tool (modeled somewhat on <a href="http://code.google.com/p/epubcheck/">epubcheck</a>, although with quite a few changes, I hope), but I’d like to start working today. This post outlines how.</p>
<p><em>Note:</em> I’m going to give examples using a number of bare-metal tools available on Mac OS X. These are probably portable to Linux and even Windows if you were motivated, but I’m not going to explain how to install them or set them up (here or in the comments). <a href="http://google.com">Google is your friend</a>.</p>
<p><span id="more-2042"></span></p>
<p>To get started, download <a href="http://idpf.org/epub/30/schema/epub30-schemas.zip">all of the EPUB 3 schemas</a> (I put them in an <code>epub30-schemas/</code> directory), install the absolute latest version of the RELAX NG validator <a href="http://jing-trang.googlecode.com/files/jing-20091111.zip">Jing</a> (<code>jing-20091111/</code> for me), download the Schematron tools at <a href="http://www.schematron.com/implementation.html">iso-schematron-xslt1.zip is for XSLT1 processors</a> (<code>iso-schematron</code> for me), and make sure you’ve got access to both <a href="http://xmlsoft.org/XSLT/xsltproc2.html">xsltproc</a> and <code>java</code>. Finally, save this as <code>svrl_as_text.xsl</code>:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
            xmlns:svrl=&quot;http://purl.oclc.org/dsdl/svrl&quot;
            version=&quot;1.0&quot;&gt;
  &lt;xsl:output method=&quot;text&quot;/&gt;

  &lt;xsl:template match=&quot;*|node()&quot;&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match=&quot;svrl:failed-assert|
                       svrl:successful-report&quot;&gt;
    &lt;xsl:text&gt;FAILURE: &lt;/xsl:text&gt;
    &lt;xsl:value-of select=&quot;local-name(.)&quot;/&gt;
    &lt;xsl:text&gt;: &lt;/xsl:text&gt;
    &lt;xsl:value-of select=&quot;normalize-space(svrl:text/text())&quot;/&gt;
    &lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>
<h3>Layout of the EPUB 3 schemas</h3>
<p>All of the schemas for EPUB 3 are available as <a href="http://relaxng.org/">RELAX NG</a> and sometimes <a href="www.schematron.com">Schematron</a>. Each one has specific strengths, so we use both schemas whenever possible to get a complete list of all the validation issues. The <a href="http://idpf.org/epub/30/schema/">EPUB 3 schemas</a> are broken into separate files for each type of document inside an EPUB 3. You should notice that there is a RELAX NG Compact <code>.rnc</code> file for each type:</p>
<pre>
epub30-schemas/epub-nav-30.rnc        # EPUB Navigation Document
epub30-schemas/epub-svg-30.rnc        # SVG Content Documents
epub30-schemas/epub-xhtml-30.rnc      # XHTML Content Documents
epub30-schemas/media-overlay-30.rnc   # Media Overlay Documents
epub30-schemas/ocf-container-30.rnc   # META-INF/container.xml
epub30-schemas/ocf-encryption-30.rnc  # META-INF/encryption.xml
epub30-schemas/ocf-signatures-30.rnc  # META-INF/signatures.xml
epub30-schemas/package-30.rnc         # Package Documents
</pre>
<p>Unsurprisingly, you use a RELAX NG validator with <code>epub30-schemas/media-overlay-30.rnc</code> to validate a Media Overlay document.</p>
<p>A few of these documents also have a Schematron schema with the same prefix but ending with <code>.sch</code>, which is used to express other requirements that aren’t possible in RELAX NG:</p>
<pre>
epub30-schemas/epub-nav-30.sch
epub30-schemas/epub-svg-30.sch
epub30-schemas/epub-xhtml-30.sch
epub30-schemas/media-overlay-30.sch
epub30-schemas/package-30.sch
</pre>
<p>There are some standalone Schematron validators, but we’re actually going to roll our own tool for more human-readable output.</p>
<p>There’s a third file extension too, <code>.nvdl</code>, which is short for <a href="http://nvdl.org/">Namespace-based Validation Dispatching Language</a>. These files are supposed to wrap these two schemas together for unified validation tools, but there isn’t good software support for NVDL today. Ignore the <code>.nvdl</code> files for now.</p>
<h3>What to validate</h3>
<p>I’m currently interested in the <a href="http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-nav">EPUB Navigation Document</a>, a reformulation of EPUB’s NCX document as XHTML, so these are the examples we’ll use. However, this approach should work for any of the other document types if you go through the same setup. </p>
<p>Here is a valid, if short, EPUB Navigation Document:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;
      profile=&quot;http://www.idpf.org/epub/30/profile/content/&quot;&gt;
  &lt;head&gt;
    &lt;title&gt;EPUB Navigation Document Example (Good)&lt;/title&gt;
    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;section class=&quot;frontmatter TableOfContents&quot;&gt;
      &lt;header&gt;
        &lt;h1&gt;Contents&lt;/h1&gt;
      &lt;/header&gt;
      &lt;nav epub:type=&quot;toc&quot; id=&quot;toc&quot;&gt;
        &lt;ol&gt;
          &lt;li class=&quot;toc-prelin&quot; id=&quot;toc-prelim&quot;&gt;
            &lt;a href=&quot;prelims.html&quot;&gt;Introduction&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class=&quot;toc-ch01&quot; id=&quot;toc-ch01&quot;&gt;
            &lt;a href=&quot;ch01.html&quot;&gt;Chapter 1&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href=&quot;copyright.html&quot;&gt;Copyright Page&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ol&gt;
      &lt;/nav&gt;
      &lt;nav epub:type=&quot;landmarks&quot; id=&quot;guide&quot;&gt;
        &lt;h2&gt;Guide&lt;/h2&gt;
        &lt;ol&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;toc&quot; href=&quot;#toc&quot;&gt;Table of Contents&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;bodymatter&quot; href=&quot;chapter_001.xhtml&quot;&gt;Begin Reading&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;copyright-page&quot; href=&quot;copyright.xhtml&quot;&gt;Copyright Page&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ol&gt;
      &lt;/nav&gt;
    &lt;/section&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And here is one with a few errors that should be reported as invalid:</p>
<pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot;
      profile=&quot;http://www.idpf.org/epub/30/profile/content/&quot;&gt;
  &lt;head&gt;
    &lt;title&gt;EPUB Navigation Document Example (Bad)&lt;/title&gt;
    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;section class=&quot;frontmatter TableOfContents&quot;&gt;
      &lt;header&gt;
        &lt;h1&gt;Contents&lt;/h1&gt;
      &lt;/header&gt;
      &lt;nav&gt;
        &lt;!-- this is omitted, which is invalid: epub:type=&quot;toc&quot; id=&quot;toc&quot; --&gt;
        &lt;ol&gt;
          &lt;li class=&quot;toc-prelin&quot; id=&quot;toc-prelim&quot;&gt;
            &lt;a href=&quot;prelims.html&quot;&gt;Introduction&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class=&quot;toc-ch01&quot; id=&quot;toc-ch01&quot;&gt;
            &lt;a href=&quot;ch01.html&quot;&gt;Chapter 1&lt;/a&gt;
            &lt;!-- This is invalid --&gt;
            &lt;span/&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a href=&quot;copyright.html&quot;&gt;Copyright Page&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ol&gt;
      &lt;/nav&gt;
      &lt;nav epub:type=&quot;landmarks&quot; id=&quot;guide&quot;&gt;
        &lt;h2&gt;Guide&lt;/h2&gt;
        &lt;ol&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;toc&quot; href=&quot;#toc&quot;&gt;Table of Contents&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;bodymatter&quot; href=&quot;chapter_001.xhtml&quot;&gt;Begin Reading&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;a epub:type=&quot;copyright-page&quot; href=&quot;copyright.xhtml&quot;&gt;Copyright Page&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ol&gt;
      &lt;/nav&gt;
    &lt;/section&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>RELAX NG validation with Jing</h3>
<p>Once you’ve got <code>jing</code> setup, it’s pretty straightforward to validate our files (above) against the appropriate <code>.rnc</code>. We’ll be using the  <code>epub30-schemas/epub-nav-30.rnc</code> schema.</p>
<p>When you run <code>jing</code> against a file and it passes, you get no output (good) and an exit code of <code>0</code>. I’m calling <code>jing</code> as <code>java -jar jing-20091111/bin/jing.jar</code>, passing the <code>-c</code> flag to tell it to expect a Compact version of RELAX NG, and then the schema filename followed by the filename of the document to validate:</p>
<pre>$ java -jar jing-20091111/bin/jing.jar -c epub30-schemas/epub-nav-30.rnc good.nav.html
$ echo $? # What was the exit code?
0</pre>
<p>Unlike earlier versions of <code>jing</code>, the latest versions have much clearer error reports on invalid documents (we also saw this improvement in <a href="http://blog.threepress.org/2011/03/24/epubcheck-1-2-released/">epubcheck 1.2</a> thanks to George Bina from <a href="http://www.oxygenxml.com/">oXygen</a>):</p>
<pre>$ java -jar jing-20091111/bin/jing.jar -c epub30-schemas/epub-nav-30.rnc bad.nav.html
bad.nav.html:21:20: error: element "span" not allowed here; expected the element end-tag or element "ol"
</pre>
<p>&#8230;and the exit code is not <code>0</code>, just as expected:</p>
<pre>$ echo $?
1</pre>
<p>We can take apart that first bit out output, <code>bad.nav.html:21:20</code>, to know which file had the error (we could run it on many at once) and also the line number (<code>21</code>) and character on that line (<code>20</code>). Line 21 has just what we would expect given the error message (a <code>span</code> instead of another <code>ol</code> or the end of this one), but for other errors it can be quite illuminating:</p>
<pre>$ sed -n -e 21p bad.nav.html
            &lt;span/&gt;
</pre>
<p><em>Note:</em> For really large documents, you may get an <code>java.lang.OutOfMemoryError</code> or other exception. Find out how to give <code>jing</code> more “heap space”.</p>
<h3>Schematron validation with XSLT</h3>
<p>Validating the Schematron schemas is a little more involved, but it catches some validation errors than <code>jing</code> and RELAX NG just cannot find. First we turn the <code>.sch</code> file into a re-usable XSLT stylesheet that produces Schematron Validation Report Language (SVRL). We can then run that stylesheet on any document of that type inside an EPUB 3 file to produce SVRL, which we then transform into something human-readable.</p>
<p>First we create our validation stylesheet, <code>epub-nav-30.sch.xsl</code>, from the <code>epub30-schemas/epub-nav-30.sch</code> Schematron schema:</p>
<pre>$ xsltproc -o epub-nav-30.sch.xsl iso-schematron/iso_svrl_for_xslt1.xsl epub30-schemas/epub-nav-30.sch</pre>
<p>Now we can use <code>epub-nav-30.sch.xsl</code> on any EPUB Navigation Document:</p>
<pre>$ xsltproc epub-nav-30.sch.xsl bad.nav.html</pre>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot;?&gt;
&lt;svrl:schematron-output xmlns:svrl=&quot;http://purl.oclc.org/dsdl/svrl&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:schold=&quot;http://www.ascc.net/xml/schematron&quot; xmlns:sch=&quot;http://www.ascc.net/xml/schematron&quot;
xmlns:iso=&quot;http://purl.oclc.org/dsdl/schematron&quot; xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:epub=&quot;http://www.idpf.org/2007/ops&quot; title=&quot;&quot; schemaVersion=&quot;&quot;&gt;
  &lt;!--   
		   
		   
		 --&gt;
  &lt;svrl:ns-prefix-in-attribute-values uri=&quot;http://www.w3.org/1999/xhtml&quot; prefix=&quot;html&quot;/&gt;
  &lt;svrl:ns-prefix-in-attribute-values uri=&quot;http://www.idpf.org/2007/ops&quot; prefix=&quot;epub&quot;/&gt;
  &lt;svrl:active-pattern id=&quot;nav-ocurrence&quot; name=&quot;nav-ocurrence&quot;/&gt;
  &lt;svrl:fired-rule context=&quot;html:body&quot;/&gt;
   ... many more lines ...
</pre>
<p>&#8230;but we rarely want to read the SVRL it outputs directly (although sometimes it is worth it for the extra detail it contains), so we need to send it through another stylesheet (<code>svrl_as_text.xsl</code> from above) to get a human-readable output:</p>
<pre>$ xsltproc epub-nav-30.sch.xsl bad.nav.html | xsltproc svrl_as_text.xsl -
FAILURE: failed-assert: Exactly one 'toc' nav element must be present
FAILURE: failed-assert: Spans within nav elements must contain text
FAILURE: failed-assert: nav elements other than 'toc', 'page-list' and 'landmarks' must contain a heading as the first child
</pre>
<p>These are completely new issues that <code>jing</code> could not catch. Note that the issue about the <code>span</code> is actually distinct from the one above, which said it was in the wrong <em>place</em>, whereas this says that it has the wrong content (none at all, in fact).</p>
<p>Unlike <code>jing</code>, we don’t get meaningful exit codes. Although that is not too hard to add, it’s slight tricky to get <strong>all</strong> of the errors and exit codes rather than just exiting on the first one, which can make you think your document is less invalid than it really is. We still get no output for valid documents:</p>
<pre>$ xsltproc epub-nav-30.sch.xsl good.nav.html | xsltproc svrl_as_text.xsl -
# no output</pre>
<hr />
<p>I’m certain to have made lots of mistakes in the examples above. If you spot some, please let me know in the comments and I’ll correct the post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/06/13/validating-epub-3-today/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Copy Editors in EPUB 3</title>
		<link>http://blog.threepress.org/2011/06/07/copy-editors-epub3/</link>
		<comments>http://blog.threepress.org/2011/06/07/copy-editors-epub3/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 13:37:11 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[epub3]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=2005</guid>
		<description><![CDATA[The new flexibility in metadata for EPUB 3 is a strength. Instead of locking down the set of permitted metadata schemes and schemas (like EPUB), it allows us to use a range of definitions. While this flexibility comes with some dangers (see the discussion in the comments here about what to do when there isn’t [...]]]></description>
			<content:encoded><![CDATA[<p>The new flexibility in metadata for EPUB 3 is a strength. Instead of locking down the set of permitted metadata schemes and schemas (like EPUB), it allows us to use a range of definitions. While this flexibility comes with some dangers (see the <a href="http://blog.threepress.org/2011/05/31/subtitles-in-epub-3/">discussion in the comments here</a> about what to do when there <em>isn’t</em> yet a good external definition), I’m generally not worried about giving the masses power tools (most folks are smarter than you think). </p>
<p>In particular, I’ve always been annoyed that in EPUB’s metadata I could not give proper, specific credit to the many people that make a contribution to a title, even if they are not on the cover. Here’s the cover of <a href="http://www.abookapart.com/products/responsive-web-design">Responsive Web Design</a>:</p>
<p><a href="http://www.abookapart.com/products/responsive-web-design"><img alt="cover of Responsive Web Design" src="http://bkaprt.com/i/RWD-holder.png"/></a></p>
<p>but here’s the set of contributors in the EPUB&#8217;s metadata:</p>
<pre class="brush: xml;">
&lt;dc:creator opf:file-as=&quot;Marcotte, Ethan&quot;&gt;Ethan Marcotte&lt;/dc:creator&gt;
&lt;dc:contributor opf:file-as=&quot;Zeldman, Jeffrey&quot;
                opf:role=&quot;pbl&quot;&gt;Jeffrey Zeldman&lt;/dc:contributor&gt;
&lt;dc:contributor opf:file-as=&quot;Santa Maria, Jason&quot;
                opf:role=&quot;bkd&quot;&gt;Jason Santa Maria&lt;/dc:contributor&gt;
&lt;dc:contributor opf:file-as=&quot;Brown, Mandy&quot;
                opf:role=&quot;edt&quot;&gt;Mandy Brown&lt;/dc:contributor&gt;
&lt;dc:contributor opf:file-as=&quot;Cederholm, Dan&quot;
                opf:role=&quot;edt&quot;&gt;Dan Cederholm&lt;/dc:contributor&gt;
&lt;dc:contributor opf:file-as=&quot;Stevens, Krista&quot;
                opf:role=&quot;edt&quot;&gt;Krista Stevens&lt;/dc:contributor&gt;
&lt;dc:contributor opf:file-as=&quot;Egan, Neil&quot;
                opf:role=&quot;cmt&quot;&gt;Neil Egan&lt;/dc:contributor&gt;
&lt;dc:contributor opf:role=&quot;mrk&quot;&gt;Threepress Consulting Inc.&lt;/dc:contributor&gt;
</pre>
<p>As you can see, there are a lot of people credited in the metadata, and we’ve credited each one as a <a href="http://dublincore.org">Dublin Core</a> <code>contributor</code> with a reference to a <a href="http://id.loc.gov/vocabulary/relators.html">MARC Relator</a> code. Specifying these contributors using these external definitions (both of which have <em>huge</em> amounts of both consensus and uptake behind them) means that a lot of software can understand it mechanically (including software and people outside of the US or English-speaking world, with some limitations). However, consensus sometimes leaves us impoverished: in this case there are three people all labeled as <a href="http://id.loc.gov/vocabulary/relators/edt.html">Editor</a>, but the copyright page from the book itself shows us their true roles:</p>
<blockquote>
<p>Publisher: Jeffrey Zeldman<br />
Designer: Jason Santa Maria<br />
Editor: Mandy Brown<br />
Technical Editor: Dan Cederholm<br />
Copyeditor: Krista Stevens<br />
Compositor: Neil Egan</p>
</blockquote>
<p>With the ability in EPUB 3 to reference a different source for these editor definitions, we can actually differentiate Dan Cederholm’s role as Technical Editor and Krista Stevens’ as Copy Editor:</p>
<pre class="brush: xml;">
&lt;meta property=&quot;dcterms:contributor&quot;
      id=&quot;technicaleditor&quot;&gt;Dan Cederholm&lt;/meta&gt;
&lt;meta about=&quot;#technicaleditor&quot;
      property=&quot;file-as&quot;&gt;Cederholm, Dan&lt;/meta&gt;
&lt;meta about=&quot;#technicaleditor&quot;
      property=&quot;role&quot;
      id=&quot;technicaleditor-role&quot;&gt;technicaleditor&lt;/meta&gt;
&lt;meta about=&quot;#technicaleditor-role&quot;
      property=&quot;scheme&quot;
      datatype=&quot;xsd:anyURI&quot;&gt;http://www.docbook.org/xml/5.0/rng/docbook.rng&lt;/meta&gt;

&lt;meta property=&quot;dcterms:contributor&quot;
      id=&quot;copyeditor&quot;&gt;Krista Stevens&lt;/meta&gt;
&lt;meta about=&quot;#copyeditor&quot;
      property=&quot;file-as&quot;&gt;Stevens, Krista&lt;/meta&gt;
&lt;meta about=&quot;#copyeditor&quot;
      property=&quot;role&quot;
      id=&quot;copyeditor-role&quot;&gt;copyeditor&lt;/meta&gt;
&lt;meta about=&quot;#copyeditor-role&quot;
      property=&quot;scheme&quot;
      datatype=&quot;xsd:anyURI&quot;&gt;http://www.docbook.org/xml/5.0/rng/docbook.rng&lt;/meta&gt;
</pre>
<p>In the above example, we’ve described a few different things about these folks using the new EPUB 3 metadata syntax. First, we’ve referred to them as a <a href="http://dublincore.org/documents/dcmi-terms/#terms-contributor"><code>contributor</code></a>:</p>
<pre class="brush: xml;">
&lt;meta property=&quot;dcterms:contributor&quot;
      id=&quot;technicaleditor&quot;&gt;Dan Cederholm&lt;/meta&gt;
</pre>
<p>Next, we’ve specified how to sort their names with a <a href="http://idpf.org/epub/30/spec/epub30-publications.html#file-as"><code>file-as</code></a> property:</p>
<pre class="brush: xml;">
&lt;meta about=&quot;#technicaleditor&quot;
      property=&quot;file-as&quot;&gt;Cederholm, Dan&lt;/meta&gt;
</pre>
<p>Finally, we’ve accomplished our goal of saying that Dan Cederholm’s <a href="http://idpf.org/epub/30/spec/epub30-publications.html#role">contribution <code>role</code></a> was as a Technical Editor, as <a href="http://www.docbook.org/tdg5/en/html/othercredit.html#attributes">defined by DocBook 5.0</a>:</p>
<pre class="brush: xml;">
&lt;meta about=&quot;#technicaleditor&quot;
      property=&quot;role&quot;
      id=&quot;technicaleditor-role&quot;&gt;technicaleditor&lt;/meta&gt;
&lt;meta about=&quot;#technicaleditor-role&quot;
      property=&quot;scheme&quot;
      datatype=&quot;xsd:anyURI&quot;&gt;http://www.docbook.org/xml/5.0/rng/docbook.rng&lt;/meta&gt;
</pre>
<p>For some reason, <a href="http://www.docbook.org/tdg5/en/html/othercredit.html">Copy Editors and Technical Editors have long been defined</a> by <a href="http://docbook.org">DocBook</a>, but are omitted from the <a href="http://www.editeur.org/ONIX/book/codelists/current.html#codelist17">ONIX Contributor</a> codes, the <a href="http://id.loc.gov/vocabulary/relators.html">MARC Relator</a> codes, the PRISM codes, the <a href="http://www.daisy.org/z3986/2011/vocab/structure/">Z39.86-201x Structural Semantics Vocabulary</a> and every other metadata standard I could find.</p>
<hr />
<p><em>Note/Warning:</em> If you were going to make an EPUB 3 title today, you’d probably include both the “old” style EPUB metadata for these contributors <strong>AND</strong> the new EPUB 3 metadata (with the <code>prefer</code> attribute for each set). This would give you the benefit of both backward-compatibility with existing EPUB reading systems and better metadata for the future when EPUB 3 reading systems are more commonplace. Eventually you may just need the EPUB 3 version, and that’s the world I&#8217;m talking about here (partially as a small attempt to get us there faster).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/06/07/copy-editors-epub3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Can an author create an EPUB using normal tools? Part 2: Scrivener</title>
		<link>http://blog.threepress.org/2011/06/02/can-an-author-create-an-epub-using-normal-tools-part-2-scrivener/</link>
		<comments>http://blog.threepress.org/2011/06/02/can-an-author-create-an-epub-using-normal-tools-part-2-scrivener/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 15:59:41 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1966</guid>
		<description><![CDATA[This is part two of a series on using author-friendly word-processing tools with native EPUB export. Part 1 was about Apple Pages.
Part two: Scrivener
I first became aware of Scrivener&#8217;s support for EPUB export in November of 2010, when they released a special edition for NaNoWriMo (and the less said about my novel-writing experiment, the better). [...]]]></description>
			<content:encoded><![CDATA[<p>This is part two of a series on using author-friendly word-processing tools with native EPUB export. <a href="http://blog.threepress.org/2011/06/01/can-an-author-create-an-epub-file-using-normal-tools-part-1-pages/">Part 1 was about Apple Pages</a>.</p>
<h3>Part two: Scrivener</h3>
<p>I first became aware of Scrivener&#8217;s support for EPUB export in November of 2010, when they released a special edition for <a href="http://www.nanowrimo.org/">NaNoWriMo</a> (and the less said about my novel-writing experiment, the better). EPUB export is now available in the latest major release.</p>
<p>Though Scrivener is primarily a Mac application, there are <a href="http://www.literatureandlatte.com/scrivenerforwindows/">beta versions for Windows and Linux</a>. I have no idea if they support EPUB export &#8212;  please comment if you know either way!</p>
<h4>The sample document</h4>
<p>Scrivener&#8217;s interface can be intimidating if you have only worked with relatively straightforward word processors.  It&#8217;s less of a document editor than a book authoring platform (or the way I would look at it, it&#8217;s Visual Studio, not emacs).</p>
<p><a href="http://3press-blog.s3.amazonaws.com/scrivener-main-screen.png"><img src="http://3press-blog.s3.amazonaws.com/sm-scrivener-main-screen.png" alt="Screenshot of Scrivener main screen with numerous panels"/></a> </p>
<p>For this test I used the &#8220;Manuscript&#8221; style, which provides many of the utilities that an author of a novel-length book might want, rather than starting with an entirely blank document (analogous to using the EPUB sample document in Pages).  For one thing, the Manuscript layout already provides obvious support for structured blocks like chapters and parts.  In fact Scrivener segments documents even further into &#8220;scenes&#8221; which can be relocated easily through the document.  Programmers love structured content!</p>
<p>As in the previous post, I set up the sample document to include all of the obvious stylistic elements that I wanted to test. I didn&#8217;t attempt to exactly re-create the Pages sample as that would be soul-crushing.</p>
<p>Finding the EPUB export feature can be challenging; it&#8217;s actually listed as &#8220;Compile.&#8221;</p>
<h4>Export options</h4>
<p>No complaints here.  There are dozens of options for EPUB configuration from the menus.</p>
<p>EPUB-specific output options:</p>
<p><img src="http://3press-blog.s3.amazonaws.com/scrivener-1.png" alt="Scrivener panel" /></p>
<p>Select which content segments are included in the book, and in what order:</p>
<p><img src="http://3press-blog.s3.amazonaws.com/scrivener-2.png" alt="Scrivener panel" /></p>
<p>My favorite pane. Look at all that metadata!</p>
<p><img src="http://3press-blog.s3.amazonaws.com/scrivener-3.png" alt="Scrivener panel" /></p>
<h4>Output</h4>
<p>Scrivener&#8217;s output is variable in quality.  Some things are nice.  It&#8217;s valid, for one thing, and I was able to produce this valid output without any special handling &#8212; I didn&#8217;t change any of the menu items beyond adding the metadata, which indeed trickles down nicely into the OPF file:</p>
<pre class="brush: xml;">
       &lt;dc:title&gt;Creating an EPUB sample document&lt;/dc:title&gt;
        &lt;dc:identifier id=&quot;PrimaryID&quot;&gt;urn:uuid:A54DCD13-A6E0-4ACA-8B31-4E0EBA0624EF&lt;/dc:identifier&gt;
        &lt;dc:language&gt;en&lt;/dc:language&gt;
        &lt;dc:creator opf:role=&quot;aut&quot;&gt;Liza Daly&lt;/dc:creator&gt;
        &lt;dc:subject&gt;Non-fiction&lt;/dc:subject&gt;
        &lt;dc:description&gt;An EPUB test of Scrivener's output&lt;/dc:description&gt;
        &lt;dc:publisher&gt;Threepress Consulting Inc.&lt;/dc:publisher&gt;
        &lt;dc:rights&gt;http://creativecommons.org/licenses/by-sa/2.0/deed.en&lt;/dc:rights&gt;
        &lt;dc:date&gt;2011-05-29&lt;/dc:date&gt;
</pre>
<p>Whitespace is exported as significant. While this makes the web developer in me cringe (I&#8217;d rather see CSS margins used here), it&#8217;s acceptable, especially since whitespace <em>is</em> semantically relevant in fiction, as when used for scene breaks:</p>
<pre class="brush: xml;">
&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;Hello world!&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;I have lists and tables!&lt;/p&gt;
</pre>
<p>Unlike Pages, lists are generated as the correct list elements:</p>
<pre class="brush: xml;">
&lt;ol class=&quot;ol1&quot;&gt;
  &lt;li class=&quot;li3&quot;&gt;Numbered lists are numerous.&lt;/li&gt;
  &lt;li class=&quot;li3&quot;&gt;We often have more than one item.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul class=&quot;ul1&quot;&gt;
  &lt;li class=&quot;li3&quot;&gt;Make love&lt;/li&gt;
  &lt;li class=&quot;li3&quot;&gt;Not bullets&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Tables are fine, though I&#8217;d like for these tools to have a &#8220;table header&#8221; style that could ultimately map to <code>th</code> elements.  This is a little more readable than the Pages output.</p>
<pre class="brush: xml;">
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;t1&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign=&quot;top&quot; class=&quot;td1&quot;&gt;
        &lt;p class=&quot;p2&quot;&gt;Not sure how to make headers&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign=&quot;top&quot; class=&quot;td1&quot;&gt;
        &lt;p class=&quot;p2&quot;&gt;Without just using colors&lt;/p&gt;
      &lt;/td&gt;
      &lt;td valign=&quot;top&quot; class=&quot;td1&quot;&gt;
        &lt;p class=&quot;p2&quot;&gt;Not semantic&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
</pre>
<p>Headers are curiously not optimal:</p>
<pre class="brush: xml;">
&lt;h2 style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 138% Optima&quot;&gt;&lt;b&gt;First, a header.&lt;/b&gt;&lt;/h2&gt;
&lt;h3 style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 92% Optima&quot;&gt;&lt;b&gt;A subheader.&lt;/b&gt;&lt;/h3&gt;
</pre>
<p>Why the inline margins and font? Why the <code>b</code>?  And like Pages, no apparent way to generate <code>strong</code> and <code>em</code>:</p>
<pre class="brush: xml;">
&lt;p class=&quot;p2&quot;&gt;Back to body text. But with &lt;b&gt;strong&lt;/b&gt; and &lt;i&gt;emphasis&lt;/i&gt;?&lt;/p&gt;
</pre>
<p>Drag-and-drop images and internal and external hyperlinking all worked well:</p>
<pre class="brush: xml;">
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;img src=&quot;images/droppedImage.png&quot; width=&quot;272&quot; alt=&quot;Image&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Hello dog.&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p4&quot;&gt;Inline URL: &lt;a href=&quot;http://www.flickr.com/photos/beinecke_library/5166412915/in/set-72157625240109163/&quot;&gt;http://www.flickr.com/photos/beinecke_library/5166412915/in/set-72157625240109163/&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;p4&quot;&gt;A hyperlink to &lt;a href=&quot;body1.xhtml&quot;&gt;Chapter One.&lt;/a&gt; A hyperlink to &lt;a href=&quot;http://placekitten.com&quot;&gt;a website&lt;/a&gt;.&lt;/p&gt;
</pre>
<p>I pulled the image out of the Pages EPUB output &#8211; Pages renamed it to <code>droppedImage.png</code>, and Scrivener retained the filename, which is a nice touch.</p>
<h4>Room for improvement</h4>
<ul>
<li>Scrivener seems to generate <em><span style="text-decoration: line-through">one CSS file for each XHTML file</span> too many CSS files by default</em>. Uncool!  This could potentially generate huge unwieldy EPUB books.  There&#8217;s no reason to have more than one CSS file in an automatically-converted document, and the styles should be normalized across XHTML files.
</li>
<li> Like Pages, there was no obvious way to add <code>alt</code> text values to images.</li>
<li>Also like Pages, I&#8217;d like to be able to customize the elements and class names in the outputted XHTML using simple menus.</li>
</ul>
<p>A pleasant surprise to me was that Scrivener has a lot of options for power-users under the hood, including integration with version control tools like Subversion, use of a text-based markup format for better serialization to other formats, or low-level customization of the CSS or even XSLT: <a href="http://www.literatureandlatte.com/wiki/doku.php?id=mac:faq:advanced_topics">Scrivener advanced topics</a>.  This means it&#8217;s potentially a better choice for an ambitious digital-only publisher; you can start with the basic WYSIWYG layer, and gradually customize the output by diving into the lower level.  This will be especially true once Scrivener is fully cross-platform.</p>
<p>Recommended with reservations (but mainly because of the CSS file issue).</p>
<p><a href="http://3press-blog.s3.amazonaws.com/epub-sample-scrivener.epub">Download the sample EPUB file</a> and <a href="http://3press-blog.s3.amazonaws.com/epub-sample-scriv.zip">Scrivener file (unzip first)</a>.  (Released under a <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution</a> license)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/06/02/can-an-author-create-an-epub-using-normal-tools-part-2-scrivener/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Can an author create an EPUB file using normal tools? Part 1: Pages</title>
		<link>http://blog.threepress.org/2011/06/01/can-an-author-create-an-epub-file-using-normal-tools-part-1-pages/</link>
		<comments>http://blog.threepress.org/2011/06/01/can-an-author-create-an-epub-file-using-normal-tools-part-1-pages/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 14:00:40 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1960</guid>
		<description><![CDATA[Yes, but it may require a Mac.
The IDPF board met on the last day of the Digital Book 2011 conference at Book Expo America. One of our topics for discussion was what the IDPF as an organization should do to further the adoption of  EPUB. I brought up an issue that&#8217;s been concerning me [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, but it may require a Mac.</p>
<p>The IDPF board met on the last day of the <a href="http://idpf.org/digitalbook2011">Digital Book 2011</a> conference at Book Expo America. One of our topics for discussion was what the IDPF as an organization should do to further the adoption of  EPUB. I brought up an issue that&#8217;s been concerning me for some time: the lack of digital-native authoring tools aimed at <em>authors</em>, not publishers.</p>
<p>If publishers are struggling to produce high-quality EPUB files either via InDesign, XML workflows, or strategic outsourcing, authors are in an even worse place. This is especially true for authors with an ambition to self-publish, or to start a micro-publishing outfit, and yet still retain some creative control over the look of their digital product. InDesign (especially CS5.5) is a great solution for small- to medium-sized publishers who produce both print and digital books, but its feature set is inappropriate for digital-native publishing, and its price and complexity are unsuited for self-publishers.</p>
<p>I&#8217;m aware of two document creation tools right now that have <em>native</em> EPUB support and are available for my platform, Mac OS X: <a href="http://www.apple.com/iwork/pages/">Pages</a>, and <a href="http://www.literatureandlatte.com/scrivener.php">Scrivener</a>. (The only product I know of on the Windows side is <a href="http://www.atlantiswordprocessor.com/en/">Atlantis</a>. Linux users have to make do with plugins for <a href="http://openoffice.org/">OpenOffice</a> &#8212; judging from the comments in the <a href="http://openoffice.org/bugzilla/show_bug.cgi?id=104604">issue tracker</a>, EPUB export is not a priority, to say the least.)</p>
<p>This post will cover Apple Pages.  A subsequent post covers <a href="http://blog.threepress.org/2011/06/02/can-an-author-create-an-epub-using-normal-tools-part-2-scrivener/">outputting EPUB with Scrivener</a>.</p>
<h2>Pages</h2>
<p>Apple&#8217;s Pages was the first major commercial word processor to <a href="http://support.apple.com/kb/ht4168">include EPUB export</a>. I <a href="http://blog.threepress.org/2010/08/26/test-driving-apple-pages-with-epub-export/">reviewed the initial EPUB support</a> in August 2010, but it&#8217;s been through some updates since then, and I wanted to dive into the semantics of the outputted code more closely.</p>
<p><a href="http://3press-blog.s3.amazonaws.com/pages-screen.png"><img src="http://3press-blog.s3.amazonaws.com/sm-pages-screen.png" alt="Screenshot of a sample EPUB file in Apple Pages" /></a></p>
<h3>The sample document</h3>
<p>I started with the <a href="http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip">Apple-provided EPUB template</a> (more on that later) and added a number of new elements and semantic tests.  In particular, I added:</p>
<ul>
<li> Chapters and headings</li>
<li> Emphasis and strong text (rendered in Pages as italics and bold)</li>
<li> Numbered and unnumbered lists</li>
<li> Hyperlinks both internal to the document and external to the web</li>
<li> Inline images (by dragging and dropping)</li>
<li> A cover page with an image</li>
<li> All available metadata in the export pane</li>
<li> Tables</li>
</ul>
<p>In all cases, I used only styles available in the style drawer; I did not change any font sizes or font weight via the toolbar buttons.</p>
<h3>The EPUB output</h3>
<p>As in my previous test, this produced a valid EPUB 2.0.1 document according to EPUBCheck 1.1.  Hooray!</p>
<h4>Headers and subheaders</h4>
<p>The semantics are much-improved from my first test.  Paragraphs are now wrapped in <code>&lt;p&gt;</code> elements, for example, and headers are headers:</p>
<pre class="brush: xml;">
  &lt;body&gt;
    &lt;div class=&quot;body&quot; style=&quot;white-space:pre-wrap&quot;&gt;
      &lt;h3&gt;Chapter Two: The Chaptering&lt;/h3&gt;
      &lt;p class=&quot;s2&quot;&gt;This chapter has an introduction. Hello!&lt;/p&gt;
      &lt;h4&gt;I’m a subchapter or section under that. &lt;/h4&gt;
      &lt;p class=&quot;s2&quot;&gt;Don’t hold it against me. I just have a lot of things to say.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;</pre>
<p>However, the <code>white-space:pre-wrap</code> style is curious: the property is meant to specify that whitespace inside the XHTML is significant, meaning that the ereader/web browser should retain it.  That is emphatically not a best practice in general text; on the other hand, there was no whitespace in the output at all, so I&#8217;m unsure of its purpose.  If I were post-processing this EPUB file, I would remove that style.</p>
<p>I used the &#8220;Chapter&#8221; style to generate the chapter heading.  This header should be an <code>h1</code> rather than an <code>h3</code>, but at least the subheading is also a header and one step down.</p>
<h4>Go boldly</h4>
<p>I completely failed to find a way to output <code>strong</code> and <code>em</code> rather than <code>b</code> or <code>i</code>.</p>
<h4>Listless</h4>
<p>I used the list styles provided in the template, but these are not the lists you&#8217;re looking for:</p>
<pre class="brush: xml;">
      &lt;h3&gt;Chapter Three: Lists&lt;/h3&gt;
      &lt;p class=&quot;s2&quot;&gt;Reasons why people love lists, in order.&lt;/p&gt;
      &lt;p class=&quot;s2 s3&quot;&gt;&lt;span class=&quot;c2&quot;&gt;1.&lt;/span&gt;Lists are neat.&lt;/p&gt;
      &lt;p class=&quot;s2 s3&quot;&gt;&lt;span class=&quot;c2&quot;&gt;2.&lt;/span&gt;It’s cool to let the computer fill in numbering.&lt;/p&gt;
      &lt;p class=&quot;s2 s3&quot;&gt;&lt;span class=&quot;c2&quot;&gt;3.&lt;/span&gt;Yessir.&lt;/p&gt;
      &lt;p class=&quot;s2&quot;&gt;Other reasons that people like lists, in no particular order:&lt;/p&gt;
      &lt;p class=&quot;s2 s4&quot;&gt;&lt;span class=&quot;c3&quot;&gt;•&lt;/span&gt;Sometimes they have bullets&lt;/p&gt;
      &lt;p class=&quot;s2 s4&quot;&gt;&lt;span class=&quot;c3&quot;&gt;•&lt;/span&gt;Not real bullets.&lt;/p&gt;
      &lt;p class=&quot;s2 s4&quot;&gt;&lt;span class=&quot;c3&quot;&gt;•&lt;/span&gt;Those are scary.&lt;/p&gt;
</pre>
<p>This must be fixed.</p>
<h4>Tables</h4>
<p>A little verbose markup-wise, but basically fine:</p>
<pre class="brush: xml;">
      &lt;table class=&quot;s5&quot; style=&quot;margin-left:0.0px;width:99.8%;border-collapse:collapse&quot;&gt;
        &lt;col style=&quot;width:33.3%&quot;/&gt;
        &lt;col style=&quot;width:33.3%&quot;/&gt;
        &lt;col style=&quot;width:33.3%&quot;/&gt;
        &lt;tr style=&quot;height:25.0%&quot;&gt;
          &lt;td class=&quot;s8 s6 s7&quot;&gt;
            &lt;h2 class=&quot;s9&quot;&gt;Reasons why tables are nice&lt;/h2&gt;
          &lt;/td&gt;
          &lt;td class=&quot;s8 s6 s7&quot;&gt;
            &lt;h2 class=&quot;s9&quot;&gt;Who feels this way&lt;/h2&gt;
          &lt;/td&gt;
          &lt;td class=&quot;s8 s6 s7&quot;&gt;
            &lt;h2 class=&quot;s9&quot;&gt;I can’t think of a third thing.&lt;/h2&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
        ....
</pre>
<h4>Images, covers, and links</h4>
<p>Creating an image is as easy as dragging it in.  I&#8217;m not sure if it&#8217;s possible to add <code>alt</code> text to the image &#8212; I believe document creation tools should prompt users to add descriptive text by default. </p>
<p><a href="http://3press-blog.s3.amazonaws.com/ipad-rendered-pages-test.png"><img src="http://3press-blog.s3.amazonaws.com/sm-ipad-rendered-pages-test.png" alt="Page of sample ebook in iBooks showing an image of a dog" /></a></p>
<pre class="brush: xml;">
      &lt;p class=&quot;s2&quot;&gt;
        &lt;img src=&quot;images/droppedImage.png&quot; alt=&quot;droppedImage.png&quot; style=&quot;&quot;/&gt;
      &lt;/p&gt;
</pre>
<p>Only images styled as &#8220;inline&#8221; will be exported; Pages will warn you that the image was discarded if it had a floating or fixed style. I tried to select a page with an inline image as the cover page but Pages gave me a warning that it was being discarded. Then it actually shows up in iBooks anyway. </p>
<p>It would be nice if the original filename were preserved (it was not &#8220;droppedImage.png&#8221;), and the empty <code>style</code> attribute should be discarded on output.</p>
<pre class="brush: xml;">
      &lt;h1&gt;&lt;span id=&quot;chapter-5-sh1&quot;/&gt;Chapter Five: Hyperlinks&lt;/h1&gt;
      &lt;p class=&quot;s2&quot;&gt;This is an internal link to &lt;a href=&quot;chapter-1.xhtml#b1&quot;&gt;&lt;span class=&quot;c1&quot;&gt;chapter one&lt;/span&gt;&lt;/a&gt;. This is an external link to &lt;a href=&quot;http://placekitten.com/&quot;&gt;&lt;span class=&quot;c1&quot;&gt;photos of kittens&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
</pre>
<p>The empty <code>span</code> here is for the purpose of creating a back-link.  A similar one was auto-added to Chapter One. Adding an internal hyperlink requires an initial step of creating a Pages &#8220;bookmark&#8221;, and then linking to that bookmark, which was a little confusing; I should be able to target any point in the document using the hyperlink feature.</p>
<p>I didn&#8217;t test HTML5 video output, but I&#8217;ve been told that video <em>can</em> be successfully embedded and output such that the video will work in iBooks (it will use HTML5 tagging).</p>
<h4>Metadata</h4>
<p>Both the OPF and the NCX were perfectly well-formed.  The EPUB export dialog should optionally request richer metadata than the current list of author/title/subject, though.</p>
<h4>The dreaded sample document</h4>
<p>The EPUB export function is next to useless on large documents unless you start with the <a href="http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip">sample template</a>, or import its styles later and tediously update yours to match. The EPUB styles are completely opaque &#8212; I have no idea why they have magical properties, or what I would do to my own styles to emulate them. <span style="text-decoration: line-through">Since the Pages native file format is binary, there&#8217;s nothing for me to inspect to reverse-engineer the styling</span>. The Pages file format is zipped XML, so it may be possible to inspect it directly &#8212; thanks Steve!</p>
<p><em>The native header/paragraph/list styles in the blank template should output useful semantics in the XHTML.</em> It is unacceptable to force users to import an external document to produce a half-decent EPUB file.  At the very least, an EPUB-friendly template should be one of the default choices available when creating a new document. </p>
<h4>Improvements</h4>
<ul>
<li>The list styles should generate lists. They should be ordered or unordered as appropriate to the style.</li>
<li>EPUBs should be importable as well as exportable. It&#8217;s understandable that they won&#8217;t magically re-constitute into the original Pages document, but a conversion pipeline is entirely reasonable.</li>
<li>It should be possible to export chunked EPUBS (with multiple XHTML chapters) <em>without</em> having to use the sample template.</li>
<li>It should be possible for a power user to understand how to create styles that will have specific behaviors.</li>
<li>It should be possible to customize the XHTML serialization (&#8220;I want the style named &#8217;strong&#8217; to output <code>strong</code> elements with the classname &#8216;foo&#8217;&#8221;).</li>
<li>There should be much more metadata allowable in the OPF file.</li>
<li>Images should require or at least prompt for <code>alt</code> attribute values.</li>
<li>Bold and italic buttons should output <code>strong</code> and <code>em</code> with the appropriate CSS styling in all cases. I would say this is actually true of any EPUB output tools &#8212; it&#8217;s unreasonable to ask users to create named styles (as in InDesign) when those tempting bold and italic buttons are available. </li>
</ul>
<p>I don&#8217;t expect Windows/Linux versions of Pages to ever exist, which means that Pages will remain a marginal tool in the publishing ecosystem, but it&#8217;s perfectly adequate for an individual Mac-only user.</p>
<p><a href="http://3press-blog.s3.amazonaws.com/epub-sample-from-pages.epub">Download the sample EPUB file</a> and <a href="http://3press-blog.s3.amazonaws.com/epub-sample.pages">sample Pages document</a>,  (released under a <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution</a> license).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/06/01/can-an-author-create-an-epub-file-using-normal-tools-part-1-pages/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Subtitles in EPUB 3</title>
		<link>http://blog.threepress.org/2011/05/31/subtitles-in-epub-3/</link>
		<comments>http://blog.threepress.org/2011/05/31/subtitles-in-epub-3/#comments</comments>
		<pubDate>Tue, 31 May 2011 13:15:57 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[epub3]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1943</guid>
		<description><![CDATA[
Update: I should have been clearer that the “bare” use of subtitle without referencing a scheme is really suboptimal. Using already-defined properties/definitions and referencing them explicitly (like the ONIX codelist example below) is a much better technique, but I did not come up with a compelling property for subtitle, hence the call for better options. [...]]]></description>
			<content:encoded><![CDATA[<div style="margin: 2em; padding: 1em">
<em>Update</em>: I should have been clearer that the “bare” use of <code>subtitle</code> without referencing a <code>scheme</code> is really suboptimal. Using already-defined properties/definitions and referencing them explicitly (like the ONIX codelist example below) is a much better technique, but I did not come up with a compelling property for subtitle, hence the call for better options. See the <a href="#comments">comments</a> below for a good discussion of those options. </p>
<p>There&#8217;s also a <a href="http://www.fatcow.com/edu/subtitles-epu-bl/">Bulgarian translation</a>.
</div>
<p>In a <a href="http://blog.threepress.org/2011/05/26/covers-in-epub3/comment-page-1/#comment-8927">previous post</a>, <a href="http://bristolebooks.co.uk/">Thomas Rasche</a> asked:</p>
<blockquote><p>How are book subtitles best dealt with in Epub3? They could be included with a meta data property, but is there a recommended way so that a reader recognizes them, to display them sensibly (eg subtitles display in smaller font under the main title etc)?</p></blockquote>
<p>EPUB 3’s metadata model is powerful and flexible. It is a big improvement over the limited metadata permissible in EPUB, but there are three real costs associated with EPUB 3’s metadata:</p>
<ol>
<li>Because of backward compatibility with EPUB, metadata in EPUB 3 duplicates at least three required metadata elements in both an old and new style: <code>title</code>, <code>identifier</code>, and <code>language</code> (probaby <code>creator</code> too).</li>
<li>Greater flexibility in metadata schemas means that EPUB 3 metadata sometimes seems quite verbose (but you’re generating your OPF using software with robust metadata stores anyway, so this isn’t much of a complaint, right?).</li>
<li>Different metadata schemas describe the same thing with different words, so there are often many ways to accomplish the same thing and we don’t yet know what the convention will be.</li>
</ol>
<p>That last issue of choosing a schema is the central issue in our subtitle problem. <a href="http://idpf.org/epub/30/spec/epub30-publications.html#sec-meta">The EPUB Publications 3.0 specification</a> provides a number of examples on how to include specific metadata but doesn&#8217;t <em>exactly</em> prescribe how a subtitle should be included. Instead, we’ll include two titles in a row, declare one as the subtitle, and indicate a display order.</p>
<p><a href="http://openlibrary.org/works/OL3246385W/Dreams_from_my_father"><img alt="Cover of Dreams from My Father: A Story of Race and Inheritance" src="http://covers.openlibrary.org/w/id/747173-M.jpg" /></a></p>
<p>Here’s the markup, using <a href="http://openlibrary.org/works/OL3246385W/Dreams_from_my_father">Dreams from My Father: A Story of Race and Inheritance</a> as the example:</p>
<pre>
&lt;metadata xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;
  &lt;dc:title id="title" prefer="dcterms-title"&gt;Dreams from My Father&lt;/dc:title&gt;
  &lt;meta property="dcterms:title" id="dcterms-title"&gt;Dreams from My Father&lt;/meta&gt;
  &lt;meta about="#dcterms-title" property="display-seq"&gt;1&lt;/meta&gt;

  &lt;dc:title id="subtitle" prefer="dcterms-subtitle"&gt;A Story of Race and Inheritance&lt;/dc:title&gt;
  &lt;meta property="dcterms:title" id="dcterms-subtitle"&gt;A Story of Race and Inheritance&lt;/meta&gt;
  &lt;meta about="#dcterms-subtitle" property="title-type"&gt;subtitle&lt;/meta&gt;
  &lt;meta about="#dcterms-subtitle" property="display-seq"&gt;2&lt;/meta&gt;
  …
</pre>
<h3>What’s going on here?</h3>
<p>In this markup, we do a range of things. We state both the title and subtitle using the legacy EPUB markup for backward compatibility and we do it in order, which is important for EPUB, but we also tell EPUB 3 reading systems to use the new syntax with the <code>prefer</code> attribute:</p>
<pre>
  &lt;dc:title id="title"
            <strong>prefer="dcterms-title"</strong>&gt;Dreams from My Father&lt;/dc:title&gt;
  …
  &lt;dc:title id="subtitle"
            <strong>prefer="dcterms-subtitle"</strong>&gt;A Story of Race and Inheritance&lt;/dc:title&gt;
</pre>
<p>We also include the titles using the new markup for EPUB 3:</p>
<pre>
  &lt;meta property="dcterms:title"
        id="dcterms-title"&gt;Dreams from My Father&lt;/meta&gt;
  …
  &lt;meta property="dcterms:title"
        id="dcterms-subtitle"&gt;A Story of Race and Inheritance&lt;/meta&gt;
</pre>
<p>Next we specify that the subtitle, is, in fact, a <a href="http://idpf.org/epub/30/spec/epub30-publications.html#title-type"><code>title-type</code></a> <code>subtitle</code>. We do this by adding another <code>meta</code> element that refers to the subtitle with the <code>about</code> attribute:</p>
<pre>
  &lt;meta about="#dcterms-subtitle"
        <strong>property="title-type"</strong>&gt;subtitle&lt;/meta&gt;
</pre>
<p>Finally, we specify the display order of the two titles with <code>meta</code> elements and <a href="http://idpf.org/epub/30/spec/epub30-publications.html#display-seq"><code>display-seq</code></a></p>
<pre>
  &lt;meta about="#dcterms-title"
        <strong>property="display-seq"</strong>&gt;1&lt;/meta&gt;
  …
  &lt;meta about="#dcterms-subtitle"
        <strong>property="display-seq"&gt;2&lt;/meta&gt;
</strong></pre>
<h3>Other options</h3>
<p>EPUB 3 is new enough that we don’t know which practices will become adopted by content creators and reading systems (so we don’t know about a smaller font, like the original question). The subtitle markup suggested above is a decent approach, but other options might be using <a href="http://open.vocab.org/terms/subtitle">http://open.vocab.org/terms/subtitle</a> (not widely used in publishing today) or ONIX’s <code>&lt;Subtitle&gt;</code> element (very hard to reference cleanly).</p>
<p>If you’ve got a better suggestion for the markup above please leave a comment and I’ll update the post if a winner emerges.</p>
<h3>Colons don’t make subtitles</h3>
<p>While it may seem tempting to split title and subtitle on a <code>:</code>, don&#8217;t, ever: <a href="http://oreilly.com/catalog/9780596522346/">slide:ology</a>.</p>
<hr />
<p>If there are specific EPUB 3 questions you have that you’d like to see us write about, please leave a note in the comments—Thanks!</p>
<hr />
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">Subtitles in EPUB 3</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://blog.threepress.org/2011/05/31/subtitles-in-epub-3/" property="cc:attributionName" rel="cc:attributionURL">Keith Fahlgren</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">Creative Commons Attribution-NonCommercial 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/05/31/subtitles-in-epub-3/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Covers in EPUB 3</title>
		<link>http://blog.threepress.org/2011/05/26/covers-in-epub3/</link>
		<comments>http://blog.threepress.org/2011/05/26/covers-in-epub3/#comments</comments>
		<pubDate>Thu, 26 May 2011 13:36:31 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[epub]]></category>
		<category><![CDATA[epub3]]></category>
		<category><![CDATA[idpf]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1920</guid>
		<description><![CDATA[Now that EPUB 3 is an IDPF <a href="http://idpf.org/epub3_proposed_spec_released">Proposed Specification</a> it seems like a good time to update some of our EPUB blog posts. One of the most popular was <a href="http://blog.threepress.org/2009/11/20/best-practices-in-epub-cover-images/">Best practices in ePub cover images</a>, which helped clarify how to include a cover image for most ebook readers. While cover image markup wasn’t specified in EPUB, I’m happy to report that EPUB 3 clearly explains how to include a dedicated cover image.]]></description>
			<content:encoded><![CDATA[<p>Now that EPUB 3 is an IDPF <a href="http://idpf.org/epub3_proposed_spec_released">Proposed Specification</a> it seems like a good time to update some of our EPUB blog posts. One of the most popular was <a href="http://blog.threepress.org/2009/11/20/best-practices-in-epub-cover-images/">Best practices in ePub cover images</a>, which helped clarify how to include a cover image for most ebook readers. While cover image markup wasn’t specified in EPUB, I’m happy to report that EPUB 3 clearly explains how to include a dedicated cover image.</p>
<p><em>Note</em>: If you’re new to the EPUB 3 specifications, the best place to get a clear introduction to the four parts of the specification is the <a href="http://idpf.org/epub/30/spec/epub30-overview.html">EPUB 3 Overview</a>. Marking a specific image is a <em>metadata</em> problem at the publication level, so we’ll be referring to the <a href="http://idpf.org/epub/30/spec/epub30-publications.html">EPUB Publications 3.0</a> specification. As expected, it includes “Publication metadata — mechanisms for including and/or referencing metadata applicable to the entire Publication and particular resources within it.”</p>
<p>Without further delay, here is the markup to mark an image as the cover in EPUB 3:</p>
<pre>
&lt;item id="img24"
      <strong>properties="cover-image"</strong>
      href="the_cover.jpg"
      media-type="image/jpeg"/&gt;
</pre>
<p>The new <code>properties</code> attribute is added to an otherwise “normal” OPF <code>item</code> and is all that’s required to mark an image as the cover. While including a cover image is still optional in EPUB 3, you may only mark one image as the cover.</p>
<p>Most of the metadata improvements in EPUB 3 are based on this <a href="http://idpf.org/epub/30/spec/epub30-publications.html#sec-package-metadata-properties"><code>properties</code> attribute</a>. Its uses range from noting that content includes MathML or JavaScript to indicating the type of publication. </p>
<hr />
<p>If there are specific EPUB 3 topics you’d like to see us write about, please leave a note in the comments—Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/05/26/covers-in-epub3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using Ibis Reader and Apple&#8217;s VoiceOver</title>
		<link>http://blog.threepress.org/2011/03/11/using-ibis-reader-and-voiceover/</link>
		<comments>http://blog.threepress.org/2011/03/11/using-ibis-reader-and-voiceover/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 15:30:54 +0000</pubDate>
		<dc:creator>Keith Fahlgren</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ibisreader]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1871</guid>
		<description><![CDATA[Liza and I have long been interested in making ebooks more accessibile. Both Bookworm and Ibis Reader reflect that goal (with limited success—accessibility can almost always be improved). However, our focus has always been on improving the web version of Ibis Reader rather than the installable HTML5 App that many people use on their iPhones, [...]]]></description>
			<content:encoded><![CDATA[<p>Liza and I have long been interested in making ebooks more accessibile. Both <a href="http://code.google.com/p/threepress/source/browse/#svn%2Ftrunk%2Fbookworm">Bookworm</a> and <a href="http://ibisreader.com">Ibis Reader</a> reflect that goal (with limited success—accessibility can almost always be improved). However, our focus has always been on improving the web version of Ibis Reader rather than the installable HTML5 App that many people use on their iPhones, iPads, and (increasingly) Android devices. Some of our users wanted to try out the installable App, which has the benefit of working offline, using Apple&#8217;s VoiceOver on their iOS device. Happily, a recent performance update (switching to columns-based layout) means that Ibis Reader is much more usable in VoiceOver, so I wanted to document how to use the two systems together. </p>
<p>Note: Many users may still prefer ebook applications that offer a more straightforward interface to VoiceOver than what I&#8217;ve described—I&#8217;m just happy we have a starting point from which to improve.</p>
<p>[<em id="update">Update</em>: The reading mode has just been updated to have more useful “Next” and “Previous” links, as I describe in <a href="#reading">Reading</a>, below.]</p>
<p>As a sighted user, I’d love to get feedback on how to make these instructions clearer and how we can improve the accessibility of Ibis Reader.</p>
<h3>VoiceOver and iOS</h3>
<p>Apple’s VoiceOver screen reader is available on both the Mac and on iOS devices. There&#8217;s a good <a href="http://www.apple.com/accessibility/iphone/vision.html">web overview</a> and a much longer Accessibility section in the <a href="http://manuals.info.apple.com/en_US/iPhone_iOS4_User_Guide.pdf">iPhone User Guide [PDF]</a>. </p>
<p>You&#8217;ll need to turn on and get used to the VoiceOver gestures before trying the steps below.</p>
<h3>Installation</h3>
<p>Start the installation process by opening the Mobile Safari browser as usual. Next, visit the URL <a href="http://m.ibisreader.com">m.ibisreader.com</a>, where you&#8217;ll immediately be prompted to “Increase Database Size?”. Select the “Increase” button (on the right) to give Ibis Reader some space for storing ebooks on your device. Next, you’ll install it.</p>
<p>“Installing” an HTML5 App like Ibis Reader is mostly just getting it onto your Home Screen:</p>
<ol>
<li>Select the “Utilities” (VoiceOver&#8217;s name for it) button from the center of the bottom row of buttons. It used to be a plus symbol in previous iOS releases and is now a box with an arrow to the right.</li>
<li>Select the second button in the Utilities menu, “Add to Home Screen”. This will give you an “Add to Home” form with an Ibis Reader icon (just like any other App from the App Store) and an editable name (the default is “Ibis Reader”, unsurprisingly).</li>
<li>Finally, select the “Add” button from the top right (it’s one left-swipe “before” the editable name, where the focus starts).</li>
</ol>
<p><a href="http://3press-blog.s3.amazonaws.com/voiceover_ibis_add_to_home.png"><img style="border: 1px solid black" src="http://3press-blog.s3.amazonaws.com/sm-voiceover_ibis_add_to_home.png" alt="VoiceOver selection of the Utilities menu button for the m.ibisreader.com install page" /></a></p>
<p>You’ve now got an Ibis Reader icon on whatever page of Apps iOS fancifully decides to place it. Discover and open it in the usual way.</p>
<p>When it opens for the very first time ever, Ibis Reader has a brief introduction screen that pops up. You’ll need to follow the “Start Reading” link, which is the third or fourth item on the page. After that you’ll be sent to the “Get Books” section, which I describe below in Finding Books, but I’d actually sign in or register first.</p>
<p>When we first launched Ibis Reader, we were focused on making it as straightforward as possible to get started reading with a minimum of hoops to jump through. That means that we let people browse for new books before logging in and made the login and register screens exactly the same (they’re both tiny, with just an email and password field). However, if you&#8217;re just starting with the App, go ahead and follow the “Sign in” link first (it’s the link in the top right corner of the screen or the third item from the top of the screen). Fill out the fields as normal and you’ll be sent to the My Books section (which will be empty).</p>
<h3>Basic Interaction</h3>
<p>Ibis Reader is, at its heart, a <em>web</em> application. That means that you should be able to use most of the VoiceOver gestures and navigation techniques you’ve learned from browsing the web in Mobile Safari inside the Ibis Reader App. <strike>However, there are few parts of the Ibis Reader interface that are based on “touch” events rather than HTML links, so you’ll need to get used to the double-tap+hold gesture (accompanied by a rising series of three tones), which switches you between VoiceOver’s gesture mode and the “native” one.</strike> [<em>Update</em>: We’ve improved the UI to make these “touch” events unnecessary for VoiceOver users.]</p>
<p>For much of the App, we have a header bar with three relatively big buttons showing the navigation choices. On an iPhone-sized screen, these take up roughly one third of the screen each, but on an iPad two are huddled together on the left with the third on the right. The navigation choices are:</p>
<ul>
<li><em>My Books</em>, <em>Get Books</em>, or <em>Sign out</em> (or in): this is the Home of the App, where you browse your library, find new titles, and where you go if you select “Home” (surprise!) from another part of the interface</li>
<li><em>Close</em>, <em>Read This Book</em>: these are the options when you’re looking for new books</li>
<li><em>Home</em>, <em>Book Info</em>, or <em>Settings</em>: this is the Reading Info section of the app, which shows your options while reading a book (this typically won’t be used by VoiceOver users)</li>
<li><em>Back</em> (top left corner): this is how you return from the Book Info screen to the book text</li>
</ul>
<p>If you’ve started reading a book, Ibis Reader will remember where you left off and open right to that page when you start the App the next time. Unfortunately, because VoiceOver users won’t need to “turn” any pages, you’ll start back at the beginning of the section each time. I&#8217;m not sure what the best workaround is for this.</p>
<h3>Finding Books</h3>
<p><a href="http://3press-blog.s3.amazonaws.com/voiceover_get_books.png"><img style="border: 1px solid black" src="http://3press-blog.s3.amazonaws.com/sm-voiceover_get_books.png" alt="VoiceOver selection of the first item in the Get Books list, Feedbooks: Popular Public Domain" /></a></p>
<p>In the “Home” section of the App, the second item on the page is “Get Books” (roughly in the middle of the top), where you can browse popular Public Domain and Original content from <a href="http://feedbooks.com">Feedbooks</a>. If you haven&#8217;t used Ibis Reader before, browse or search the titles in “Feedbooks: Popular Public Domain” (the first item on the list on the page) to find something interesting. VoiceOver will read you the title and author of each book. When you’ve found one you want, select the one you want (it&#8217;ll probably repeat “[the title], link”. If you have VoiceOver read from the top of the page, it will give you the books details and a description (if present). To download the book and start reading it, select either “Read This Book” link (there&#8217;s one before and after the description). After selecting it, be prepared to wait until it has downloaded an loaded (might be a while depending on your connection. VoiceOver should read the first page when it&#8217;s ready (maybe “Cover image” or similar). Now on to the description of Reading.</p>
<p>If you’ve already used the (more accessibile) web version of Ibis Reader at <a href="http://ibisreader.com">ibisreader.com</a>, you’ll have titles in your library in the cloud that you can download to your device by following the “Browse your Online Bookshelf” link (about the fourth element on the page) from the My Books section. Navigating your uploaded books is exactly the same as navigating the Feedbooks content (they&#8217;re both delivered as <a href="http://code.google.com/p/openpub/">OPDS Catalogs</a> under the hood.)</p>
<h3 id="reading">Reading</h3>
<p>The experience of reading works great in Ibis Reader. The normal “Two-finger flick up: Read all from the top of the screen.” gesture works well and will read a whole section of text without having to turn the page (although others looking at your screen may be confused). <strike>Unfortunately, switching between sections of the text isn’t as accessible as it could be, as it relies on both a very good TOC from the publisher inside the EPUB itself and some “native” tap gestures.</strike> [<em>Update</em>: Switching between sections is easy too: just choose one of the “Next” or “Previous” links from the very top or bottom of a section (these links are only visible to screen readers). Remember: You can use a “four-finger tap at top of screen” to select the first item on the page, like the “Previous” button, or a “four-finger tap at bottom of screen” to select the last item on the page, like the “Next” button. Note: For existing titles, you may have to delete the book from your device and re-download it from the “My Online Bookshelf” link to get these buttons.]</p>
<p><a href="http://3press-blog.s3.amazonaws.com/voiceover_reading.png"><img style="border: 1px solid black" src="http://3press-blog.s3.amazonaws.com/sm-voiceover_reading.png" alt="VoiceOver reading the first page of a section of content in the Reading mode of Ibis Reader from top to bottom" /></a></p>
<p>To get out of the Reading mode and back to the My Books section, select the “Home” link between the “Next” and “Previous” buttons.</p>
<h3>My Books</h3>
<p><a href="http://3press-blog.s3.amazonaws.com/voiceover_my_books.png"><img style="border: 1px solid black" src="http://3press-blog.s3.amazonaws.com/sm-voiceover_my_books.png" alt="VoiceOver selection of the third element of a My Books list, The Elements of Content Strategy by Erin Kissane" /></a></p>
<p>This part of the “Home” section lists the books you’ve downloaded to your device for reading. Because Ibis Reader stores everything in the cloud, you don’t need to worry about deleting titles here because we’ll keep a copy at the main website if you ever need to get it back onto your phone or tablet again. Like the Get Books list, these are just a list of the title and author(s) for each book, and selecting one will open it to your last known reading position.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/03/11/using-ibis-reader-and-voiceover/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cost-effective Development of Enhanced Content with EPUB3 (Digital Book World 2011)</title>
		<link>http://blog.threepress.org/2011/01/31/cost-effective-development-of-enhanced-content-with-epub3-digital-book-world-2011/</link>
		<comments>http://blog.threepress.org/2011/01/31/cost-effective-development-of-enhanced-content-with-epub3-digital-book-world-2011/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 13:59:44 +0000</pubDate>
		<dc:creator>Liza Daly</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ibooks]]></category>
		<category><![CDATA[interactivity]]></category>
		<category><![CDATA[talks]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.threepress.org/?p=1789</guid>
		<description><![CDATA[I presented at Digital Book World 2011 about using EPUB3 to produce multimedia and interactive ebooks that will be compatible with multiple devices and software ereaders.
Anyone who&#8217;s ever been to a digital publishing conference knows that there is always a bewildering array of products that create and display enhanced content: ebooks that contain video, audio, [...]]]></description>
			<content:encoded><![CDATA[<p>I presented at <a href="http://dbw2011.digitalbookworld.com/cost-effective/">Digital Book World 2011</a> about using EPUB3 to produce multimedia and interactive ebooks that will be compatible with multiple devices and software ereaders.</p>
<p>Anyone who&#8217;s ever been to a digital publishing conference knows that there is always a bewildering array of products that create and display enhanced content: ebooks that contain video, audio, animation, or other forms of interactivity.  Generally each new platform requires an entirely different way of preparing the content and all the multimedia assets. While the production of static ebooks has become relatively standardized (using EPUB2), publishers are still struggling with how to produce more digital-native products without tremendous expense and constant re-tooling.</p>
<p>I&#8217;m optimistic that EPUB3 will provide significant headache-reduction in this area. While creating high-quality static, pure-text ebooks still has challenges, things are a lot better today than even a year ago.  If we&#8217;re to see similar consolidation in the enhanced ebook space in the same timeframe, publishers are going to have to be firm that they will only (or at least primarily) produce standards-based multimedia books.</p>
<h3>Slides from DBW</h3>
<div style="margin:auto; width:425px" id="__ss_6754013"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/lizadaly/costeffective-enhanced-ebooks-with-epub3" title="Cost-effective enhanced ebooks with EPUB3">Cost-effective enhanced ebooks with EPUB3</a></strong><object id="__sse6754013" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=dbw-2011-liza-daly-110130145804-phpapp02&#038;stripped_title=costeffective-enhanced-ebooks-with-epub3&#038;userName=lizadaly" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse6754013" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=dbw-2011-liza-daly-110130145804-phpapp02&#038;stripped_title=costeffective-enhanced-ebooks-with-epub3&#038;userName=lizadaly" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/lizadaly">lizadaly</a>.</div>
</div>
<h3>EPUB3 interactivity demo in iBooks</h3>
<p>The talk includes a video demo.  I had created an EPUB document several months ago for a research project, using <a href="http://www.archive.org/details/abroadcranethoma00craniala">Abroad</a> by Thomas Crane as source material (edition from the <a href="http://archive.org/">Internet Archive</a>).   I wanted to emulate the accelerometer-driven animation of the <a href="http://gizmodo.com/5515612/the-cleverest-ipad-book-yet">Alice for iPad</a> book using only the tools available in EPUB3.</p>
<p>Since the source was a heavily-illustrated children&#8217;s book, EPUB&#8217;s reflow capability was not really an asset. This quality made the book perfect for use in <a href="http://blog.threepress.org/2011/01/17/understanding-apples-fixed-layout-epubs/">Apple&#8217;s fixed-layout mode</a>.  The video below shows the book running in iBooks on an iPad: </p>
<p><embed style="margin:auto; text-align:center; display:block;" src="http://blip.tv/play/AYKgiGkA" type="application/x-shockwave-flash" width="640" height="454" allowscriptaccess="always" allowfullscreen="true"></embed><h3>Accelerometer</h3>
<p>In the first example, I use the accelerometer interface in JavaScript (<a href="http://www.mobilexweb.com/blog/safari-ios-accelerometer-websockets-html5">some sample code</a>), to cause the ship to &#8220;sail&#8221; back and forth as the user tilts the device.</p>
<h3>Animation</h3>
<p>In the second example, if the user touches any of the birds on the title page, they fly away. I modified the <a href="https://github.com/weepy/jquery.path">jQuery Path</a> library to use CSS3 transforms to efficiently animate along a curve. JavaScript performance in iBooks appears to be somewhat worse than Mobile Safari; optimizing using CSS3 rather than DOM position updates is recommended.</p>
<h3>Canvas, Processing.js, HTML5 audio</h3>
<p>I&#8217;m a big fan of the <a href="http://processingjs.org/">Processing</a> visual programming language.  In the last example, the train appears to give off puffs of steam; each time the steam comes out of the train the puffs are in slightly different positions.</p>
<p>I embedded Processing.js code (which is itself then interpreted by JavaScript) and rendered the puffs to a transparent canvas.  The puffs appear in a slightly random position,  fade out as they reach the top of the page and then spawn anew.  </p>
<p>Finally, there&#8217;s also an event bound to the invisible canvas: tapping on it will fire an HTML5 audio (a sample of a train).</p>
<p><em>(At this time we&#8217;re not able to share the demo EPUB file itself.)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.threepress.org/2011/01/31/cost-effective-development-of-enhanced-content-with-epub3-digital-book-world-2011/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

