dvschultz / 99problems

99 Problems and e-reader rendering are all of them
60 stars 3 forks source link

Kindle requires TOC item in `landmarks` to point specifically to #toc section of Nav document #43

Open elmimmo opened 9 years ago

elmimmo commented 9 years ago

For Kindles to offer a "Go to… TOC" menu (in Kindles that have such menu at all), Kindle Publishing Guidelines (2014.2) state:

3.3.3 TOC Guideline 3: HTML TOC Must Be Referenced

To enable the customer to jump to the TOC from the Kindle menu, the OPF file must reference the TOC from a TOC guide item or the navigation html file must reference a TOC in a landmarks nav element. […]

Here is an example of a landmarks nav element for a TOC:

<nav epub:type="landmarks">
    <ol>
       <li><a epub:type="toc" href="toc.html">Table of Contents</a></li>
    </ol>
</nav>

While that will work for flowing layout books, for some obscure reason fixed layout books (FXL) have the additional unstated requirement that such reference has to point specifically to the toc nav element.

<nav epub:type="toc" id="toc">
…
</nav

<nav epub:type="landmarks">
    <ol>
        <li><a epub:type="toc" href="#toc">Table of Contents</a></li>
    </ol>
</nav>

or else the "Go to… TOC" button will remain grayed out.