View Single Post
Old 12-12-2013, 06:14 PM   #2
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,
Kindle mobi is a compiled format. It is not like other formats. It takes significant work and preprocessing to actually properly create a mobi.

KindleUnpack does its best to decompile the format back into something that can be passed back into Kindlegen. If you use KindleUnpack you need to ask for the raw text to be dumped as well (it is a command line option). That raw text will give you an idea of how the compilation step is done in part. Note mobi 7 and mobi 8 versions handle links differently.

KevinH

Quote:
Originally Posted by mountainsoft View Post
I am a software developer and have added a MOBI export feature to one of my applications. This has worked well so far, but I'm wanting to add an index at the beginning so the document will be easier to navigate.

I am doing all of the coding myself, and am not relying on external tools like Kindlegen, Mobicreator, or Calibre. So I am hoping someone here has low level knowledge of the MOBI file format.

I am attaching a sample file (recipes.mobi) that I have exported from my application. The index shows up, but the links don't do anything when you click them?

I am also attaching the source (recipes.htm) document. This uses simple HTML linking such as
Code:
<a href="#recipe1">Recipe 1</a>
in the index and
Code:
<a id="recipe1" />
at the start of each section.

The links work fine in the HTM source (in a web browser).

If I use KindleGen to encode the Recipes.htm source, the links do work correctly. But if I use Unkindle in Calibre to unpack the MOBI file, the HTM doesn't look much different than my original source. I'm clearly missing something in the MOBI encoding.

Any ideas what I need to do to get the internal links to work?

Thanks,

Anthony Watson
KevinH is offline   Reply With Quote