View Single Post
Old 02-09-2021, 05:52 AM   #12
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
Quote:
Originally Posted by davidfor View Post
The ToC generation is using a the h2 and the hidden class for the second level. It looks like it should work. Can you show use the generated NCX code? And the actual code at the top of the matching chapter. That might give a hint as to what is wrong.
Yeah sure, here's the NCX for Chapter 1:
Code:
<navPoint id="num_5" playOrder="5">
        <navLabel>
          <text>CAPITOLO I. Come Candido è allevato in un bel castello e come n'è cacciato via.</text>
        </navLabel>
        <content src="Text/Section0004.xhtml#toc_1"/>
      </navPoint>
And here the corresponding part in the file:
Code:
<h2 class="hidden" id="toc_1">CAPITOLO I. Come Candido è allevato in un bel castello e come n'è cacciato via.</h2>
I'll share a finding: in the calibre book Editor, clicking on the index entry highlights the right line in the editor view, but doesn't go to the right position in the preview (it only opens the file at the beginning).

That suggests me that the problem is on how calibre manages the display: none rule, as the link works on the source html, but not on the resulting file. I might be wrong though.

Quote:
And that is an interesting idea. What I do is easy if the chapter heading already use well defined classes. But, if they are bare heading tags, I have to add classes. With that, I could rely on the existing stylesheet a bit more.
Sorry, what are you referring to in particular? I'm not sure
413Michele is offline   Reply With Quote