Skip to content

Output EPUB 3 should have a landmarks section in Nav document #1757

@elmimmo

Description

@elmimmo

Pandoc should be generating a landmarks section in the Nav document, with the same information contained in the OPF's guide section.

When exporting to EPUB 3, the resulting OPF document contains EPUB 2's optional guide element, even though, in EPUB 3, the guide and its purpose have been deprecated in favor of the EPUB Navigation Document’s landmarks section, which Pandoc does not currently generate.

It might be considered convenient, for backwards compatibility purposes, that Pandoc generates EPUB 2's guide in EPUB 3 documents. But even though that does not make the document invalid, it is still not the proper EPUB 3 specified way to add that information to the book. I think it is awkward that the information EPUB 2's guide holds is missing in proper EPUB 3 syntax.

As an example, if this is the guide that Pandoc would generate:

<guide>
    <reference type="toc" title="My fist ebook" href="nav.xhtml" />
    <reference type="cover" title="Cover" href="cover.xhtml" />
</guide>

this is what the Nav document's body should contain:

<nav epub:type="toc" id="toc">
  …
</nav>
<nav epub:type="landmarks" hidden="hidden">
  <h1>Special sections</h1>
  <ol>
    <li><a href="cover.xhtml" epub:type="cover">Cover</a></li>
    <li><a href="#toc" epub:type="toc">Table of contents</a></li>
  </ol>
</nav>

In the markup above, is used to represent what Pandoc already generates.

Note that the landmarks nav element has the attribute hidden="hidden", since it is not supposed to be rendered if the user navigates to this document.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions