Changes between Version 2 and Version 3 of WikiMacros


Ignore:
Timestamp:
07/06/12 15:43:08 (12 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v2 v3  
    161161{{{ 
    162162#!python 
    163 from genshi.core import Markup 
    164 from trac.wiki.macros import WikiMacroBase 
    165 from trac.wiki import Formatter 
    166 import StringIO 
    167  
    168 class 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()) 
     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()) 
    175168}}}