View Single Post
Old 07-24-2011, 01:06 AM   #25
Dellu
Member
Dellu began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2011
Device: Nook Simple Touch
Doesn's seem working

Quote:
There are two routes to getting the required table of contents "guide" item into the OPF file:
  • In Sigil, split your HTML content into several files, one for each logical section of the book (e.g. title page, copyright page, table of contents, dedication, foreword, each individual chapter, etc). In the file list on the left of the Sigil window, right click on the table of contents HTML file, select "Add Semantics", then designate it as the "Table of Contents". Save your EPUB file, and import it into Calibre.
  • If you prefer to keep your HTML content in a single file, add an HTML bookmark at the start of the table of contents in the HTML content. When you import the EPUB into Calibre, use Calibre's "tweak epub" feature to open up the EPUB, then open and edit the OPF file and look for a section in the file bounded by opening and closing <guide> tags, and add the following code between those tags:

    Code:
    <reference type="toc" title="Table of Contents" href="html-filename.html#toc-anchor"/>
    (If there isn't already a "guide" section in the OPF file, simply add <guide> at the start and </guide> at the end of the code shown above, and add it after the closing </spine> tag.)

    Save the amended OPF file, then re-form the EPUB.
You can now convert the EPUB file to MOBI format in Calibre, and the existence of the "toc" guide item should ensure that Calibre doesn't automatically create and add another inline TOC to the ebook. When you open the resulting MOBI file in the Kindle, the "Go To... Table of Contents" menu entry should work properly, and cause the display to jump to your hand coded inline TOC.
Thanks for the wonderful explanation. I really want the last option. I have a dozen of books to convert to epub. Marking the headings of each of the contents in Sigil is more time consuming. Since my html has inline bookmarks (contents), the last approach seems to promising. I edited the OPF file as you instructed. But, I couldn't get any Content(Table of contents) in my e-reader.

Last edited by Dellu; 07-24-2011 at 01:15 AM.
Dellu is offline   Reply With Quote