Monday, February 25, 2013

War

I just read two reviews of Sebastian Junger's War, in the New York Times and Washington Post. Both reviews mentioned the part titles, by name, in full. War is a very simple book, structurally, but illustrates some of the challenges we face with e-book navigation. The book consists of three parts:

Book One | Fear
Book Two | Killing
Book Three | Love

In print, this is the entire table of contents, and is essential to framing the story. In EPUB2, we typically have both an HTML table of contents (which we move to the end of the book) and the required NCX. Given the importance of this toc, we broke our rule about HTML tocs, and followed the print book. The NCX contained the links to all the chapters.

So how would we handle this in e0? We do need to define the reading order in index.html:

<nav>
  <ol>
    <li><a href="s003-preface.html">Author’s Note</a></li>
    <li><a href="s004-part-001.html">Book One | Fear</a></li>
    <li><a href="s005-chapter-000.html">New York City, Six Months Later</a></li>
    <li><a href="s006-chapter-001.html">1. Korengal Valley, Afghanistan, Spring 2007</a></li>
    <li><a href="s007-chapter-002.html">2.</a></li>
    <li><a href="s008-chapter-003.html">3.</a></li>
  </ol>
</nav>

But we don't want the reader to see that as a primary part of the text, so I'll make it hidden. Do I then need to define the reading order separately from the navigation? I don't think so, in this case. This works fine both to define the reading order and provide machine-readable navigation for the reading system. So what should I do? I'll just add an old-fashioned table of contents, as a regular content file, after editing my index.html.

<nav hidden="hidden">
  <ol>
    <li><a href="s002-toc.html">Contents</a></li>
    <li><a href="s003-preface.html">Author’s Note</a></li>
    <li><a href="s004-part-001.html">Book One | Fear</a></li>
    <li><a href="s005-chapter-000.html">New York City, Six Months Later</a></li>
    <li><a href="s006-chapter-001.html">1. Korengal Valley, Afghanistan, Spring 2007</a></li>
    <li><a href="s007-chapter-002.html">2.</a></li>
    <li><a href="s008-chapter-003.html">3.</a></li>
  </ol>
</nav>

and in s002-toc.html:

<nav>
  <ol>
    <li><a href="s004-part-001.html">Book One | Fear</a></li>
    <li><a href="s012-part-002.html">Book Two | Killing</li>
    <li><a href="s021-part-003.html">Book Three | Love</li>
  </ol>
</nav>

This example turned out to be simpler than I hoped. I'd love to see examples of more complex navigational structures, especially if they seem to conflict with this simple approach to defining the reading order.

2 comments:

  1. Dave,

    Why don't you include both nav elements in the index.html?
    Also, either the reading order or the navigation should have a type attribute to identify them as such.

    A minimal EPUB Zero would only have a reading order, while a more complex one would have both reading order and navigation.

    ReplyDelete
  2. this is how my system does it.

    table of contents right after the title-page:

    > part 1 -- fear
    > part 2 -- killing
    > part 3 -- love

    then each "part" starts with its own mini t.o.c.:

    > part 1
    >
    > fear
    >
    >
    > chapter 1.1 -- new york city, six months later
    > chapter 1.2 -- korengal valley, afghanistan, spring 2007
    > chapter 1.3 -- give your chapters a title
    > chapter 1.4 -- just like you give your children a name


    you could also do the "main" table of contents like so:

    > part 1 -- fear
    > chapter 1 -- new york city, six months later
    > chapter 2 -- korengal valley, spring 2007
    > chapter 3 -- give your chapters a title
    > chapter 4 -- just like you give kids a name
    > part 2 -- killing
    > chapter 5 -- give these chapters a title too
    > chapter 6 -- helps people "see" the structure
    > part 3 -- love
    > chapter 7 -- isn't love a wonderful thing?
    > chapter 8 -- love is what makes the birds sing

    i suggest this last form _if_ it will fit on one page.
    (i hate those elaborate t.o.c. that go on for 6 pages.)
    if it won't fit, i suggest the main/mini split as above.

    by the way, in my system, _the_headers_themselves_
    are compared to this _listed_ table of contents, and,
    if the belt doesn't match the suspenders, it squawks.

    there's no such thing as a "nav" file. because if you
    already have belt and suspenders, who needs glue?

    -bowerbird

    ReplyDelete