View Single Post
Old 04-10-2011, 11:18 PM   #1
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Adding pynliner to the conversion pipeline for some functions?

There are some functions I've been thinking about adding which would benefit from knowing what the styles for a given tag is. One use is generating more accurate markdown and Textile output by converting italic/bold/etc to the specific tags those converters expect. I was also thinking about a function which could swap between pseudo and real small-caps variants. A number of the existing heuristic functions could also be improved if the style were readily available at that stage in the conversion pipeline.

It seems to me that the easiest way to do this would be to insert all the styles directly into the document, although I'm open to other ideas to go about this.

There is already a python library for taking styles and placing them inline, pynliner:
http://packages.python.org/pynliner/

If that's a good approach, how to I go about retrieving the css file for a given flow?

Note I'm not saying that this should be a default part of the conversion pipeline, just that it can be used when the user enables a feature that would get some advantage from it.
ldolse is offline   Reply With Quote