|09-26-2011, 11:23 AM||#1|
Join Date: Sep 2011
Device: Kindle 2
adding table of contents to html files
I have a (very) large HTML file that has a very large number of :hx headings that I need to include in a table of contents. Is there an easy way to build the table? Normally, we'd use our HTML editor, but we're having problems with it - it keeps inserting tons of extra, unnecessary code into the file that has to be stripped out before we can process the final file.
I want to keep the file output as HTML so that we can continue to edit it.
|09-30-2011, 03:25 PM||#3|
Join Date: Jun 2010
Device: Kobo Touch; Blackberry w/MobiPocket Reader
Convert it to .mobi first. If your headings are <h1> <h2> or <h3> and the text in the headings includes any of the words:chapter, part, epilogue, prologue, section or book; then the default structure detection will catch those and create a TOC at the end of the book (you can tweak the Xpath expression if it doesn't to to include the appropriate trigger words, or make it use various <p> classes instead to get the TOC created).
Then convert the .mobi back to HTMLZ, and you can then move the TOC part from the end to wherever you want it.
That's the simplest automatic method I've found.
The REAL Joe
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Adding Table of Contents||denmarks||Conversion||4||08-14-2011 11:54 PM|
|ePub or HTML to Mobi Table of Contents problem||Dark123||Conversion||2||05-08-2011 04:43 PM|
|Adding a Table of Contents for PRS-650||daviestown||Recipes||6||12-31-2010 11:39 PM|
|Adding Table of Contents to ePub problems...||cates||Calibre||2||10-10-2010 05:18 PM|
|Table of Contents - html to Mobi problem||thames||Calibre||3||06-02-2010 08:24 PM|