Template:MacroFunction: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Added related parameter and moved the usage notes to the top.)
(Updated example, added link to documentation.)
Line 1: Line 1:
<noinclude>
<noinclude>
==Template Usage==
==Template Usage==
All parameters are optional, except '''|name=''' and '''|usage='''. You can use '''|example=''' or '''|examples=''' depending on the number of examples you intend to supply.
Refer to [[Help:Editing]] for more detailed documentation.
===Example===
===Example===
<pre>{{MacroFunction
<pre>{{MacroFunction
|name=NameOfMacro
|name=exampleFunction
|trusted=true
|trusted=true
|version=X.Y
|version=1.3b50
|compatibility=X.Y
|compatibility=1.3b52
|description=
|description=
NameOfMacro is an example of a macro function.  It doesn't actually exist as a function in MapTool.
This is an example function.  It doesn't actually exist as a function in MapTool.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: NameOfMacro()]
exampleFunction(param1, param2)
</source>
</source>


Line 19: Line 19:
This example doesn't really do anything.
This example doesn't really do anything.
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: NameOfMacro()]
[h: exampleVariable = "a,b,c"]
[r: exampleFunction(exampleVariable, reverse)]
</source>
</source>
Returns:
<source lang="mtmacro" line>
c,b,a
</source>
|also=
[[linkToRelatedArticle|Display Name of Related Article]]


|changes=
|changes=
In version X.N this function also didn't exist.
* '''1.3b52''' - Added reverse parameter.
 
|related=
These are links to other articles that are related to this one.
}}</pre>
}}</pre>
</noinclude>
</noinclude>
Line 49: Line 54:
{{#if: {{{related|}}} |
{{#if: {{{related|}}} |


===Related Articles===
===See Also===
{{{related|}}} |}}
{{{also|}}} |}}
<includeonly>[[Category:Macro Function]]</includeonly>
<includeonly>[[Category:Macro Function]]</includeonly>

Revision as of 21:48, 7 March 2009

Template Usage

Refer to Help:Editing for more detailed documentation.

Example

{{MacroFunction
|name=exampleFunction
|trusted=true
|version=1.3b50
|compatibility=1.3b52
|description=
This is an example function.  It doesn't actually exist as a function in MapTool.

|usage=
<source lang="mtmacro" line>
exampleFunction(param1, param2)
</source>

|example=
This example doesn't really do anything.
<source lang="mtmacro" line>
[h: exampleVariable = "a,b,c"]
[r: exampleFunction(exampleVariable, reverse)]
</source>
Returns:
<source lang="mtmacro" line>
c,b,a
</source>

|also=
[[linkToRelatedArticle|Display Name of Related Article]]

|changes=
* '''1.3b52''' - Added reverse parameter.
}}

{{{name}}}() Function

Usage

{{{usage}}}