Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2023, 03:04 PM   #1
AstroCalibre
Enthusiast
AstroCalibre began at the beginning.
 
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
AstroCalibre is offline   Reply With Quote
Old 12-08-2023, 03:51 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 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.
Turtle91 is offline   Reply With Quote
Advert
Old 12-08-2023, 06:21 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
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.
DiapDealer is offline   Reply With Quote
Old 12-08-2023, 06:48 PM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 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.
Turtle91 is offline   Reply With Quote
Old 12-09-2023, 10:34 AM   #5
AstroCalibre
Enthusiast
AstroCalibre began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
Thank you, I'll try the plugins
AstroCalibre is offline   Reply With Quote
Advert
Old 12-09-2023, 10:38 AM   #6
AstroCalibre
Enthusiast
AstroCalibre began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
Quote:
Originally Posted by DiapDealer View Post
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)"?
Hi,
I have attached an image of the TOC Calibre creator.
AstroCalibre is offline   Reply With Quote
Old 12-09-2023, 01:57 PM   #7
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,104
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by AstroCalibre View Post
Hi,
I have attached an image of the TOC Calibre creator.
Where?
Karellen is offline   Reply With Quote
Old 12-09-2023, 04:00 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
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.
DiapDealer is offline   Reply With Quote
Old 12-09-2023, 05:14 PM   #9
AstroCalibre
Enthusiast
AstroCalibre began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
Quote:
Originally Posted by Karellen View Post
Where?
Sorry, I'll try to attach it here again
Attached Thumbnails
Click image for larger version

Name:	Immagine 2023-12-09 163554.jpg
Views:	56
Size:	92.2 KB
ID:	205102  
AstroCalibre is offline   Reply With Quote
Old 12-09-2023, 05:21 PM   #10
AstroCalibre
Enthusiast
AstroCalibre began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Nov 2019
Device: Android smartphone
Quote:
Originally Posted by DiapDealer View Post
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.
Hi, DiapDealer, this is the tooltip of the command:
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
AstroCalibre is offline   Reply With Quote
Old 12-09-2023, 05:44 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
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.
Diap's Editing Toolbox plugin can be easier.
JSWolf is offline   Reply With Quote
Old 12-09-2023, 08:09 PM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 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 …”
Turtle91 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:52 AM.


MobileRead.com is a privately owned, operated and funded community.