Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 02:08 PM   #1
jd1004
Member
jd1004 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2025
Device: none
Bug or feature in "Edit Table Of Contents"

In Epub3, using Tools > Table Of Contents > Edit Table Of Contents and clicking "OK" without making any edits changes the file toc.xhtml. The formatted entries that are actually displayed in the ebook (most nav entries are hidden) change to a numbered list of links without formatting:

OLD:
Code:
<body>
  <nav epub:type="toc" id="toc" role="doc-toc">
    <h1 class="toc-title" id="abc">CONTENTS</h1>

    <ol class="none" epub:type="list">
      <li class="toc-front"><a href="cover.xhtml"><span class="toc_entry">COVER</span></a></li>
NEW:
Code:
<body>
  <nav epub:type="toc" id="toc" role="doc-toc">
    <h1>Table of Contents</h1>
    <ol>
      <li>
        <a href="cover.xhtml">COVER</a>
      </li>
So, editing the toc via the build-in function destroys the toc formatting.

Is that a bug or a feature?
jd1004 is offline   Reply With Quote
Old Yesterday, 03:06 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,216
Karma: 7640000
Join Date: Nov 2009
Device: many
Editing the TOC, unless you hit Cancel will create a new standard Sigil format TOC.

It sounds like you hit OK which causes the rebuild. It does not matter if you changed anything or not, Sigil takes the information given by the Edit TOC and recreates the TOC from it. That is expected behaviour.

It also sounds as if you are now missing a link to a css stylesheet for that nav that controls the numbering or not. A standard Sigil format Nav typically includes its own linked stylesheet. Simply editing that newly created stylesheet will enable you to control the numbering and what gets hidden.

FYI, people often add and remove headings and chapters while editing, and so it is often easier to simply generate the entire TOC using Sigil tools once near the end, editing it as needed in the TOC editor, or editing the Nav directly in CodeView before going final. Editing a custom TOC not originally generated by Sigil may not be what you want, especially if you did not Cancel or exit that Dialog.

If you do not like that change, assuming you have created a Checkpoint (which is always a good idea) you can easily revert.

Last edited by KevinH; Yesterday at 03:09 PM.
KevinH is offline   Reply With Quote
Old Yesterday, 03:25 PM   #3
jd1004
Member
jd1004 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2025
Device: none
I think the trouble is that the file toc.xhtml serves double duty as the nav file and as the visible table of contents.

I can fix that by making a copy of the file. That copy is then unaffected by a recreation of the toc and retains its formatting.

The trouble with that particular epub3 is that there are lots of links to the original toc.xhtml which all get broken as soon as I edit the toc via the menu because all the ids are lost.

Also, there is a toc.ncx file in addition to the toc.xhtml "nav" file. I'm not sure what that's about. I thought the ncx file is for epub2 only?
jd1004 is offline   Reply With Quote
Old Yesterday, 04:20 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,931
Karma: 212736631
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by jd1004 View Post
Also, there is a toc.ncx file in addition to the toc.xhtml "nav" file. I'm not sure what that's about. I thought the ncx file is for epub2 only?
The toc.ncx can be safely deleted from an EPUB3, but many leave it in for backward compatibility with EPUB2 reading systems. For basic things like novels, most vanilla EPUB3s can be read in EPUB2 reading systems just fine (unless the toc.ncx is missing).
DiapDealer is offline   Reply With Quote
Old Yesterday, 04:48 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,216
Karma: 7640000
Join Date: Nov 2009
Device: many
And you can rename the nav to anything. It need not be named nav.xhtml nor toc.xml. Start with a fresh copy, In Sigil, duplicate toc.xhtml and create a toc2.xhtml. Rename the existing toc.xhtml to nav.xhtml.

I think if done in that order, all external links to the original toc.xhtml should all be auto updated to point to the nav.html. Edit and rename the toc2.xhtml till your heart is content.

Worth a try at least.

Last edited by KevinH; Yesterday at 04:54 PM.
KevinH is offline   Reply With Quote
Old Yesterday, 06:45 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,216
Karma: 7640000
Join Date: Nov 2009
Device: many
Alternatively you could use Sigil to create an HTML toc from your current nav, and then edit that.
KevinH is offline   Reply With Quote
Old Today, 06:15 AM   #7
jd1004
Member
jd1004 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2025
Device: none
Thanks guys!

I created a copy of the NAV file, renamed that to contents.xhtml, edited "contents" and changed all the links in the epub from "nav" to "contents". That did the trick.

For the extraneous toc.ncx I also kept, EpubCheck gives me the message

OEBPS/toc.ncx,140,4833,Col: 48: ERROR(RSC-007): Referenced resource "OEBPS/Text/discover-page.xhtml" could not be found in the EPUB.

Of course, since this is an Epub3 file, deleting the file "discover-page.xhtml" will only edit the NAV file, not the NCX file, but I think I can live with that error check message. Manually deleting the file entry from toc.ncx unfortunately only channges the error message, because then there is a gap in the internal numbering:

OEBPS/toc.ncx,136,4710,Col: 48: ERROR(RSC-005): Error while parsing file: playOrder sequence has gaps

Would it be possible to update both the NAV and the NCX file in an Epub3 if both files are present?

Cheers and keep up the good work!
jd1004 is offline   Reply With Quote
Old Today, 07:03 AM   #8
jd1004
Member
jd1004 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2025
Device: none
P.S.: Good thing I kept the toc.ncx. My Tolino Vision 4 HD is displaying that instead of the NAV file.
jd1004 is offline   Reply With Quote
Old Today, 10:54 AM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 10,216
Karma: 7640000
Join Date: Nov 2009
Device: many
Go to Sigil Tools menu and from it select the Epub3 Tools menu. These are the epub3 specific tools to delete the guide and ncx. There is another tool there to recreate the guide and ncx based in the current nav. So no need to manually edit the ncx. There are also tools to update Manifest properties.

So once you are happy with the nav, use the epub3 tools to delete the guide and ncx, then the epub3 tool to create the guide and ncx based in your nav so that they match.

Then as a last step, run the Update Manifest properties tool just to be safe.

Last edited by KevinH; Today at 11:09 AM.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No Table of Contents and "This HTML file is larger than 260 KB" Error rosewood Conversion 13 02-07-2023 12:58 PM
PRS-T3 "Table of contents" button on every page Leon74 Sony Reader 2 01-04-2014 12:48 PM
Change name of autogenerated "Table of Contents" Dzoni Conversion 7 03-16-2011 04:44 AM
Generating a rough "table of contents" Vanguard3000 Calibre 5 01-09-2011 11:31 PM
TOO SLOW to open "Table of Contents" mdhuang Sony Reader 16 09-06-2007 11:29 PM


All times are GMT -4. The time now is 03:33 PM.


MobileRead.com is a privately owned, operated and funded community.