Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-04-2010, 12:15 PM   #1
bcolflesh
Junior Member
bcolflesh began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2010
Device: none
Calibre Command Line Interface TOC

Is there an option to specify a TOC file from the command line interface? If so, what is the format for the input file?

If the above is not an option, what is a simple method for correctly creating a valid TOC when using 'ebook-convert' from the command line - bearing in mind that I can dynamically format the input file however I like.

Examples welcome.
bcolflesh is offline   Reply With Quote
Old 02-04-2010, 03:17 PM   #2
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
to see the options for ebook-convert, from a command line type:
Code:
ebook-convert foo.mobi bar.mobi --help
Because of the '--help' at the end of the line, nothing will happen, it will just show you the available switches.
Replace foo.epub and bar.mobi with extensions more appropriate to your task, perhaps foo.html and bar.epub.

G
GRiker is offline   Reply With Quote
Advert
Old 02-04-2010, 03:41 PM   #3
bcolflesh
Junior Member
bcolflesh began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by GRiker View Post
to see the options for ebook-convert, from a command line type:
Code:
ebook-convert foo.mobi bar.mobi --help
Because of the '--help' at the end of the line, nothing will happen, it will just show you the available switches.
Replace foo.epub and bar.mobi with extensions more appropriate to your task, perhaps foo.html and bar.epub.

G
Ok, this shows the contents of the help - which I read online - from the TOC section:

"By default, if the source file has a Table of Contents, it will be used in preference to the automatically generated one."

So, at the beginning of my HTML file, I can make:

<div id="tocdiv">
<a class="toc" href="#chapter1">Chapter 1 link</a>
etc...

Then add the switch:

--level1-toc="//h:a[re:test(@class, 'toc', 'i')]"

to use the links in that div as the TOC?

I'm basing the parameter info on this post:

https://www.mobileread.com/forums/showthread.php?t=63898
bcolflesh is offline   Reply With Quote
Old 02-04-2010, 04:09 PM   #4
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
What happens when you try it?
GRiker is offline   Reply With Quote
Reply

Tags
command line, table of contents, toc

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Calibre Command line and .bat file stratman Calibre 15 01-10-2012 05:38 PM
Autotagging with Calibre (command line) erion Calibre 11 08-28-2010 01:33 PM
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 09:57 AM
calibre command line utilities and calibre defaults astrodad Calibre 2 08-07-2008 03:27 PM
Command line interface to import to libprs500 database astrodad Calibre 3 01-17-2008 10:53 AM


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


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