View Single Post
Old 12-06-2013, 03:03 PM   #109
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,
So your HTML toc is stored in a text section but it has a guide element with type toc to specify its location.

As far as I know (so someone please correct me if I am wrong) in older Mobis the guide is stored inside the first text sections at the start. For newer KF8 there is actually a separate guide index section, but you would have to decode it to see if it contains an entry for toc and reading kindle index records is not trivial.

Perhaps something might be encoded in the flags info in the header but I am not sure if any of those bits indicate the presence of an html toc or not.

Maybe DiapDealer, pdurrant, or hitch may know the answer to that.

I suppose at least for KF8 mobis a grep of the guide CNX records could be easily done to see if "toc" exists or not.

For older Mobis extracting or decompressing the first text section nd grepping for guide and toc might work.

Sorry I can't be more help.

KevinH

Quote:
Originally Posted by quiris View Post
Mobi can contains two distinct ToCs: NCX TOC and "HTML" TOC. Kindle Previewer calls the first one as "NCX" and the second one as "Table of Contents". Check an attachment.

I know how to find existence of "NCX" digging into header dump (grep "NCX Index") but I don't know how to find existence of "Table of Contents".

As far as I understand your answer finding it require unpacking entire mobi and looking into content.opf for <reference type="toc" title="Table of Contents" href="example.html#filepos657133" />. Sad…

I thought that it's possible by simple grep of header dump…

I'm writing sort of bash quality mobi batch script that runs quickly through hundreds of mobis looking for missing covers, missing ncx, missing ToC which are critical important for good book experience so unpacking entire mobi slows down process dramatically.
KevinH is offline   Reply With Quote