I have had a lot of 'battles' getting the TOC for Kindle to work.
The first thing I do is convert the source to epub if it's not already in epub format.
I create my own css for the chapter heading - thus I can be 100% sure its unique.
I set all the headings to 'h1' and apply my css
I use the Sigil TOC function to generate the content list
I check the TOC links in Sigil sometimes they dont jump to the chapter text - in my experience this has always been because the 'id' value is missing in the toc.ncx so edit as needed.
If everything is ok in Sigil I then check to make sure that Calibre reads this edited epub correctly.
Now comes the Calibre conversion from epub to mobi.
Earlier I said I create my own css for the chapter headings I call this class 'chapter' - Calibre's Structure Detection function is already set up to look for this class in H tags !!!
So there's no need for xpath expressions in Calibres TOC function.
On Calibres Mobi output function I leave the 'Do not add TOC' option UNTICKED
So I run the conversion I usually open the 'Job' function so I can see how Calibre is working I want to see.... 'Chapters detected'.
When its finished I check my mobi conversion and it always works !
My process may not be 'good' Sigil or 'good' Calibre, but it works for me.
I'm not publishing or distributing books, and I'd rather read books than spend time processing them !
I whole heartedly agree with Whackatagin's comment about "simple is best".
|