View Single Post
Old 06-12-2014, 03:50 AM   #32
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
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 ?

Here is what we get when launching --expand-css alone:
After that, the script is working quite well.

Spoiler:

Code:
roger@lmde64:~/Bureau/essai2$ ebook-convert hun.epub hun2.epub --expand-css
1% Conversion de l’entrée en HTML…
InputFormatPlugin: EPUB Input running
on /home/roger/Bureau/essai2/hun.epub
Found HTML cover titlepage.xhtml
Parsing all content...
34% Démarrage des transformations du livre numérique…
Merging user specified metadata...
Detecting structure...
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
67% Exécution du plugin EPUB Output
Splitting markup on page breaks and flow limits, if any...
	Looking for large trees in index_split_012.xhtml...
	No large trees found
	Looking for large trees in index_split_015.xhtml...
	No large trees found
	Looking for large trees in index_split_013.xhtml...
	No large trees found
	Looking for large trees in index_split_002.xhtml...
	No large trees found
	Looking for large trees in index_split_004.xhtml...
	No large trees found
	Looking for large trees in index_split_016.xhtml...
	No large trees found
	Looking for large trees in index_split_014.xhtml...
	No large trees found
	Looking for large trees in index_split_017.xhtml...
	No large trees found
	Looking for large trees in index_split_001.xhtml...
	No large trees found
	Looking for large trees in index_split_005.xhtml...
	No large trees found
	Looking for large trees in index_split_007.xhtml...
	No large trees found
	Looking for large trees in index_split_018.xhtml...
	No large trees found
	Looking for large trees in index_split_019.xhtml...
	No large trees found
	Looking for large trees in index_split_000.xhtml...
	No large trees found
	Looking for large trees in index_split_008.xhtml...
	No large trees found
	Looking for large trees in index_split_006.xhtml...
	No large trees found
	Looking for large trees in index_split_010.xhtml...
	No large trees found
	Looking for large trees in index_split_011.xhtml...
	No large trees found
	Looking for large trees in index_split_003.xhtml...
	No large trees found
	Looking for large trees in index_split_009.xhtml...
	No large trees found
EPUB output written to /home/roger/Bureau/essai2/hun2.epub
Sortie sauvegardée vers   /home/roger/Bureau/essai2/hun2.epub
roger@lmde64:~/Bureau/essai2$


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...

Last edited by roger64; 06-12-2014 at 06:22 AM. Reason: integrate
roger64 is offline   Reply With Quote