View Single Post
Old 08-10-2024, 08:45 AM   #536
PubFut
Junior Member
PubFut began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2024
Device: Sigil
Generate chapter TOCs

I have another need for a small feature: It should auto-generate a linked chapter TOC in the <nav> section of every chapter/html file including an entry for the current file itself and for all subordinated chapters/files with headings H1 to H3 using classes from sgc-toc.css.

Perhaps this can be done based on the exiting feature for generating a HTML TOC for an entire ebook. But I am not a developer and do not have enough insight.

Otherwise the steps could be:
1. Generate an entry / several entries for the H1-H3 heading of the current file in its <nav> section
2. Add entries for H1-H3 headings of all subordinated files
3. Go to next file: If it is subordinated just copy the generated list from the previous file
4. If it is not subordinated restart with 1.
PubFut is offline   Reply With Quote