![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 166
Karma: 474196
Join Date: Jan 2011
Location: Canada
Device: Kobo Libra 2
|
"Reverse" TOC generation - generate <h> tags at TOC points.
I've got an ebook that uses images for chapter titles, and don't have a "title" parameter. The book has its own table of contents, but they don't point directly to the images (they're just wrapped in <p>'s), and I'm curious if there's a way to have Sigil insert <h> tags at files/positions denoted by the existing table of contents, with the TOC element name as title? For example, I've currently got something like:
Code:
<p><img src="ch04.jpg"/></p> Code:
<h1 title="CHAPTER 7: MY ELBOW HURTS"/> <p><img src="ch04.jpg"/></p> Code:
<h1 title="CHAPTER 7: MY ELBOW HURTS"><img src="ch04.jpg"/></h1> |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,438
Karma: 5702578
Join Date: Nov 2009
Device: many
|
You might try my TOCSaver plugin but I have not played with it in years:
https://www.mobileread.com/forums/sh...d.php?t=333097 Please read this first: Before Running on ePub3 This plugin will only parse the NCX ToC. So if you have an epub3 and want to save the Nav ToC, then use Sigil's ePub3 Tools to generate an NCX from the current Nav before launching the plugin. Notes Since this plugin could make changes to many xhtml files, it would be either a good idea to make a CheckPoint before running the plugin, or at the very least do a File Save-As under a new name, to make sure nothing is ever lost. Last edited by KevinH; 06-06-2023 at 01:59 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 166
Karma: 474196
Join Date: Jan 2011
Location: Canada
Device: Kobo Libra 2
|
Hey! That worked exactly as I was hoping! And it didn't seem to break anything using Sigil v1.9.30, so it's held up well for not having an update in nearly three years.
![]() Thanks! |
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,438
Karma: 5702578
Join Date: Nov 2009
Device: many
|
Glad to hear it still works and helped. FWIW, I made no updates because no one has reported any bugs yet. I am a firm believer in "if it ain't broke, don't fix it!"
![]() |
![]() |
![]() |
![]() |
Tags |
table of contents, toc |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
suggestion: add "apply" or "save" functionality in edit toc | davidhcje | Editor | 1 | 08-20-2021 10:40 PM |
Request: "Are You Sure" Prompt for "Edit ToC" | enuddleyarbl | Calibre | 2 | 07-27-2021 11:15 PM |
"generate ToC from all headings" doesn't save newly created entries | davidhcje | Calibre | 0 | 05-30-2021 01:19 AM |
Embed the functions of "TOC Edit" into "TOC Tab"? | hhtmp88 | Plugins | 2 | 08-20-2020 02:09 PM |
Getting calibre to detect "Prologue" and "Epilogue" for TOC | sherman | Calibre | 2 | 09-20-2010 02:21 AM |