View Single Post
Old 09-02-2024, 06:08 AM   #55
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,193
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by retiredbiker View Post

But I keep finding old short stories from early mystery and sci-fi magazines that have all in-line styling and no CSS files--the only way I've found to deal with those is to convert, as it gets rid of the in-line stuff and creates a CSS file. The originals can be so dense with code it's migraine time to try and read it. No idea how else to do that.

The Editor Chains plugin has an action (Inline styles to CSS) that can transform inline styles to CSS. This process should be straightforward for books that contains only inline styles, as in your use case.

Note however, that in books that have both inline styles and CSS sheets (or style tags), this can lead to problems with formatting, because converting can clash with CSS rules of precedence, specificity .... etc which can make CSS cascade run different before and after conversion.

So to guard against this problem, the plugin will calculate the effective style for each element before and after the conversion to CSS, and if they are not the same for every element, it will not go ahead with the conversion (there is an option to partially override this for only for elements that won't be affected).

Quote:
Originally Posted by retiredbiker View Post

I have come to agree about not converting most of the time
For people who are averse to conversion, the plugin can also automate a lot of things without changing the epub code, this includes things like: transform html, transform css, remove unused CSS, beautify, embed, subset, smarten .... etc.

You can also run your automation on multiple books by using the Action Chains plugin together with Editor Chains.

Last edited by capink; 09-03-2024 at 01:09 AM.
capink is offline   Reply With Quote