Each publication must provide a table of contents in the EPUB navigation document (the toc
nav
).
The navigation document is one of the two key methods readers use to move around the content, the other being headings. It provides readers easy access to the major sections of the publication, which simplifies quick traversal and random inspection.
The table of contents is constructed using ordered lists (ol
). Each list item must either
contain a single link (a
) to a section of the document, or a link or heading
(span
) followed by a list of subsections.
If the pronunciation of a link will be ambiguous or incomplete due to embedded images, math content, or
other content without intrinsic text, a title
attribute must be attached containing an
alternate pronunciation.
The EPUB Samples Project contains the following publications that include table of contents navigation:
hidden
attribute:
toc nav
Elementnav
elementtoc nav
as a table of contents in my publication?Yes, the EPUB navigation document was formulated as an XHTML content document so that it could provide both a declarative table of contents for use by reading systems and also be embeddable as content.
The NCX file is allowed for forwards compatibility purposes only. An EPUB 2 reading systems may open an EPUB 3 publication, but it will not be able to use the new navigation document format.
You can ignore the NCX file if your book won't render properly as EPUB 2 content, or if you aren't targeting cross-compatibility.
Your publication may still open on EPUB 2 reading systems even without an NCX. Some reading systems, like Adobe Digital Editions, will not provide navigation by table of contents but will open the publication.
hidden
attribute do?The hidden
attribute has no effect on the table of contents when used by a reading
system to provide navigation. If you re-use the table of contents in the spine, then it is
treated as any other XHTML content document. In these cases, the hidden
attribute
lets you hide navigation components you don't want rendered, like the page list. It can also
be used to hide branches of the table of contents.