Changes between Version 1 and Version 2 of WikiMacros


Ignore:
Timestamp:
09/16/05 00:03:53 (20 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v1 v2  
    55
    66== Using Macros ==
    7 Macro calls are enclosed in two ''square brackets''. Like python functions, macros can also have arguments, a comma separated list within parenthesis.
     7Macro calls are enclosed in two ''square brackets''. Like python functions, macros can also have arguments, a comma separated list within parentheses.
    88
    99=== Examples ===
     
    2121 [[HelloWorld(Testing)]]
    2222
     23== Available Macros ==
    2324
    24 == Available Macros ==
    25 Macros are still a new feature, and the list of available (and distributed) macros is
     25Macros are still a relatively new feature, and the list of available (and distributed) macros is
    2626admittedly not very impressive. In future Trac releases, we hope to build a library of useful macros, and will of course happily include contributed macros (see below).
    2727
    2828[[MacroList]]
    2929
    30 
    31 ----
    32 
    33 
    3430== Macros from around the world ==
    35 The [http://projects.edgewall.com/trac/ Trac Project] has a section dedicated to user-contributed macros, [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar]. If you're looking for new macros, or have written new ones to share with the world, don't hesitate adding it to the [http://projects.edgewall.com/trac/wiki/MacroBazaar MacroBazaar] wiki page.
     31The [http://projects.edgewall.com/trac/ Trac Project] has a section dedicated to user-contributed macros, [wiki:MacroBazaar MacroBazaar]. If you're looking for new macros, or have written new ones to share with the world, don't hesitate adding it to the [wiki:MacroBazaar MacroBazaar] wiki page.
    3632
    3733  http://projects.edgewall.com/trac/wiki/MacroBazaar
     
    4642It's easiest to learn from an example:
    4743{{{
     44#!python
    4845# MyMacro.py -- The world's simplest macro
    4946
     
    5956Example:
    6057{{{
     58#!python
    6159def execute(hdf, args, env):
    6260    # Currently hdf is set only when the macro is called
    63     # From a wiki page
     61    # from a wiki page.
    6462    if hdf:
    6563        hdf.setValue('wiki.macro.greeting', 'Hello World')
    6664       
    67     # args will be null if the macro is called without parentesis.
     65    # args will be null if the macro is called without parentheses.
    6866    args = args or 'No arguments'
    6967    return 'Hello World, args = ' + args
     
    7472Example.
    7573{{{
     74#!python
    7675def execute(hdf, txt, env):
    77     return env.config.get('trac', 'repository_dir')
     76    return env.get_config('trac', 'repository_dir')
    7877}}}
     78
     79Here is information on the different WikiMacroObjects.
     80
    7981----
    80 See also:  WikiProcessors, WikiFormatting, TracGuide
     82See also:  WikiProcessors, WikiFormatting, TracGuide, WikiMacroObjects