Quantcast
Channel: MobileRead Forums - Kindle Formats
Viewing all articles
Browse latest Browse all 862

Internal Linking in a MOBI file (Coding Help Needed)

$
0
0
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

Attached Files
File Type: mobi recipes.mobi (8.6 KB)
File Type: zip recipes.zip (2.5 KB)

Viewing all articles
Browse latest Browse all 862