View Single Post
Old 10-30-2010, 07:28 PM   #9
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,924
Karma: 4329601
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Well I think I finally got there. I've attached updated HTML and the resulting EPUB.

  1. In the HTML file added some new <h1> and <h2> paragraphs. Look for all references to the word invisible in both the CSS and HTML sections. I also had to remove 5 forced page-breaks, 1 just before each of the 5 Parts begins.

  2. Use these Calibre conversion settings for ZIP to EPUB:
    Code:
    Structure Detection - Detect Chapters at - //h:h1[re:test(@class, "invisible", "i")]
    Structure Detection - Chapter mark - none
    Structure Detection - Insert pagebreaks before - //h:h2[re:test(@class, "invisible", "i")]
    
    Table of Contents - Level 1 TOC - //h:h1[re:test(@class, "invisible", "i")]
    Table of Contents - Level 2 TOC - //h:h2[re:test(@class, "invisible", "i")]
    Table of Contents - Level 3 TOC - //h:h3
    
    Look & Feel - Extra CSS - nothing required here anymore, required CSS now inside HTML file
  3. Tweak the EPUB. I'm not sure why this step is necessary. It may be a slight bug in the conversion process??? It would need to be reported in the Calibre ticket system to have an expert diagnose the problem. However, the above conversion produces an EPUB which looks like your PDF (I think) but as previously, when viewed in the Calibre viewer or the Firefox epubreader addon, if you select a Level 1 TOC item then it points to the wrong place (Level2s and Level3s are fine). I rectified this by using Calibre's EPUB-tweak feature to manually edit the toc.ncx file in a text editor. Only 5 small changes required to correct the destination of each of the Level 1 items (or Parts in your terms) so it points to the first Chapter in the Part, i.e. the same piece of HTML as the next item down in the toc.ncx file.

    I'm guessing that setting Structure Detection - Chapter mark to none is not that common and pagebreak is what most people use. You could then make a 'feature' of the leader page which contains only the 'Part x ~ ...' name, maybe with special formatting or an extra image. If you did it this way no epub-tweaking would be required.

Anyway, see what you think of the new EPUB
Attached Files
File Type: epub Sacred Memories2 - WebFolk.epub (2.90 MB, 59 views)
File Type: zip Sacred Memories2 - WebFolk.zip (2.79 MB, 57 views)

Last edited by jackie_w; 10-30-2010 at 07:34 PM.
jackie_w is offline   Reply With Quote