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()) |