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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-13-2017, 12:17 PM   #1
simplisity
Junior Member
simplisity began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2017
Device: Kindle
Preventing Calibre from rewriting custom HTML in recipe?

I have a recipe which outputs custom HTML. When I convert it to EPUB or MOBI in Calibre, a lot of the HTML gets rewritten. Specifically, a lot of the HTML class names get rewritten. For example
Code:
<div class="foobar">
will get rewritten to
Code:
<div class="calibre6">
.

Is there any way to completely prevent Calibre from rewriting or modifying my HTML?

Thank You
simplisity is offline   Reply With Quote
Old 09-13-2017, 01:47 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: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, conversion always flattens CSS.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-13-2017, 05:40 PM   #3
simplisity
Junior Member
simplisity began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2017
Device: Kindle
kovidgoyal:

Thank you for your help. If I wanted to disable the CSS flattening in the Calibre code, should I start by looking at the MOBI and EPUB converter code? Or, should I look somewhere else?
simplisity is offline   Reply With Quote
Old 09-13-2017, 10:16 PM   #4
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: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The conversion pipeline in general depends on CSS flattening. DIsbaling it is no trivial task.
kovidgoyal is offline   Reply With Quote
Old 09-14-2017, 01:01 PM   #5
simplisity
Junior Member
simplisity began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2017
Device: Kindle
kovidgoyal:

Is there at least some way to remove the padding, margin, and bullet points from a "<ul>" tag? Right now, I have this:

Code:
extra_css = (
    """
    #foo ul {
        padding-left: 0px;
        margin-left: 0px;
        list-style-type: none;
    }
    """
)
By the time it gets on the kindle, it looks like these CSS rules get stripped out. Is there some workaround to just get this working?

Thanks for your help.
simplisity is offline   Reply With Quote
Advert
Old 09-14-2017, 01:03 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,002
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Use the editor to load the HTML/CSS and split it as needed and then edit as needed and you've got an ePub as you want.
JSWolf is offline   Reply With Quote
Old 09-14-2017, 09:02 PM   #7
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: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you are converting to MOBI, it does not support any CSS. And if you are converting periodicals, then you have to convert to MOBI, since AZW3, which does support CSS, does not support periodicals.
kovidgoyal is offline   Reply With Quote
Old 09-15-2017, 01:16 AM   #8
simplisity
Junior Member
simplisity began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2017
Device: Kindle
kovidgoyal:

That is very helpful information. Thank you. Is there a technique by which I could create a Recipe which will not behave as a periodical, so that it can be used with AZW3?
simplisity is offline   Reply With Quote
Old 09-15-2017, 01:42 AM   #9
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: 44,380
Karma: 23766374
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Set your output format to EPUB. Then convert the EPUB to azw3, or use the command line ebook-convert tool which can convert .recipe files directly to any format.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Something is preventing custom upgrades on my jailbroken KPW 5.3.1 pirl8 Kindle Developer's Corner 6 02-26-2013 05:55 PM
Calibre Recipe HTML content differs from raw html of index.html. krunk Calibre 4 09-20-2010 09:48 PM
New to Calibre - Recipe/HTML question ClairePMR Calibre 3 07-23-2010 11:53 AM
Custom Recipe CABITSS Introduce Yourself 2 09-22-2009 10:30 AM
Custom Recipe CABITSS Calibre 3 09-22-2009 10:29 AM


All times are GMT -4. The time now is 09:29 AM.


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