Kindle, the elusive TOC trick for html source…

I finally found what I needed to make TOC work in a single html file.

Once I propagate this to my kindle books, the Table of Contents button will no longer be grayed out!

The essence:

<!– TABLE OF CONTENTS –>
<mbp:pagebreak />
<guide>
<reference type="toc" title="Table of Contents" href="#toc"></reference>
</guide>

<a name="toc"/><h2>Contents</h2>
<blockquote><a href="#chap1">1. Beginnings</a></blockquote>
<blockquote><a href="#chap2">2. Zombie Mashup</a></blockquote>

and so on…

<!– CHAP ONE STARTS HERE –>
<mbp:pagebreak />
<a name="chap1"/><h2>1. Beginnings</h2>

and so on…

Enjoy, live long, and prosper,

Robert

This entry was posted in ePublishing. Bookmark the permalink.

3 Responses to Kindle, the elusive TOC trick for html source…

  1. Scott Rauch says:

    Hello Robert,
    First of all, thank you for your concise help here.
    I tried your elusive trick, but still no TOC. Below is the entire html file (renamed TOC Test.txt for the Kindle).
    (BTW, I tried for quite a while to post HTML, but the code was always translated. I hope you can either see what I tried to post, or perhaps ignore what I tried and post a stand-alone “book” you know will work.)
    Again, thanks,
    Scott
    TOC Test
    Contents
    1. Beginnings
    2. Zombie Mashup
    1. Beginnings
    2. Zombie Mashup

  2. Robert Devereaux says:

    Hi, Scott,
    Somehow, I can’t see your html.
    If you’re on facebook, friend me there and I’ll do what I can to help!
    Robert

  3. Joe Martin says:

    Not able to get mine to show up either…from html using kindlegen…
    Here is what I put in as per your instructions:
    Table of Contents
    Chapter 1
    Chapter 2
    Chapter 3
    …toc is still grayed out.

Leave a Reply to Joe Martin Cancel reply

Your email address will not be published. Required fields are marked *