Quote:
Originally Posted by DaleDe
Interesting list. KindleGen would have fixed some of these issues anyway and some could be done with device specific CSS that KindleGen would have used. However, if you have it all automated there is no reason for you to change. Of course KF7 has no support for CSS at all so some conversions are already happening or are you only supporting KF8?
I do know that some users automatically use a different CSS for Kindle than for regular ePub since it is a simple substitution prior to using KindleGen.
|
I'm not producing the KF7 content myself. That list is what I had to do to my EPUB source just
to make the latest (*) version of Kindlegen convert it properly to KF7/KF8. For KF7, Kindlegen converts the CSS into HTML markup, but does it very badly, with a CSS parser that doesn't properly handle selectors containing multiple elements, multiple class names on single elements, lists of selectors applied to a single rule set, etc., resulting in all sorts of joy for those of us who routinely use nontrivial CSS.
Honestly, if Kindlegen offered a way to provide it separate content for KF7 and KF8, I'd do that in a heartbeat, because I'm pretty sure that a few lines of well-written Perl code would do a better job than Kindlegen. After all, I'm emitting the styles myself in Perl code; it doesn't take much longer to have an "if" statement that causes it to emit tags instead.
Of course, if I were producing a general-purpose solution, I'd use a different approach, using a WebKit WebView to render the content, walk the DOM tree, and blow in tags based on the computed styles for each node. It would probably take only double-digit lines of code in total, and it would put Kindlegen to shame by being 100% correct in its interpretation of the CSS every freaking time.
Basically, Amazon felt the need to reinvent the wheel, both by creating their own format (KF8) for no good reason and by creating their own tools (kindlegen) for no good reason. And as usual, when reinventing the wheel, they had to make it different, so they made it square.... I just don't get it.
But I digress.
(*) As of a few months ago