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 10-11-2018, 01:44 PM   #1
iliakan
Member
iliakan began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2015
Device: iphone 6
html2epub: classes changed/removed

I have classes, like this:

Code:
<main class="main formatted">
  <div data-trusted="1" class="code-example" data-highlight-block="0-0,3-4">
    <div class="codebox code-example__codebox">
      <div class="codebox__code" data-code="1">
        <pre class="line-numbers language-javascript"><code class="language-javascript">// 1. 
        ...
        </code></pre>
      </div>
    </div>

  </div>
</main>
After ebook-convert, on "processed" stage all classes from "<main>" are removed.
Why?

New class "page" is added to many elements.
Again, why? Couldn't find in sources... Spoils all styles.

Code:
<main>
  <div data-trusted="1" class="page" data-highlight-block="0-0,3-4">
    <div class="page">
      <div class="page" data-code="1">
        <pre class="line-numbers"><code class="language-javascript">
        ...
        </code></pre>
      </div>
    </div>

  </div>
</main>
iliakan is offline   Reply With Quote
Old 10-11-2018, 03:51 PM   #2
iliakan
Member
iliakan began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2015
Device: iphone 6
Oh I see that's "css flattening".

Totally breaks my book. No way to disable it, right?
iliakan is offline   Reply With Quote
Old 10-11-2018, 04:02 PM   #3
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by iliakan View Post
Oh I see that's "css flattening".

Totally breaks my book. No way to disable it, right?
No, not with a calibre conversion. If you want all your CSS to remain perfectly intact you would be better off using calibre to:
  • Create an 'empty' epub.
  • Import or copy-paste your HTML and CSS into the epub using the calibre Editor.
  • Use the Editor's 'split at multiple locations' feature to split your HTML into chapters.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pseudo classes to be deleted as unused classes Leonatus Sigil 2 09-23-2018 09:12 AM
Pseudo classes with classes Macsurfcat ePub 4 01-07-2016 04:00 AM
html2epub lost after installing 0.6 Portnull Calibre 2 07-28-2009 07:09 AM
Image processing using html2epub? Portnull Calibre 2 06-03-2009 12:31 PM
html2epub and OPF files ilovejedd Calibre 4 05-19-2009 03:52 PM


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


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