Edgewall Software

Changes between Version 6 and Version 7 of WikiMacros


Ignore:
Timestamp:
Nov 16, 2004, 6:14:43 AM (19 years ago)
Author:
daniel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v6 v7  
    11=  Wiki Macros =
    2 Trac macros are plugins to extend the Trac engine with custom 'functions' written in Python. They allow insertion of custom dynamic HTML data in any module supporting WikiFormatting.
     2Trac macros are plugins to extend the Trac engine with custom 'functions' written in Python. A macro inserts dynamic HTML data in any context supporting WikiFormatting.
    33
    44Another kind of macros are WikiProcessors. They typically deal with alternate markup formats and representation of larger blocks of information (like source code highlighting). See also: WikiProcessors.
     
    2323
    2424== Available Macros ==
    25 As of 0.6, macros are still a new feature in Trac, and the list of available (and distributed) macros is
     25Macros are still a 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
     
    4949# MyMacro.py -- The world's simplest macro
    5050
    51 def execute(hdf, args):
     51def execute(hdf, args, env):
    5252    return "Hello World called with args: %s" % args
    5353}}}
     
    6060Example:
    6161{{{
    62 def execute(hdf, args):
     62def execute(hdf, args, env):
    6363    # Currently hdf is set only when the macro is called
    6464    # From a wiki page
     
    7171}}}
    7272
    73 You can also use the environment object that is passed to display configuration data.
     73You can also use the environment (env) object to access configuration data.
    7474
    7575Example.