View Single Post
Old 07-28-2024, 01:05 PM   #1
brendontowle
Junior Member
brendontowle began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2024
Device: iPad
Generated TOC links go to wrong place

I'm told that this is user error (https://bugs.launchpad.net/calibre/+bug/2074284), so I'm checking here.

I'm trying to generate a TOC using Calibre 7.10, for an ePub that has very well-formed chapters and chapter/section headings. In the tutorial at https://manual.calibre-ebook.com/con...le-of-contents, I found these instructions:

Then, we set the options as:
Level 1 TOC : //h:h1
Level 2 TOC : //h:h2
This will result in an automatically generated two level Table of Contents that looks like:
Chapter 1
Section 1.1
Section 1.2
Chapter 2
Section 2.1
Using those instructions, I do get a two level ToC that looks like that, but: all of the section links, when clicked on, send you to the start of the chapter, not the section itself. And, sure enough, when I look at the data in the generated toc.ncx file, I see this:

<navPoint id="uIXA2jfX6ChloBsjmNnSAg9" playOrder="2" class="chapter">
<navLabel>
<text>1月</text>
</navLabel>
<content src="OPS/chapter-2_split_000.xhtml"/>
<navPoint id="uqfPktaL93cTQmqLLO4idQ3" playOrder="2" class="chapter">
<navLabel>
<text>1月1日</text>
</navLabel>
<content src="OPS/chapter-2_split_000.xhtml"/>
</navPoint>
<navPoint id="utq9DOX7bB9u69KAIm5i7y2" playOrder="2" class="chapter">
<navLabel>
<text>1月2日</text>
</navLabel>
<content src="OPS/chapter-2_split_000.xhtml"/>
</navPoint>

Note that the src link for each of the contained navLabels points to ...split_000.xhtml. But, the actual header elements for the contained navLabels are not in ...split_000; they're in ...split_001, ...split_002, etc.

So. What do I need to do to convince Calibre that I actually want the section links to point to the sections themselves, and not to the chapter?
brendontowle is offline   Reply With Quote