Template:MacroFunction: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=={{{name}}}() Function==
{{#ifeq: {{{trusted|}}} | true | {{TrustedFunction}} |}}
{{#if: {{{version|}}} | * '''Introduced in version {{{version|}}}.''' |}}
{{#if: {{{compatibility|}}} | * '''Last checked for compatibility with version {{{compatibility|}}}.''' |}}
{{{description|}}}
===Usage===
{{{usage}}}
{{#if: {{{example|}}} |
===Example===
{{{example|}}} |}}
{{#if: {{{examples|}}} |
===Examples===
{{{examples|}}} |}}
{{#if: {{{changes|}}} |
===Version Changes===
{{{changes|}}} |}}
<includeonly>[[Category:Macro Function]]</includeonly>
<noinclude>
<noinclude>
==Template Usage==
=Template Usage=
===Example===
''You should always write the description as though the words "This function..." are automatically supplied by the template.''
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==
<pre>{{MacroFunction
<pre>{{MacroFunction
|name=NameOfMacro
|name=exampleFunction
|proposed=true
|deprecated=
[[newFunction|newFunction()]]
|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.
 
If you put a bulleted list here, don't end the description with the list.
MediaWiki encloses this parameter inside a DIV block and it will put the close
DIV tag inside the last LI.  For this reason, you may see description
parameters whose values contain a bulleted list followed by a line
that contains only, "&amp;nbsp;"
{{__TOC__}}
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: NameOfMacro()]
exampleFunction(param1, param2)
</source>
</source>


Line 36: Line 29:
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>
Returns:
<source lang="mtmacro" line>
c,b,a
</source>
</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.
}}</pre>
}}</pre>
</noinclude>
=Source=
</noinclude>{{#ifeq: {{{proposed|}}} | true | {{ProposedChange}} |}}{{#if: {{{deprecated|}}} | {{Deprecated|{{{deprecated}}} |}} |}}
=={{{name}}}() Function==
{{#ifeq: {{{trusted|}}} | true | {{TrustedFunction}} |}}
{{#if: {{{version|}}} | <div class="template_version">• '''Introduced in version {{{version|}}}'''</div> |}}
{{#if: {{{compatibility|}}} | <div class="template_compatibility">• '''Last checked for compatibility with version {{{compatibility|}}}'''</div> |}}<div class="template_description">{{{description|}}}</div>
===Usage===
{{{usage}}}
{{#if: {{{example|}}} |
 
===Example===
<div class="template_example">{{{example|}}}</div> |}}
{{#if: {{{examples|}}} |
 
===Examples===
<div class="template_examples">{{{examples|}}}</div> |}}
{{#if: {{{also|}}} |
===See Also===
<div class="template_also">{{{also|}}}</div> |}}
{{#if: {{{changes|}}} |
===Version Changes===
<div class="template_changes">
{{{changes|}}}
</div> |}}
<includeonly>[[Category:Macro Function]]__NOEDITSECTION__</includeonly>
<noinclude>[[Category:Templates]]</noinclude>

Latest revision as of 07:52, 6 March 2019

Template Usage

You should always write the description as though the words "This function..." are automatically supplied by the template.

Refer to Help:Editing for more detailed documentation.

Example

{{MacroFunction
|name=exampleFunction
|proposed=true
|deprecated=
[[newFunction|newFunction()]]
|trusted=true
|version=1.3b50
|compatibility=1.3b52
|description=
This is an example function.  It doesn't actually exist as a function in MapTool.
If you put a bulleted list here, don't end the description with the list.
MediaWiki encloses this parameter inside a DIV block and it will put the close
DIV tag inside the last LI.  For this reason, you may see description
parameters whose values contain a bulleted list followed by a line
that contains only, "&nbsp;"
{{__TOC__}}
|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.
}}

Source

{{{name}}}() Function

Usage

{{{usage}}}