Quote:
Originally Posted by maryjanee
davidfor
that was helpful thanks. i guess i dont understand what to add exactly. i thought i just add the name of my bookmarked toc like this <reference type="toc" title="Table of Contents" href="filename.html#tocc"/> but the kindle previewer said there is no toc.
<reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
this is the code that works. what exactly should i add?
|
We are stretching my knowledge of this as when I do this, I normally do it in Sigil and let it sort things out. But...
What you need is code that looks something like:
Code:
<guide>
<reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
</guide>
Firstly, the simple things:
- There can be only one set of <guide></guide> tags.
- There may be other <reference> tags in there. Most will probably have type of "text" but "cover" for the cover page is one I can see.
- For the TOC, everything other than what is in quotes after "href" attribute should be the same.
The href attribute is where the changes are. This refers to a file in the epub and an anchor point within that file. So, there needs to be a file in the epub that has a table of contents in it. This will be html or xhtml file with links to the chapters. One of the tags in the file will have an id which is used as the anchor point. The example of this I can find has a separate file that is just the TOC. I suspect in this case, the anchor point is not needed, but it is there from whoever created the file. The anchor point will be needed if the file contains text other than the TOC.
The example I can find in my library has:
Code:
<guide>
<reference href="Text/Twice_Shy_split_024.html#filepos695889" title="Table of Contents" type="toc" />
<reference href="Text/titlepage.xhtml" title="Cover" type="cover" />
</guide>
In this, the TOC is contained in a file called "Twice_Shy_split_024.html" that is in a sub directory called "Text". In this file there is a <div> that wraps the actual TOC tags and has an id of "filepos695889". This epub looks like one I converted from mobi and then fiddled with in Sigil. I don't think I went near the TOC file.
As I mentioned, I use Sigil to edit epubs. As an experiment, I edited an epub, selected a file and gave it the semantics of TOC (right click on the file, select "Add Sementics" and then "Table of Contents"). Sigil updated contents.opf to have the tags we are talking about. In this case, there was no id in the href. I don't know what would happen if I converted this epub to mobi as the file I marked as the TOC did not have a TOC in it. I would expect the Kindle to either display the error you are seeing or an empty TOC.