toc.xhtml
All navigational aids are located within the <body>
of the navigation document (toc.xhtml for our EPUB projects).
When creating a new toc.xhtml file, you should use the toc.xhtml template.
Each one is an ordered list (<ol>
) of hyperlinks (<li><a></a></li>
) nested in a <nav>
element.
<nav> |
toc.xhtml Table of Contents
Each EPUB we develop must have a TOC in the navigation document.
General guidelines for the TOC:
- The EPUB TOC should reflect the printed TOC, but…
- should only include text between the
<li></li>
tags (no classes, etc.), - should not be deeply nested (3 levels max),
- should always include part, chapter, or section label (i.e. Print edition has “Chapter 1” in toc, EPUB should have “Chapter 1: Monday Blues”),
- should not include elements that appear prior to the TOC in its linear order.
<nav epub:type="toc">
<h1>Table of Contents</h1>
<ol>
<!-- <li> elements with <a>, linking to each location -->
<!-- with additional nested lists as the TOC requires. -->
</ol>
</nav>
Nesting Table of Contents in toc.xhtml
Table of Contents entries that have children should be nested.
<nav epub:type="toc" id="toc"> |
In DS01_chapter01.xhtml: |
toc.xhtml Landmarks
epub:type="landmarks"
is required by Amazon (fixed layout is an exception). The first entry in the TOC List should be the first entry to the landmarks
.
<nav epub:type="toc" id="toc"> |
toc.xhtml Page List
If a print version of the title exists, pagebreaks should be added in the content and added to the Page Number list.
This list must follow the order of pagebreak
tags as they occur in the document and the order of content documents in the <spine>
.
<nav epub:type="page-list"> |
toc.xhtml List of Images
epub:type="loi"
is required if you have images that are educational or add value to the content (fixed layout is an exception).
Do not add the title page or ornaments in this list.
<nav epub:type="loi" class="hide"> |
toc.xhtml List of Tables
epub:type="lot"
is required if you have tables.
<nav epub:type="lot" class="hide"> |
toc.ncx
A toc.ncx should be included in every ePub for backwards compatibility and the toc.ncx template should be placed in BBEdit stationary. If you’re wanting to test nesting or rendering from the toc.ncx file this can be done in Adobe Digital Editions.
<docTitle><text>ePub Documentation</text></docTitle> |
Duplicate src
in tox.ncx
epubcheck does require that the NCX have unique src attributes.
If the src attribute needs to be changed it should be done in the toc.xhtml as well as the toc.ncx.
<docTitle><text>ePub Documentation</text></docTitle> |
Nesting navPoint
s in toc.ncx
If there are Table of Contents entries that have children nested, they should also be nested in the toc.ncx.
<docTitle><text>ePub Documentation</text></docTitle> |