View Single Post
Old 09-12-2012, 06:01 AM   #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,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
AFAIK, Sigil uses the heading_id tags for the automatic TOC generation. For some odd reason it restarts numbering for each .xhtml source page, however, this doesn't affect TOC generation.

If you want consecutive id tags to simplify the generation of an inline TOC, activate the regular expressions mode, search for id="heading_id_\d+" and replace it with nothing.

Then use a regular expression to add a heading id number based on the chapter number and regenerate the TOC. For example, for a simple h1 chapter heading that contains only the chapter number (e.g. <h1>12</h1>) you'd use:

Find: <h1>(\d+)</h1>
Replace: <h1 id="heading_id_\1">\1</h1>
Doitsu is offline   Reply With Quote