View Single Post
Old 07-01-2009, 08:17 AM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Lit files generally don't have a concept of a TOC, so you have to edit the html output before doing a final conversion to epub.

I generally do this (with .6):
  1. Disable Splitting in the conversion dialog - disable split on page breaks and set the max split size to two megabytes
  2. Convert to epub
  3. Unzip the epub
  4. Edit the HTML file, insert line endings as Calibre defaults to no line feeds
  5. Find all the chapters and surround them by H2 or H3 tags
  6. Make any other adjustments merited by taste
  7. Save the HTML
  8. Zip the css file, HTML file, and any embedded images together
  9. Go to the edit metadata dialog for the book, import the zip file as a new format
  10. Open the convert dialog again
  11. Use the zip as the source format
  12. Edit the xpath to match the chapters in the book - change hx if needed to match what you used (h2, h3, h4, etc), edit the regex if needed to match the actual chapters.
  13. set the epub conversion option to split on page breaks
  14. Convert

Last edited by ldolse; 07-01-2009 at 11:50 PM.
ldolse is offline   Reply With Quote