View Single Post
Old 12-06-2020, 01:07 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by mb2u View Post
How can I add more detail to the existing TOC or do I need to start a fresh one?
It's relatively easy to automatically generate a new TOC, if all headings are formatted as h1..h6 tags.

For example:

Code:
<h1>Chapter 1</h1>
Unfortunately, that's rarely the case. Most likely your chapter headings look like this:

Code:
<p class="calibre7"><span class="calibre8">Chapter 1</span></p>
If you're familiar with regular expressions, you can write a regular expression to replace the <p> tags with <h1> tags.

Once all headings are formatted as h1..h6 tags, you can re-generate the TOC:

a) Calibre Editor: Tools > Table of Contents > Edit Table of Contents > Generate ToC from all headings
b) Sigil: Tools > Table of Contents > Generate Table of Contents.

(Of course, you could also manually add/remove TOC entries in Calibre Editor or Sigil.)
Doitsu is offline   Reply With Quote