Changes between Version 4 and Version 5 of WikiMacros


Ignore:
Timestamp:
Dec 2, 2010, 11:17:40 PM (13 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v4 v5  
    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}}}