View Single Post
Old 06-12-2014, 07:28 AM   #33
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,706
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
Hi

After various tries, it seems to work pretty well for longhand CSS stylesheets... but for shorthand. In this latter case, the script just ignores the shorthand properties and lefts it untouched. Adding shorthand to the script conversion capabilities is probably doable, but it would maybe begin to stretch dangerously the regex...

Before coming back - shameful - to pingouinux for this, I thought about another possible solution: I remarked in Calibre/Look and feel that we can use ebook-convert to expand css with the following option:

Code:
--expand-css
Would it be possible to integrate this in the script as a first move ?
That's not something I'm interested in doing. Calibre's code is highly modularized and all the various pieces are dependent upon other pieces (and each other) to function. Rarely can you just pull a small snippet of code from calibre to do what you need. The piece you pull on gets tangled up with one of its dependencies, and before you know it ... you've pulled a mile of code.

Quote:
Here is what we get when launching --expand-css alone:

After that, the script is working quite well.
But that's not running --expand-css alone. That's doing a full epub to epub conversion with --expand-css as an additional option.

Quote:
At that point also, also, we can wonder if it would not be better to integrate the script as a new option within ebook-convert...
That would be less daunting, for sure.
DiapDealer is online now   Reply With Quote