![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Insert Inline Table of Contents: Modify ePub Deletes It
In another learning attempt, I took an old book, stripped out much of the CSS from the EPUB, and re-did it. When I was done, I had the Calibre Editor make a new toc.ncx. So, I went to:
Tools > Table of Contents > Edit Table of Contents and had it create the toc.xhtml (I think that's what it's doing) first. I had it Generate ToC from XPath using the wizard based on h2. Then I went to: Tools > Table of Contents > Insert Inline Table of Contents and had it create the toc.ncx. It looked good to me and RunEpubCheck was happy with it. I saved it, closed it, and went back to Calibre, itself, to run Modify ePub (which I have set to Remove Broken TOC Entries in NCX File (among other things)). It deleted the contents of the ncx.toc (specifically, everything between the <navMap> tags. I'm assuming I've done something very wrong. But, it's possible either the Calibre Editor or Modify ePub are doing something wrong. Could someone take a look at the Modify ePub log and toc.ncx to see what wrong? Code:
Modify ePubs version (1, 7, 0) Logfile for book ID 4 (Piccadilly Jim / PG Wodehouse) Job details 4 Modifying: /tmp/calibre_5.41.0_tmp_lep7zgxy/juxwd_cn_modify_epub/4.epub Updating metadata and cover Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for redundant entries in manifest Looking for unmanifested files Looking for broken links in the NCX TOC Navpoint broken to remove of: text/Chapter-01.html TOC Navpoint broken to remove of: text/Chapter-02.html TOC Navpoint broken to remove of: text/Chapter-03.html TOC Navpoint broken to remove of: text/Chapter-04.html TOC Navpoint broken to remove of: text/Chapter-05.html TOC Navpoint broken to remove of: text/Chapter-06.html TOC Navpoint broken to remove of: text/Chapter-07.html TOC Navpoint broken to remove of: text/Chapter-08.html TOC Navpoint broken to remove of: text/Chapter-09.html TOC Navpoint broken to remove of: text/Chapter-10.html TOC Navpoint broken to remove of: text/Chapter-11.html TOC Navpoint broken to remove of: text/Chapter-12.html TOC Navpoint broken to remove of: text/Chapter-13.html TOC Navpoint broken to remove of: text/Chapter-14.html TOC Navpoint broken to remove of: text/Chapter-15.html TOC Navpoint broken to remove of: text/Chapter-16.html TOC Navpoint broken to remove of: text/Chapter-17.html TOC Navpoint broken to remove of: text/Chapter-18.html TOC Navpoint broken to remove of: text/Chapter-19.html TOC Navpoint broken to remove of: text/Chapter-20.html TOC Navpoint broken to remove of: text/Chapter-21.html TOC Navpoint broken to remove of: text/Chapter-22.html TOC Navpoint broken to remove of: text/Chapter-23.html TOC Navpoint broken to remove of: text/Chapter-24.html TOC Navpoint broken to remove of: text/Chapter-25.html TOC Navpoint broken to remove of: text/Chapter-26.html Looking for Adobe xpgt files and links to remove Looking for pagemaps Looking for Google Play pagemaps Looking for Adobe DRM meta tags to remove Looking for legacy jackets Adding or updating jacket Current jacket removed: jacket.xhtml Manifest item removed: jacket.xhtml (calibre_jacket) Spine itemref removed: calibre_jacket Manifest item added: jacket.xhtml (calibre_jacket) Spine item inserted: calibre_jacket at pos: 0 Looking for html pages containing only broken image links Looking for non dc: elements in manifest Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Looking for html files to remove charset meta tags/encode to utf-8 Switched to UTF-8 encoding for: toc.xhtml Switched to UTF-8 encoding for: text/titlepage.xhtml Looking for CSS margins Looking for inline javascript blocks to remove Looking for .js files to remove Applying smarten punctuation Stripping Kobo remnants Stripped Kobo spans in: text/titlepage.xhtml Looking for files to remove: ['iTunesMetadata.plist', 'iTunesArtwork'] Looking for files to remove: ['META-INF/calibre_bookmarks.txt'] Found file to remove: META-INF/calibre_bookmarks.txt Looking for files to remove: ['.DS_Store', 'thumbs.db'] Looking for unused images Stripping spans Unprettying files De-indented: toc.xhtml De-indented: text/titlepage.xhtml De-indented: text/part0000_split_000.html Insert or replace cover ...Looking for guide cover reference Found guide cover reference to: text/titlepage.xhtml Related manifest item id: titlepage ...Looking for meta cover ...Looking for other.ms-* guide references to clean out ...Working with possible existing cover: text/titlepage.xhtml Guide reference removed: text/titlepage.xhtml ...Looking for TOC navpoint for this cover ...Inspecting old cover for removal Cover page contains only this image so can be deleted Manifest item removed: text/titlepage.xhtml (titlepage) Spine itemref removed: titlepage Checking safe to remove cover image: cover.jpeg No other html pages use this image, safe to remove Manifest item removed: cover.jpeg (cover) ...Writing new cover image and titlepage html New cover image written to: cover.jpeg New titlepage html written to: text/titlepage.xhtml ...Updating manifest and TOC for the new cover Manifest item added: text/titlepage.xhtml (titlepage) Manifest item added: cover.jpeg (cover) Meta item inserted: cover:cover Spine item inserted: titlepage at pos: 0 Guide item inserted: text/titlepage.xhtml:Cover:cover ...Remove any orphaned guide images ...Apply device specific fixes ...Cover modifications completed ePub updated in 0.84 seconds The Calibre Editor toc.ncx looked like: Code:
<?xml version='1.0' encoding='utf-8'?> <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en"> <head> <meta name="dtb:uid" content="a114198a-8139-46e8-a383-4b27a0a72413"/> <meta name="dtb:depth" content="2"/> <meta name="dtb:generator" content="calibre (5.41.0)"/> <meta name="dtb:totalPageCount" content="0"/> <meta name="dtb:maxPageNumber" content="0"/> </head> <docTitle> <text>Piccadilly Jim</text> </docTitle> <navMap> <navPoint id="num_1" playOrder="1"> <navLabel> <text>CHAPTER I: A RED-HAIRED GIRL</text> </navLabel> <content src="text/Chapter-01.html"/> </navPoint> <navPoint id="num_2" playOrder="2"> <navLabel> <text>CHAPTER II: THE EXILED FAN</text> </navLabel> <content src="text/Chapter-02.html"/> </navPoint> <navPoint id="num_3" playOrder="3"> <navLabel> <text>CHAPTER III: FAMILY JARS</text> </navLabel> <content src="text/Chapter-03.html"/> </navPoint> <navPoint id="num_4" playOrder="4"> <navLabel> <text>CHAPTER IV: JIMMY’S DISTURBING NEWS</text> </navLabel> <content src="text/Chapter-04.html"/> </navPoint> <navPoint id="num_5" playOrder="5"> <navLabel> <text>CHAPTER V: THE MORNING AFTER</text> </navLabel> <content src="text/Chapter-05.html"/> </navPoint> <navPoint id="num_6" playOrder="6"> <navLabel> <text>CHAPTER VI: JIMMY ABANDONS PICCADILLY</text> </navLabel> <content src="text/Chapter-06.html"/> </navPoint> <navPoint id="num_7" playOrder="7"> <navLabel> <text>CHAPTER VII: ON THE BOAT-DECK</text> </navLabel> <content src="text/Chapter-07.html"/> </navPoint> <navPoint id="num_8" playOrder="8"> <navLabel> <text>CHAPTER VIII: PAINFUL SCENE IN A CAFE</text> </navLabel> <content src="text/Chapter-08.html"/> </navPoint> <navPoint id="num_9" playOrder="9"> <navLabel> <text>CHAPTER IX: MRS. PETT IS SHOCKED</text> </navLabel> <content src="text/Chapter-09.html"/> </navPoint> <navPoint id="num_10" playOrder="10"> <navLabel> <text>CHAPTER X: INSTRUCTION IN DEPORTMENT</text> </navLabel> <content src="text/Chapter-10.html"/> </navPoint> <navPoint id="num_11" playOrder="11"> <navLabel> <text>CHAPTER XI: JIMMY DECIDES TO BE HIMSELF</text> </navLabel> <content src="text/Chapter-11.html"/> </navPoint> <navPoint id="num_12" playOrder="12"> <navLabel> <text>CHAPTER XII: JIMMY CATCHES THE BOSS’S EYE</text> </navLabel> <content src="text/Chapter-12.html"/> </navPoint> <navPoint id="num_13" playOrder="13"> <navLabel> <text>CHAPTER XIII: SLIGHT COMPLICATIONS</text> </navLabel> <content src="text/Chapter-13.html"/> </navPoint> <navPoint id="num_14" playOrder="14"> <navLabel> <text>CHAPTER XIV: LORD WISBEACH</text> </navLabel> <content src="text/Chapter-14.html"/> </navPoint> <navPoint id="num_15" playOrder="15"> <navLabel> <text>CHAPTER XV: A LITTLE BUSINESS CHAT</text> </navLabel> <content src="text/Chapter-15.html"/> </navPoint> <navPoint id="num_16" playOrder="16"> <navLabel> <text>CHAPTER XVI: MRS. PETT TAKES PRECAUTIONS</text> </navLabel> <content src="text/Chapter-16.html"/> </navPoint> <navPoint id="num_17" playOrder="17"> <navLabel> <text>CHAPTER XVII: MISS TRIMBLE, DETECTIVE</text> </navLabel> <content src="text/Chapter-17.html"/> </navPoint> <navPoint id="num_18" playOrder="18"> <navLabel> <text>CHAPTER XVIII: THE VOICE PROM THE PAST</text> </navLabel> <content src="text/Chapter-18.html"/> </navPoint> <navPoint id="num_19" playOrder="19"> <navLabel> <text>CHAPTER XIX: BETWEEN FATHER AND SON</text> </navLabel> <content src="text/Chapter-19.html"/> </navPoint> <navPoint id="num_20" playOrder="20"> <navLabel> <text>CHAPTER XX: CELESTINE IMPARTS INFORMATION</text> </navLabel> <content src="text/Chapter-20.html"/> </navPoint> <navPoint id="num_21" playOrder="21"> <navLabel> <text>CHAPTER XXI: CHICAGO ED</text> </navLabel> <content src="text/Chapter-21.html"/> </navPoint> <navPoint id="num_22" playOrder="22"> <navLabel> <text>CHAPTER XXII: IN THE LIBRARY</text> </navLabel> <content src="text/Chapter-22.html"/> </navPoint> <navPoint id="num_23" playOrder="23"> <navLabel> <text>CHAPTER XXIII: STIRRING TIMES FOR THE PETTS</text> </navLabel> <content src="text/Chapter-23.html"/> </navPoint> <navPoint id="num_24" playOrder="24"> <navLabel> <text>CHAPTER XXIV: SENSATIONAL TURNING OF A WORM</text> </navLabel> <content src="text/Chapter-24.html"/> </navPoint> <navPoint id="num_25" playOrder="25"> <navLabel> <text>CHAPTER XXV: NEARLY EVERYBODY HAPPY</text> </navLabel> <content src="text/Chapter-25.html"/> </navPoint> <navPoint id="num_26" playOrder="26"> <navLabel> <text>CHAPTER XXVI: EVERYBODY HAPPY</text> </navLabel> <content src="text/Chapter-26.html"/> </navPoint> </navMap> </ncx> Code:
<h2>CHAPTER I: A RED-HAIRED GIRL</h2> EDIT: And, here's the toc.xhtml it generated to base the toc.ncx of off: Code:
<?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>Table of Contents</title> <style type="text/css"> li { list-style-type: none; padding-left: 2em; margin-left: 0; } a { text-decoration: none; } a:hover { color: red; } </style> </head> <body id="calibre_generated_inline_toc"> <h2>Table of Contents</h2> <ul class="level1"> <li><a href="text/Chapter-01.html">CHAPTER I: A RED-HAIRED GIRL</a></li> <li><a href="text/Chapter-02.html">CHAPTER II: THE EXILED FAN</a></li> <li><a href="text/Chapter-03.html">CHAPTER III: FAMILY JARS</a></li> <li><a href="text/Chapter-04.html">CHAPTER IV: JIMMY’S DISTURBING NEWS</a></li> <li><a href="text/Chapter-05.html">CHAPTER V: THE MORNING AFTER</a></li> <li><a href="text/Chapter-06.html">CHAPTER VI: JIMMY ABANDONS PICCADILLY</a></li> <li><a href="text/Chapter-07.html">CHAPTER VII: ON THE BOAT-DECK</a></li> <li><a href="text/Chapter-08.html">CHAPTER VIII: PAINFUL SCENE IN A CAFE</a></li> <li><a href="text/Chapter-09.html">CHAPTER IX: MRS. PETT IS SHOCKED</a></li> <li><a href="text/Chapter-10.html">CHAPTER X: INSTRUCTION IN DEPORTMENT</a></li> <li><a href="text/Chapter-11.html">CHAPTER XI: JIMMY DECIDES TO BE HIMSELF</a></li> <li><a href="text/Chapter-12.html">CHAPTER XII: JIMMY CATCHES THE BOSS’S EYE</a></li> <li><a href="text/Chapter-13.html">CHAPTER XIII: SLIGHT COMPLICATIONS</a></li> <li><a href="text/Chapter-14.html">CHAPTER XIV: LORD WISBEACH</a></li> <li><a href="text/Chapter-15.html">CHAPTER XV: A LITTLE BUSINESS CHAT</a></li> <li><a href="text/Chapter-16.html">CHAPTER XVI: MRS. PETT TAKES PRECAUTIONS</a></li> <li><a href="text/Chapter-17.html">CHAPTER XVII: MISS TRIMBLE, DETECTIVE</a></li> <li><a href="text/Chapter-18.html">CHAPTER XVIII: THE VOICE PROM THE PAST</a></li> <li><a href="text/Chapter-19.html">CHAPTER XIX: BETWEEN FATHER AND SON</a></li> <li><a href="text/Chapter-20.html">CHAPTER XX: CELESTINE IMPARTS INFORMATION</a></li> <li><a href="text/Chapter-21.html">CHAPTER XXI: CHICAGO ED</a></li> <li><a href="text/Chapter-22.html">CHAPTER XXII: IN THE LIBRARY</a></li> <li><a href="text/Chapter-23.html">CHAPTER XXIII: STIRRING TIMES FOR THE PETTS</a></li> <li><a href="text/Chapter-24.html">CHAPTER XXIV: SENSATIONAL TURNING OF A WORM</a></li> <li><a href="text/Chapter-25.html">CHAPTER XXV: NEARLY EVERYBODY HAPPY</a></li> <li><a href="text/Chapter-26.html">CHAPTER XXVI: EVERYBODY HAPPY</a></li> </ul> </body> </html> Last edited by enuddleyarbl; 04-22-2022 at 09:35 AM. |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Look at the Case of the EPUB folder text
I suspect it really is Text, causing a exact match, to fail, making it a Not found TOC item All the 'check tools' have flaws or blind spots. ![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
|
|
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Another interesting bit. If I have the Calibre Editor re-do the ToC's exactly as before, save it, and turn off the Modify ePub option to remove bad ToC entries, when I send it back to my Kobo, it works flawlessly. With the version that Modify ePub stripped the ToC out of, it failed when it tried to get to where the toc.ncx would normally show up (just before the start of the text) -- "Oops! This document couldn't be opened). I'm assuming it's failure to read is because toc.ncx is required for EPUB2s.
|
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
the h# tag is just used as a marker for the tool. it does nothing to the TOC by itself. My experience is Kobo's do not see a TOC (link) update from the original import. You must delete the book on the Kobo (and lose your place). |
|
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
At one point I even deleted the toc.ncx file entirely from within the editor and then had it make a new one. There are no red markers on any of the links. I used Kobo Utilities' "Update ToC for Selected Books" to send a new copy of the book and then the new ToC to Kobo. I'm beginning to think it's an issue with Modify ePub. Maybe I'll put a link on the plugin's page back to here about it.
I've made a scrambled version of the book: https://drive.google.com/file/d/1fHz...ew?usp=sharing |
![]() |
![]() |
#7 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Calibre TOC tool says OK (NCX) The inline TOC works after Modify EPUB (1.7.0) The only thing of note is scramble also scrambles the entries in the inline TOC, so they no longer match the headings (but various files do open and appear to be in the correct sequence) That leaves YOUR Modify EPUB (Mine works fine. I have the remove broken option ticked) Are you sure you have v1.7? |
|
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Yep. This is a fresh install of Calibre and all my plugins. The plugin manager says 1.7.0 for it. That new install might be an issue, though. I've just moved over to Linux (yet again). I wonder if there's some incompatibility with Linux.
|
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
You did use the CALIBRE SITE command line and NOT the repository
![]() BTW you should always mention the OS and calibre version in the initial post. I tested on Windows 10 x64 |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Yes. I installed with the official command from the calibre-ebook site. I went and ran Modify ePub against the book I was messing with a couple of weeks ago (Modify ePub had no problem with it on Windows). Now, it's stripping everything out of the ToC. I'll head over to the plugin thread and talk about that there. Thanks for the help.
|
![]() |
![]() |
#11 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
Problem discussed and solved in the Modif-Epub thread in the Plugin section.
Last edited by lomkiri; 04-23-2022 at 01:14 PM. |
![]() |
![]() |
#12 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
↑ ↑ ↑ ✔
Moderator Notice
![]() BR |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
2 Table of contents in one EPub? | holdit | Sigil | 3 | 01-28-2014 01:33 PM |
Touch no table of contents of epub 3.0 | tshering | Kobo Reader | 6 | 10-27-2012 01:09 PM |
CBC -> EPUB Table of Contents | pookakitten | Conversion | 7 | 02-24-2011 02:21 PM |
Table of Contents on ePub | Matt2012 | Ectaco jetBook | 3 | 03-13-2010 01:35 PM |
EPUB Table of Contents | Acey | Calibre | 7 | 11-19-2008 11:35 AM |