![]() |
#1 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Create a TOC from html file
Lately I've been trying to use Sigil to edit ebooks. So far I've been using the Calibre editor. I am very happy with Sigil but I have a small problem when I want to create a TOC (Table of contents). With the Calibre editor I have the possibility to generate a TOC from the files (one entry for any html file). Instead in Sigil it seems to me that the only possibility is to create a TOC from the h1-h6 tags, so I'm forced to insert tags in every title, and this wastes a lot of time.
Isn't there another faster way to create a TOC? Thanks for attention |
![]() |
![]() |
![]() |
#2 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,301
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
If you are following standards/best practices then you would already have the <h1-6> to identify a header. You do NOT want to use a <p> or a <div> to identify the headers.
When you do that, a ToC is just a button click away! There are, however, plug-ins that will automagically add headers to your existing ePub. GenerateHeadings: https://www.mobileread.com/forums/sh...d.php?t=352025 ReworkChapterHeads: https://www.mobileread.com/forums/sh...d.php?t=301108 Are a couple of them. |
![]() |
![]() |
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If not the content of specified tags, I'm curious what the calibre feature mentioned uses for the content of a toc created "from the files (one entry for any html file)"?
Last edited by DiapDealer; 12-08-2023 at 06:23 PM. |
![]() |
![]() |
![]() |
#4 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,301
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Another option is to use simple regex to replace your <p>/<div> headers with a proper <h> with the correct # and/or title. That takes only a couple of seconds once you have created the regex and save it as a "saved search".
The saved search would be a template that you could update with each book's particulars. |
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Thank you, I'll try the plugins
|
![]() |
![]() |
![]() |
#6 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,604
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I didn't need an image anyway. I merely want to know what text is being used to create a toc entry for html files in calibre. It can't come from the filenames themselves, so it has to come from somewhere in the html itself (the contents of tags) or manual entry. Either way (sigil or calibre), something needs to be prepared ahead of time for the create toc features to be able to function.
|
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
|
![]() |
![]() |
![]() |
#10 | |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
|
Quote:
Generate a summary from the individual files in the book. Each entry in the table of contents will point to the beginning of the file, and the text of the entry will be the first line of text in the file |
|
![]() |
![]() |
![]() |
#11 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,029
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,301
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Again, read the thread/post. I started providing links to plugins…then, to give the OP multiple options, I said “Another option is to …”
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking at the html of a Kindle Create (kpf) file | Notjohn | Kindle Formats | 1 | 01-15-2019 06:43 PM |
Crash in Sigil while using Create HTML TOC | theducks | Sigil | 17 | 04-06-2015 12:53 PM |
Create HTML File? | Harry Voss | Sigil | 5 | 05-23-2012 01:14 PM |
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... | petercrowell | Kindle Formats | 2 | 05-01-2012 08:14 AM |
HTML input plugin stripping text within toc tags in child html file | nimblebooks | Conversion | 3 | 02-21-2012 03:24 PM |