![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Can nav be a TOC?
I was working on an epub3 file.
(I know my way around epub2, but 3 I'm still stumbling.) There wasn't a HTML contents page, and the NAV file looked OK in Sigil, so I thought I could use that. But if I add the semantic tag "Table of contents" in Sigil, I get an error in ePubCheck: ERROR(RSC-011): Found a reference to a resource that is not a spine item. And when I used Calibre to view the file, the NAV file was not displayed. I used Kindlegen to make AZW3, and it gave this error: Warning(prcgen):W14001: Hyperlink not resolved: \OEBPS\Text\toc.xhtml Warning(prcgen):W14002: Some hyperlinks could not be resolved. That is certainly the location of the NAV file, as I confirmedd by opening the epub as a zip file. However, it isn't listed in the OPF manifest section. I gave up and copied the NAV and tagged the copy as TOC, that worked. Can the NAV file be used as a visible Contents file or is it only an invisible system file? Last edited by AlanHK; 09-02-2019 at 06:18 AM. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,062
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
An EPUB 3 navigation document is to allowed to be part of the spine of the book. From the EPUB 3 spec:
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
However, since epub3 landmarks can only refer to spine items, it's not possible to link a TOC landmarks item to a navigation document that is not in the spine. To test this, create a blank epub3 book with Sigil, manually delete Code:
<itemref idref="nav.xhtml" linear="no"/> This will trigger the following error message: Code:
ERROR(RSC-011) nav.xhtml: Found a reference to a resource that is not a spine item. |
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 97
Karma: 200000
Join Date: Aug 2019
Device: none
|
This is why my nav.xhtml has two ToC - one that uses the 'nav' element with 'epub:type="toc"' - it has everything in spine order but has CSS property of display:none;
Then I have several (though one is enough for most use cases) 'section role="navigation"' where I have table of contents intended for the end user to see, and I don't have to worry about the ePub3 rules of them being in the spine order or what not. Have to use 'section role="navigation"' rather than 'nav' because ePub3 expect all 'nav' nodes to specify an 'epub:type' This gives me the visual ToC that I want for users while at same time providing a spine order ToC for eBook software to parse. Works in every reader I tested (limited to calibre and android) |
![]() |
![]() |
![]() |
#5 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
|
I always use the nav.xhtml file for the TOC the user sees when they page through the book. Simply open the epub in Calibre's editor and drag it to the top of the list of files (or more likely after the cover page). Doing this in Sigil (0.9.18 is what I'm using) does not work; it stays at the end of the book in the ereader.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
TOC nav.xhtml issue | ebookscovers | Conversion | 1 | 05-06-2017 11:12 AM |
ToC help needed: nav.xhtml | Phssthpok | Editor | 10 | 04-14-2017 04:58 AM |
EPUBTEST 0150 - EPUB Navigation Document Tests: toc nav not supported | quiris | Marvin | 3 | 07-06-2016 02:11 PM |
Ibooks epub 3 error : exactly one 'toc' nav element must be present | Firebrand007 | ePub | 6 | 01-02-2015 10:00 PM |
Bug Report: Mobi Conversion puts TOC Nav in wrong spot | therealjoeblow | Conversion | 4 | 12-02-2011 09:56 AM |