On Tue, Feb 21, 2012 at 6:16 PM, Simon Cross <[email protected]> wrote: > > I don't know exactly how to achieve this from inside Trac, but > directly from Python you want something like: > > from genshi.template import MarkupTemplate > from genshi import Stream > > def to_str(gnrtr): > return Stream(gnrtr).render() > > s = """<html xmlns:py="http://genshi.edgewall.org/"> > <div py:def="testing_123()">something inside a div </div> > <div data-attr="${Markup(to_str(testing_123()))}" > something </div> > </html>""" > > print MarkupTemplate(s).generate(to_str=to_str).render() >
Thnx very much for the pointer ! I'll let you know how it goes once I get it done . ;) -- Regards, Olemis Facebook => http://www.facebook.com/olemis Twitter => http://www.twitter.com/olemislc (@olemislc) Blog ES => http://simelo-es.blogspot.com Blog EN => http://simelo-en.blogspot.com Quora => http://www.quora.com/olemis Youtube => http://youtube.com/user/greatsoftw Get a signature like this. CLICK HERE. -- You received this message because you are subscribed to the Google Groups "Trac Development" 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/trac-dev?hl=en.
