Keep the text alignment while using xhtml
Bug #1361165 reported by
Mathieu Leplatre
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Appy |
Fix Released
|
Undecided
|
Gaëtan Delannay |
Bug Description
As described in blueprint https:/
Changed in appy: | |
status: | Fix Committed → Fix Released |
assignee: | nobody → Gaëtan Delannay (gaetan-delannay) |
To post a comment you must log in.
Hi Mathieu,
I suppose you would like the "xhtml" function to be able to analyze the CSS property "text-align" in "style" tags.
Indeed, pod does not support this for the moment. Analyzing CSS within style tags is not difficult. What is tricky is that in ODF, any style-related information must be stored in a new style definition. So, for every new combination of CSS properties used in style tags, a new style must dynamically be created in the resulting odt file. This is a headache (to my knowlegde).
In the meanwhile, what you could do (if relevant in your specific case of course) is to use style mappings. Recently, I have added the possibility to implement complex style mappings that can contain CSS attributes.
Let's take an example. If you want to get right-aligned and justified paragraphs in your odt result, define 2 paragraph styles in it, ie named "justified" and "right".
Then, define a styles mapping like that (the syntax is explained in appy/pod/ styles_ manager. py, method "checkStylesMap ping"), either on the global renderer, either as a parameter of a given call to the xhtml function:
stylesMapping= {'p[text- align=justify] ': 'justified', 'p[text- align=right] ': 'right'}
Cheers
G