Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 07:00 AM   #1
Whip
Junior Member
Whip began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2024
Device: none
how to use command line to automatically create ToC from all headings?

Hello,

I want to use the command line to convert an html book to epub and select the setting "Generate ToC from all headings." I don't see this option available in the command line interface in the documentation, but it is available in the calibre edit GUI.

Currently, I have to drag the html into calibre, convert to epub, click edit on the converted file, open the ToC GUI, delete the auto-generated ToC, then click "Generate ToC from all headings".

Can someone tell me how to automate this process from the command line with ebook-convert, ebook-edit, or some other tool?

Thank you!
Whip is offline   Reply With Quote
Old Yesterday, 08:07 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,269
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/gen...le-of-contents
kovidgoyal is offline   Reply With Quote
Advert
Old Yesterday, 08:50 AM   #3
Whip
Junior Member
Whip began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2024
Device: none
I looked at that documentation and I don't see an option for exactly what I'm looking for.

Is there a flag for "Generate ToC from all headings"? When I click that button in the GUI, the ToC comes out perfectly. I just don't see a command-line flag for that setting. Can you please point me to it?
Whip is offline   Reply With Quote
Old Yesterday, 09:00 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,281
Karma: 57979022
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
ebook-convert input_file output_file [options]

Did you scroll down in the Help file? There is a TOC section with options
theducks is offline   Reply With Quote
Old Yesterday, 03:07 PM   #5
Whip
Junior Member
Whip began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2024
Device: none
I do not see any setting described in the help documentation that does what I am asking for. I specifically want a command line option that matches the GUI button for "Generate ToC from all headings"

None of the flags in the documentation that I've found describe that option. Do you know how I could select that setting from the command line?
Whip is offline   Reply With Quote
Advert
Old Yesterday, 10:45 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,269
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is no such flag. You need to specify the level1 through level3 settings manually. The button in the GUI does just that under the hood. Read their docs to understand what you need to put there, or look at the conversion log of the GUI conversion to see what values those settings have.
kovidgoyal is offline   Reply With Quote
Reply

Tags
toc, toc creation


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
create a useable TOC when book uses images for chapter headings stumped Sigil 23 06-09-2019 03:12 PM
How to insert automatically valid id's in ToC headings? chaot Editor 18 02-01-2017 06:55 AM
Generated TOC at beginning of PDF via command line alexandreaquiles Conversion 1 10-12-2014 03:24 AM
HTML to Epub conversion isn't generating TOC through command line marcosalles Conversion 1 02-20-2014 10:09 PM
Calibre Command Line Interface TOC bcolflesh Calibre 3 02-04-2010 04:09 PM


All times are GMT -4. The time now is 02:17 AM.


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