OBSOLETE! Kindle HTML Template
Amazon has changed their publishing method
So... the tips included in the referenced template
no longer work to create a visible TOC


Kindle PublishingTemplate
Tech Details
These Tips Copyright © 2011 by Beverly Howard
and released to the public domain

The Kindle html template file has intentionally been kept in the simplest html format possible and as a single file for submission to the Amazon DTP Publishing site site.

The tips here and in the template file assume the book's content submission will be contained in a single html file to be submitted for publishing.

You can look at the html "source" of the template file to see some Kindle specific needs that will not appear when browsing the template itself.  The code examples in green below are not functional until they are placed in the html source code.

For example;

Pagebreaks,

...which should be placed only between chapter and similar breaks, are initialized by including the following statement at the beginning of the html source code;

  <style>
    P { page-break-after: always }
  </style>

Pagebreaks are then executed by placing the html tags;

<p></p>

...in the source code between chapters or other locations where page (screen) breaks are needed. 

The "horizontal lines" in the template show places where page breaks have been set in the underlying code.  The lines can be deleted after they have been used to assure that the content has been added on the correct side of the page breaks.

For example, in the template there is a pagebreak between the book cover image above and the page containing the book's title text, copyright and author's name.

A page break also follows the author's name and the table of contents' links.

If you open the template file in a "Text Editor" (such as notepad) or any "HTML Source Editor" you will be able to see these and other hidden tags.

"Comments" have been added to the html source code to make it easier to spot these additions such as;

<!--the following creates a page break-->

Depending on the html editor you use, you may have the option to toggle the ability to see the tags and where they are embedded into the document.

Table of Contents

The "Table of Contents" html solution requires two different components.

First, create a your table of contents links similar to the sample TOC entries shown in the template file.  These links point to "named anchors" located before each chapter or section break. 

When the reader clicks on one of these links, they will be taken to the named anchor location within the book.

The links in the template file are simply samples and must be customized for your book's needs.


The second component that needs to exist for a Table of Contents to work correctly, is not native HTML syntax, but, rather, relates to the various Kindle readers' "Table of Contents" option. 

Each Kindle Reader device or app
contains a "menu-goto" option or a "bookmarks" icon that includes a "Table of Contents" entry.

The html source you submit for publishing needs to tell the publishing process exactly where your html table of contents is located within the book.  If you do not do this, the "Table of Contents" selection under the reader's bookmark navigation will be inactive and "greyed out."

The clue for doing this came from page 11 of the KindlePubGuidelines.pdf which contains additional information concerning the acceptable stucture of an html table of contents submitted for publishing.

The code example contained in the above guide assumes that the code will be in an external html file, however, it is possible to include a reference in the book file itself.  The following is the modified code that references a named anchor showing the location of the toc and the anchor name is "toc" (lowercase in this example and in the template file and it is "case sensitive");

<guide>
<reference type="toc" title="Table of Contents" href="#toc">
</reference>
</guide>

Sample chapter and section breaks are included in the template into order to show the functionalty of the TOC in this sample template.  You can copy the "Chapter 2" sample header using the small text pointers to capture exactly what needs to be copied in order to paste as many chapter or section breaks as you need in your own file.

Hope that this information is of value.
Beverly Howard