ToC format and rendering in toc.xhtml

2 posts / 0 new
Last post

What is the best way of representing the classical structure of a technical or academic book in the nav element of the toc.xhtml where there are several prelims, some chapters, some appendices, and some postlims, eg


Chapter 1
Chapter 2, etc

Appendix A
Appendix B, etc


Most readers seem to render ul lists for the prelims and postlims OK, and (naturally) ol for the chapters, and even ol type="A", li value="A" etc for this, but the validators disagree, and appear to reject multiple lists.

Right, the nav doc specification requires one ordered list inside each nav element, with sub-lists (also ordered) for capturing any hierarchy. You can read the requirements/restrictions in the Content Documents specification.

But the nav doc is declarative markup first, as it's purpose is to facilitate reading system rendering of these components for the reader (whether in a custom widget or via specialized html rendering). You can also include the navigation document in the spine, so that it appears as the reader progresses through the content, and avoid duplication of content.

Or you can craft your own table of contents for display in the body, in which case none of the rules apply.

Note, too, that EPUB processing requires the list numbering to be suppressed in any custom view, so they shouldn't appear in the nav lists, but compliance is a per-reading system matter. It's up to you, however, to suppress numbering when including in the spine, if so desired.

Secondary menu