Mobileread
using nav.xhtml for TOC
#1  hobnail 11-28-2019, 08:33 PM
(I don't know if it's different with epub 2 since I'm only making epub 3 books.) I create a book with Sigil and when it's finished I generate the table of contents. In the Book Browser I move the nav.xhtml file to the top, just after the book's cover. When I open the book in an e-reader the nav.xhtml is still at the end of the book. If I instead open the book in the Calibre editor and drag the nav.xhtml file to the top in its File Browser and then open the book in an e-reader the nav.xhtml is at the front of the book.

Is there a reason Sigil forces it to stay at the end of the book?
Reply 

#2  theducks 11-28-2019, 10:42 PM
No reason,
because it doesn't force you to.

In fact Sigil puts the HTML TOC at the front (If you use the tool that makes one from the NCX)
Reply 

#3  DiapDealer 11-29-2019, 10:15 AM
Being away from any testing resources, I assume that Sigil's default NAV is not included in the OPF spine (hence why moving it in Book Browser has no effect in your reading app) and calibre DOES include the NAV in the spine. Both approaches are equally correct. I've just never been a real fan of combining the logical NAV document with a visible html toc, myself. but you're certainly permitted to do so within the EPUB specs, so I don't think Sigil will stop you from manually adding the NAV to the spine if you so choose (again: I cannot test that right now. Someone else may need to fact-check me). It just doesn't automatically do it for you.
Reply 

#4  Doitsu 11-29-2019, 11:31 AM
Quote DiapDealer
Being away from any testing resources, I assume that Sigil's default NAV is not included in the OPF spine [...]
By default, the NAV document of epub3 books created with Sigil is included in the OPF spine. Sigil supports also epub3 books with NAV documents that are not included in the spine and will display the NAV as the second file in the Book Browser.
If the users changes the position of the NAV document in the Book Browser, it'll be automatically added to the spine.

@hobnail

1. What's your Sigil version and your operating system?
2. Did you also generate a secondary TOC via Create HTML Table Of Contents?
Reply 

#5  DiapDealer 11-29-2019, 12:07 PM
Thanks for the clarification. I would have thought we would have made allowances for the NAV in the spine (otherwise there's no reason for it to be movable). I was basing my guesses off of the symptoms alone. But like you mentioned, I think there may be some confusion between the NAV and secondary html tocs going on here.

Perhaps the OP's epub doesn't include the NAV in the spine, and the secondary Toc that calibre may have created is what's appearing at the end of the book.
Reply 

#6  hobnail 11-29-2019, 02:20 PM
Quote Doitsu
By default, the NAV document of epub3 books created with Sigil is included in the OPF spine. Sigil supports also epub3 books with NAV documents that are not included in the spine and will display the NAV as the second file in the Book Browser.
If the users changes the position of the NAV document in the Book Browser, it'll be automatically added to the spine.

@hobnail

1. What's your Sigil version and your operating system?
2. Did you also generate a secondary TOC via Create HTML Table Of Contents?
1: Sigil 0.9.18, Windows 10.

2: No, I didn't know about that. I was clicking the Generate Table of Contents button, between the Metadata Editor and Spellcheck buttons.

If I use Create HTML Table Of Contents then in the e-reader that one is in the right place but the nav.xhtml is displayed after the last chapter so then I have two displayed TOCs. If I only move the nav.xhtml file up in Calibre's editor that gives me one TOC that's functionally appears to be the same as the one created by Create HTML Table Of Contents while also providing a TOC that the e-reader displays when you click on its TOC button.

Having two TOCs isn't a big problem but I'm wondering why being able to use the nav.xhtml as the displayed TOC (by moving it in Calibre's editor) would be a problem.
Reply 

#7  hobnail 11-29-2019, 06:04 PM
In Sigil the nav.xhtml is only movable in the Book Browser but that doesn't change where it's displayed when you look at the book in an e-reader; it's still at the end of the book. There is no secondary TOC. Here's what Calibre Editor's File Browser looks like after dragging the nav.xhtml to the top:

show attachment »

I'm also wondering why a secondary TOC is needed since the nav.xhtml file functions as one, after it's moved to the top in Calibre. The epub 3.2 spec says

"But the EPUB Navigation Document is not exclusively for machine processing. Because it is an XHTML Content Document, it can be part of the linear reading order, avoiding the need for duplicate tables of contents. Content which is only destined for machine processing, such as page lists, can be hidden from visual rendering with the hidden attribute."

https://www.w3.org/publishing/epub3/epub-packages.html
Reply 

#8  Doitsu 11-29-2019, 06:07 PM
Quote hobnail
Having two TOCs isn't a big problem but I'm wondering why being able to use the nav.xhtml as the displayed TOC (by moving it in Calibre's editor) would be a problem.
You definitely can use the NAV document as a TOC. (For a proof of concept, see this simple MR EPUB3 book.)
Maybe your e-reader always displays the NAV document at the end of a book?
To test this open the EPUB3 book that I've linked to with Sigil, move the NAV document after the cover, save the book and open it with your e-reader.
If it displays the NAV document at the end of the book, it's the e-reader that causes this problem.
Reply 

#9  KevinH 11-29-2019, 07:38 PM
Could it be linear="no" attribute on the nav in the spine.
Reply 

#10  slightfever 12-02-2019, 07:20 PM
eReader displays in the order described in OPF's spine.
Is nav.xhtml at the bottom?

When nav.xhtml is used as a document table of contents, please arrange in order by spine.
If you have another document table of contents and you do not want to display nav.xhtml, you do not have to write it in spine.
Even if linear = "no", it will not be displayed.
However, linear = "no" is used for auxiliary display sheets such as popups.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register