View Single Post
Old 03-04-2013, 08:15 AM  
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 595
Karma: 1281565
Join Date: Dec 2011
Location: Padova, Italy
Device: Kindle3, Odyssey, eDGe, A60, PRS-T1, iPad3, KoboGlo
Hi,

I would like to share a piece of information that might help those who are producing EPUB 3 eBooks and might want to take "advantage" of kindlegen 2.8 to create MOBI/KF8 files from them.

Short
If you want to convert an EPUB 3 file using kindlegen, in the nav landmarks of your navigation document you MUST specify ONLY one element with epub:type "toc", "cover" and "bodymatter". If you specify other elements (e.g., an item with epub:type "frontmatter"), kindlegen 2.8 FAILS to create the cover/TOC/beginning shortcuts in the output MOBI/KF8 file. If you want to keep those extra bits, you are forced to revert to kindlegen 2.7.

Long
I have a perfectly legal EPUB 3 file with the navigation document both as XHTML (toc.xhtml) and NCX (toc.ncx, for backward compatibility).

The former contains the following landmarks:
Code:
        <nav class="indice" epub:type="landmarks">
            <h1 class="indice">Scelte rapide</h1>
            <ol class="indice">
                <li class="indice"><a class="indice" epub:type="cover" href="copertina.xhtml">Copertina</a></li>
                <li class="indice"><a class="indice" epub:type="frontmatter colophon" href="colophon.xhtml">Colophon</a></li>
                <li class="indice"><a class="indice" epub:type="toc" href="indice.xhtml">Indice</a></li>
                <li class="indice"><a class="indice" epub:type="frontmatter foreword" href="presentazione.xhtml">Presentazione</a></li>
                <li class="indice"><a class="indice" epub:type="frontmatter" href="p001.xhtml">Inizio del romanzo</a></li>
            </ol>
        </nav>
Now, I want the "opening point" of the eBook to be the last element, p001.xhtml.

Tried to convert the EPUB 3 file with the above code with kindlegen 2.8, and it issues the following warning:
Code:
Warning(prcgen):W14023: Failed to add the guide item to the book :  frontmatter
and, more importantly, it does not create the cover/TOC/beginning shortcuts (without outputting the corresponding warning), even if the OPF file has:
Code:
<guide>
    <reference type="cover" title="Copertina" href="Text/copertina.xhtml" />
    <reference type="toc" title="Indice" href="Text/indice.xhtml" />
    <reference type="text" title="Inizio" href="Text/presentazione.xhtml" />
</guide>
To "fix" the problem, one has to revert to kindlegen 2.7 (as I did) or "remove" the unrecognized elements from the nav landmarks:
Code:
        <nav class="indice" epub:type="landmarks">
            <h1 class="indice">Scelte rapide</h1>
            <ol class="indice">
                <li class="indice"><a class="indice" epub:type="cover" href="copertina.xhtml">Copertina</a></li>
                <li class="indice"><a class="indice" epub:type="toc" href="indice.xhtml">Indice</a></li>
                <li class="indice"><a class="indice" epub:type="frontmatter" href="p001.xhtml">Inizio del romanzo</a></li>
            </ol>
        </nav>
We are good, right? Uhm, no, because the Kindle Publishing Guidelines do not mention the fact that the ONLY recognized epub:type's are "toc", "cover" and "bodymatter". Hence, I am also forced to change (inconsistently with the semantics) the epub:type of the last item to "bodymatter".
Code:
        <nav class="indice" epub:type="landmarks">
            <h1 class="indice">Scelte rapide</h1>
            <ol class="indice">
                <li class="indice"><a class="indice" epub:type="cover" href="copertina.xhtml">Copertina</a></li>
                <li class="indice"><a class="indice" epub:type="toc" href="indice.xhtml">Indice</a></li>
                <li class="indice"><a class="indice" epub:type="bodymatter" href="p001.xhtml">Inizio del romanzo</a></li>
            </ol>
        </nav>
Now, of course, kindlegen succeeds in creating the MOBI/KF8 with cover/TOC/beginning shortcuts.


Summary
From the discussion above, it seems to me that:
1) if nav landmarks are present, the <guide> is ignored;
2) there is a bug in kindlegen 2.8, because if it cannot parse a nav landmark element, it fails to create the cover/TOC/begininning shortcuts;
3) the Kindle Publishing Guidelines do not state explicitly that the only recognized epub:type's are "cover", "toc", and "bodymatter";
4) in any case, Amazon forces you to open your book at "bodymatter", even if you want to open your book at (say) "preface" or "introduction" or whatever --- In other words, IMHO, they restrict the option for "opening point" to "beginning of text", which is not very desirable.

Last edited by AlPe; 03-04-2013 at 08:47 AM.
AlPe is offline   Reply With Quote