|
|
#1 |
|
Member
![]() Posts: 11
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>
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>
Is that a bug or a feature? |
|
|
|
|
|
#2 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,213
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; Today at 03:09 PM. |
|
|
|
|
|
#3 |
|
Member
![]() Posts: 11
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? |
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,930
Karma: 212736631
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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).
|
|
|
|
|
|
#5 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,213
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; Today at 04:54 PM. |
|
|
|
![]() |
|
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 |