Changes between Version 5 and Version 6 of WikiMacros


Ignore:
Timestamp:
13/10/2010 10:12:56 (14 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v5 v6  
    161161{{{
    162162#!python
    163     text = "whatever wiki markup you want, even containing other macros"
    164     # Convert Wiki markup to HTML, new style
    165     out = StringIO()
    166     Formatter(self.env, formatter.context).format(text, out)
    167     return Markup(out.getvalue())
     163from genshi.core import Markup
     164from trac.wiki.macros import WikiMacroBase
     165from trac.wiki import Formatter
     166import StringIO
     167
     168class HelloWorldMacro(WikiMacroBase):
     169        def expand_macro(self, formatter, name, text, args):
     170                text = "whatever '''wiki''' markup you want, even containing other macros"
     171                # Convert Wiki markup to HTML, new style
     172                out = StringIO.StringIO()
     173                Formatter(self.env, formatter.context).format(text, out)
     174                return Markup(out.getvalue())
    168175}}}