Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2014, 01:42 PM   #1
marcosalles
Junior Member
marcosalles began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2014
Device: Kindle
HTML to Epub conversion isn't generating TOC through command line

I'm trying to generate an epub from an HTML document. For this, I'm using ebook-convert with the following:

Code:
ebook-convert tmp/livros/kindle/index.html tmp/livros/book.epub \
--authors="Name" \
--level1-toc="//*[name()='h1' or name()='h2']" \
--level2-toc="//h:h3" \
--level3-toc="//*[@class='subsection']" \
--page-breaks-before="//*[(name()='h1' or name()='h2') or @class='owner-name']" \
--use-auto-toc --toc-threshold=0 \
--toc-title="My TOC" \
--embed-all-fonts \
--title="A book"
My HTML file is using h1, h2, h3 and the subsection css class properly. This is a snippet of my index.html file:

Code:
<h2 class='referenceableTitle'>
   <span class="chapter-number">
      <span class="number">Chapter 1</span>:
   </span>
   Chapter name
</h2>

<p>Lorem ipsum...</p>

<div class='referenceable'>
   <h3 class='referenceableTitle'>
      <span class="number">
         1.1
      </span>
      Section name
   </h3>

   <p>lorem ipsum...</p>

</div>
The ebook-convert command we are trying to run is the same one we use to convert to .mobi files from the same html and it works perfectly.

Any ideas of what I am doing wrong?

Cheers
marcosalles is offline   Reply With Quote
Old 02-20-2014, 10:09 PM   #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: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want an inline ToC generated for epub you have to use the --epub-inline-toc option. For mobi the inline toc is inserted by default since the MOBI format requires inline ToCs.
kovidgoyal is offline   Reply With Quote
Reply

Tags
conversion, ebook-convert, html2epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML to MOBI command line convert not generating default cover? DarkAbsynthe Conversion 3 10-19-2013 11:53 PM
New Calibre isn't generating TOC ccraig13 Conversion 2 10-07-2011 09:58 AM
Ebook conversion (EPUB to MOBI) via command line ebooklab Conversion 4 09-16-2011 09:34 PM
Command line conversion of a URL to ePub bmwr1200c Recipes 3 08-11-2011 02:42 PM


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


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