Changes between Version 1 and Version 2 of WikiMacros


Ignore:
Timestamp:
Feb 8, 2011, 3:06:31 PM (14 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiMacros

    v1 v2  
    88
    99== Using Macros ==
    10 Macro calls are enclosed in two ''square brackets''. Like Python functions, macros can also have arguments, a comma separated list within parentheses. 
     10Macro calls are enclosed in two ''square brackets''. Like Python functions, macros can also have arguments, a comma separated list within parentheses.
    1111
    1212Trac macros can also be written as TracPlugins. This gives them some capabilities that macros do not have, such as being able to directly access the HTTP request.
     
    3636Macros, like Trac itself, are written in the [http://python.org/ Python programming language].
    3737
    38 For more information about developing macros, see the [wiki:TracDev development resources] on the main project site.
     38For more information about developing macros, see the [trac:TracDev development resources] on the main project site.
    3939
    4040
    4141== Implementation ==
    4242
    43 Here are 2 simple examples on how to create a Macro with [wiki:0.11 Trac 0.11] have a look at source:trunk/sample-plugins/Timestamp.py for an example that shows the difference between old style and new style macros and also source:trunk/wiki-macros/README which provides a little more insight about the transition.
     43Here are 2 simple examples showing how to create a Macro with Trac 0.11.
     44
     45Also, have a look at [trac:source:tags/trac-0.11/sample-plugins/Timestamp.py Timestamp.py] for an example that shows the difference between old style and new style macros and at the [trac:source:tags/trac-0.11/wiki-macros/README macros/README] which provides a little more insight about the transition.
    4446
    4547=== Macro without arguments ===
    46 It should be saved as `TimeStamp.py` as Trac will use the module name as the Macro name
     48It should be saved as `TimeStamp.py` (in the TracEnvironment's `plugins/` directory) as Trac will use the module name as the Macro name.
    4749{{{
    4850#!python
     
    5557from trac.wiki.macros import WikiMacroBase
    5658
    57 class TimestampMacro(WikiMacroBase):
     59class TimeStampMacro(WikiMacroBase):
    5860    """Inserts the current time (in seconds) into the wiki page."""
    5961
     
    6769
    6870=== Macro with arguments ===
    69 It should be saved as `HelloWorld.py` (in the plugins/ directory) as Trac will use the module name as the Macro name
     71It should be saved as `HelloWorld.py` (in the TracEnvironment's `plugins/` directory) as Trac will use the module name as the Macro name.
    7072{{{
    7173#!python