View Single Post
Old 01-15-2017, 08:06 PM   #69
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
To avoid any confusion about how my plugin converts or manipulates the user's inline styles and named text styles in html, I thought that I should explain it more for some clarity.

My plugin is probably unique as a converter in that it reformats or manipulates all html text styles(classes) and in-tag styling on 3 levels:

* If you have linked all your text styles to "Text Body" in OO or LO then all your named styles will show as classes in the html file. These user named styles will also therefore be ported to and will show in the epub as well.

* If you have not used named styles in OO or LO or if your text styles do not inherit "Text Body" then the plugin will use a complex algorithm(yes, the function code is a bit horrifying but it nevertheless works well) and do its best to determine what your inline text styling does and then it will convert your inline styling to a suitably named text class. There are four core text styles that are used for this in the epub CSS: ebk-centered-text, ebk-blocktext, ebk-text-with-indent and ebk-text-no-indent. This feature also helps to reduce the number of meaningless prefixed/indexed classes(which I have always disliked) in the epub html.

* Any in-tag text styling that cannot be determined will be converted to prefixed/indexed named classes of the form: ebk-5, ebk-12, ebk-23 etc.

In other words, from the above, my plugin app will try to adjust to the way you have styled your ODT doc and will give you the epub that you deserve. So if you've used named text styles linked with "Text Body" throughout your doc, then your epub html will look good and will be easy to work with. But if you style your doc without using "Text Body" or named styles -- your epub html won't look so good. Like I said, you get what you deserve with this plugin according to your own styling efforts within the ODT doc.

I also have to say that I couldn't have achieved the above without bs4 and pytidylib. And regarding html manipulations -- I'm now convinced that you can do anything you like in html using bs4. Anything.

Last edited by slowsmile; 01-16-2017 at 01:11 AM.
slowsmile is offline   Reply With Quote