No edit summary |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
It accepts one {{Parameter|mandatory}}, one of {{Code|mandatory}}, {{Code|optional}}, {{Code|no}}, or {{Code|none}}. | It accepts one {{Parameter|mandatory}}, one of {{Code|mandatory}}, {{Code|optional}}, {{Code|no}}, or {{Code|none}}. | ||
It also accepts one {{Parameter|optional|string}}, | It also accepts one {{Parameter|optional|string}}, arbitrary text describing the parameter, typically something like {{Code|string}} or {{Code|integer}}. | ||
==Return== | ==Return== | ||
< | <noinclude>None of these will work correctly in the documentation subpage, but will appear in the actual documentation. </noinclude>It's invoked twice above, but for clarity sake... | ||
It's invoked twice above, but for clarity sake... | |||
{{Code|<nowiki>{{Parameter|mandatory}}</nowiki>}} | {{Code|<nowiki>{{Parameter|mandatory}}</nowiki>}} adds the template to the {{Category|Templates with Mandatory Parameters|end}} and returns: {{Return|{{Parameter|mandatory}}}} | ||
{{Parameter|optional| | {{Code|<nowiki>{{Parameter|optional}}</nowiki>}} adds the template to the {{Category|Templates with Optional Parameters|end}} and returns: {{Return|{{Parameter|optional}}}} | ||
{{Code|<nowiki>{{Parameter|no}}</nowiki>}} or {{Code|<nowiki>{{Parameter|none}}</nowiki>}} adds the template to the {{Category|Templates without Parameters|end}} and returns: {{Return|no parameters}}<!--This one is manual, to prevent the template itself from being added to that category.--> | |||
The optional parameter is inserted between the two words. For instance, {{Code|<nowiki>{{Parameter|optional|magenta}}</nowiki>}} returns: {{Return|{{Parameter|optional|magenta}}}} | |||
Latest revision as of 09:44, 16 March 2026
Template:Parameter is used with in the template namespace to identify and categorize templates based on their usage of parameters.
Usage
It accepts one mandatory parameter, one of mandatory, optional, no, or none.
It also accepts one optional string parameter, arbitrary text describing the parameter, typically something like string or integer.
Return
None of these will work correctly in the documentation subpage, but will appear in the actual documentation. It's invoked twice above, but for clarity sake...
{{Parameter|mandatory}} adds the template to the Templates with Mandatory Parameters category and returns:
{{Parameter|optional}} adds the template to the Templates with Optional Parameters category and returns:
{{Parameter|no}} or {{Parameter|none}} adds the template to the Templates without Parameters category and returns:
The optional parameter is inserted between the two words. For instance, {{Parameter|optional|magenta}} returns:
