I forgot to say that currently not much styling information is used by the writer (mwlib.rl). So the usefulness is currently limited. But I'll try to improve that soon.
There is already an enhancement ticket for that in our bugtracker - feel free to update the ticket with stuff that is missing. http://code.pediapress.com/wiki/ticket/76 Regards, Volker Volker Haas wrote: > Hi Isaac, > > the pdf writer is now able to transform css classes into css styles. > This requires some user configuration though. The implementation was > intentionally kept simple and might still have some issues. > > But basically you can now add a transformation map to the > customconfig.py file: > > css_map = { > 'control':'font-size: 110%;font-weight: > bold;background-color:rgb(240, 240, 240);padding: 3px;margin-top: 1em;', > 'doc_key': 'font-weight: bold; display: inline;', > } > > The above example adds the style information to all nodes with the > respective classes. > > <div class="control">...</div> > > is transformed to > > <div style="font-size:110%....margin-top:1em;">...</div> > > I hope this is useful. > > Regards, > Volker > > > Isaac Guenard wrote: > >> Hello Volker >> >> Thanks for your reply. I more or less figured reading the stylesheet >> was going to be outside the scope of the project. I was hoping I might >> be able to add some code that would allow me to translate unrecognized >> tags into something more useful. Or even a pre-parser to strip them >> out and replace them with something else. I'm just not sure where to >> start poking at the code, (and to be honest, I speak very little >> Python). >> >> The site can not be made public at this time, but I have emailed you a >> username and password privately. >> >> Thanks >> Isaac >> >> >> On Jun 2, 7:32 am, Volker Haas <[email protected]> wrote: >> >> >>> Hi Isaac, >>> >>> unfortunately we currently do not fetch and parse CSS files. The pdf >>> writer tries to obey css inline styles - but admittely probably not very >>> many. >>> >>> And we'll probably not change that anytime soon. The problem is that >>> writing a full fledged css parsers is quite some work: the main pain is >>> the precedence in which the styles are applied (inline css vs. css >>> classes vs. IDs. furthermore figuring out the correct inheritance rules >>> for strange constructs seems to be a science by itself). >>> >>> Is your wiki publicly viewable? I'd like to see how much the output >>> differs from the rendering in the browser. >>> >>> Regards, >>> Volker >>> >>> >>> >>> Isaac Guenard wrote: >>> >>> >>>> I have made extensive use of CSS through my wiki in order to help >>>> format a very large manual. For example, I use the following in the >>>> markup >>>> >>>> <div class='control'>label</div> >>>> >>>> Which relates to the following CSS >>>> >>>> .control { >>>> font-size: 110%; >>>> font-weight: bold; >>>> background-color:rgb(240, 240, 240); >>>> padding: 3px; >>>> margin-top: 1em; >>>> } >>>> >>>> I have added these to a custom skin of my own creation in the wiki, >>>> but it seems like the style is ignored when making the PDF. >>>> >>>> Assuming thats the case, is there any way to have these modifications >>>> reflected in the PDF? Is this something I do through customstyles.py? >>>> >>>> Thanks >>>> Isaac >>>> >>>> >>> -- >>> volker haas brainbot technologies ag >>> fon +49 6131 2116394 boppstraße 64 >>> fax +49 6131 2116392 55118 mainz >>> [email protected] http://www.brainbot.com/ >>> >>> >>> >> >> > > -- volker haas brainbot technologies ag fon +49 6131 2116394 boppstraße 64 fax +49 6131 2116392 55118 mainz [email protected] http://www.brainbot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "mwlib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mwlib?hl=en -~----------~----~----~----~------~----~------~--~---
