Saturday, 13 May 2017

Epub3 conversion notes.

(1) I found this list of epub2 to epub3 conversion notes

Notes below are mine, with typical error messages returned by epubcheck validation.

(2) 'Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'

For Epub 3, this means you need a table of contents in an xhtml file. An ebook often comes with an html "table of contents".

You should convert it to the required format. See the example below.

Your table of contents should look something like this:

    <nav epub:type="toc" id="toc">
        <ol id="nav">
            <li><a href="chapter01.xhtml#myId">Some entry</a></li>
            <li><a href="chapter02.xhtml#myOtherId">Some other entry</a></li>
              ...
        </ol>
    </nav>

The <nav> tag is a special epub tag, so the html tag, it sits in, needs another namespace to tell it what a <nav> is:

    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:epub="http://www.idpf.org/2007/ops"
          xml:lang="en">

Last: The <ol> tags inside your <nav> entry must not be nested (in more <ul>, or <ol> lists. One flat list only. You must use an <ol> list. <ul> not allowed.

So give this ol a style in your stylesheet. To knock out the numbers:

    ol#nav { list-style-type: none; }

In an example where "p2.xhtml" has a table of contents, .opf entry changes from:

    <item id="toc" media-type="application/xhtml+xml" 
          href="toc.xhtml" />

to:

    <item id="toc" media-type="application/xhtml+xml" 
          href="toc.xhtml" properties="nav"/>

[ PS: if you also have an svg file, add properties="svg" to that in the .opf too! ]

Pesky epub3!

No comments:

Post a Comment