Changes between Version 9 and Version 10 of WikiMacros


Ignore:
Timestamp:
Dec 14, 2014, 5:16:20 PM (9 years ago)
Author:
trac
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v9 v10  
    4848  }}}
    4949}}}
    50 {{{#!td style="padding-left: 2em"
    51 {{{#!html
    52 <div style="font-size: 80%" class="trac-macrolist">
    53 <h3><code>[[Image]]</code></h3>Embed an image in wiki-formatted text.
    54 
    55 The first argument is the file …
    56 <h3><code>[[InterTrac]]</code></h3>Provide a list of known <a class="wiki" href="/wiki/InterTrac">InterTrac</a> prefixes.
    57 <h3><code>[[InterWiki]]</code></h3>Provide a description list for the known <a class="wiki" href="/wiki/InterWiki">InterWiki</a> prefixes.
    58 <h3><code>[[KnownMimeTypes]]</code></h3>List all known mime-types which can be used as <a class="wiki" href="/wiki/WikiProcessors">WikiProcessors</a>.
    59 Can be …</div>
    60 }}}
    61 etc.
     50{{{#!td style="padding-left: 2em; font-size: 80%"
     51[[?]]
    6252}}}
    6353
     
    171161{{{
    172162#!python
    173 from genshi.core import Markup
    174 from trac.wiki.macros import WikiMacroBase
    175 from trac.wiki import Formatter
    176 import StringIO
    177 
    178 class HelloWorldMacro(WikiMacroBase):
    179         def expand_macro(self, formatter, name, text, args):
    180                 text = "whatever '''wiki''' markup you want, even containing other macros"
    181                 # Convert Wiki markup to HTML, new style
    182                 out = StringIO.StringIO()
    183                 Formatter(self.env, formatter.context).format(text, out)
    184                 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())
    185168}}}