Difference between revisions of "Template:ApiParam"
Jump to navigation
Jump to search
Template documentation
Joelmartin (talk | contribs) m (Text replacement - "<translate>" to "") |
Joelmartin (talk | contribs) m (Text replacement - "</translate>" to "") |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
<languages /> | <languages /> | ||
− | </noinclude><includeonly>{{#switch: | + | </noinclude><includeonly>{{#switch:<!-- |
-->| =<!-- | -->| =<!-- | ||
− | --><code {{#if:{{{required|}}}|style="font-weight:bold"}} {{#if:{{{id|{{{1|{{{name|}}}}}}}}}|id="{{{id|{{{1|{{{name}}}}}}}}}"}}>{{{1|{{{name|}}}}}}</code>{{#if:{{{2|{{{description|}}}}}}|: {{{2|{{{description|}}}}}}}}{{#if:{{{maxallowed|}}}| <!--T:2--> No more than <tvar|1>{{{maxallowed}}}</> (<tvar|2>{{#if:{{{maxallowedbot|}}}|{{{maxallowedbot}}}|{{#switch:{{{maxallowed}}}|50=500|500=5000}}}}</> for bots) allowed. | + | --><code {{#if:{{{required|}}}|style="font-weight:bold"}} {{#if:{{{id|{{{1|{{{name|}}}}}}}}}|id="{{{id|{{{1|{{{name}}}}}}}}}"}}>{{{1|{{{name|}}}}}}</code>{{#if:{{{2|{{{description|}}}}}}|: {{{2|{{{description|}}}}}}}}{{#if:{{{maxallowed|}}}| <!--T:2--> No more than <tvar|1>{{{maxallowed}}}</> (<tvar|2>{{#if:{{{maxallowedbot|}}}|{{{maxallowedbot}}}|{{#switch:{{{maxallowed}}}|50=500|500=5000}}}}</> for bots) allowed.}}{{#if:{{{type|}}}| '''<!--T:3--> Type:''' {{{type}}}}}{{#if:{{{values|}}}| <!--T:1--> Possible values: {{{values}}}}}{{#if:{{{default|}}}| (<!--T:4--> Default: {{{default}}})}}{{#if:{{{version|}}}| {{MW version-inline|{{#switch:{{#if:{{{removed|}}}|R}} |
|={{{version}}}+ | |={{{version}}}+ | ||
|R={{{version}}}-{{{removed}}} | |R={{{version}}}-{{{removed}}} | ||
Line 12: | Line 12: | ||
{{Documentation|content= | {{Documentation|content= | ||
− | :<!--T:16--> ''Consider replacing invocations of this template with Special:ApiHelp transclusion (<tvar|task>[[phab:T89318]]</>), since filling in this template redundantly repeats API parameter documentation in source code.'' | + | :<!--T:16--> ''Consider replacing invocations of this template with Special:ApiHelp transclusion (<tvar|task>[[phab:T89318]]</>), since filling in this template redundantly repeats API parameter documentation in source code.'' |
Line 18: | Line 18: | ||
<!--T:8--> | <!--T:8--> | ||
− | This template can be used to document API parameters. | + | This template can be used to document API parameters. |
<!--T:9--> | <!--T:9--> | ||
Its intent is to harmonize the appearance of template parameters across all of the API pages. | Its intent is to harmonize the appearance of template parameters across all of the API pages. | ||
− | + | ||
{{Pre2|style=display:inline-block | {{Pre2|style=display:inline-block | ||
Line 40: | Line 40: | ||
<table class="wikitable sortable"> | <table class="wikitable sortable"> | ||
− | <tr><th colspan=2><!--T:17--> ApiParam parameters | + | <tr><th colspan=2><!--T:17--> ApiParam parameters</th></tr> |
− | <tr><th><!--T:18--> Parameter Name | + | <tr><th><!--T:18--> Parameter Name</th><th><!--T:19--> Description</th></tr> |
− | <tr><td><code>'''name'''</code> ''<!--T:20--> (or first unnamed) | + | <tr><td><code>'''name'''</code> ''<!--T:20--> (or first unnamed)''</td><td><!--T:21--> The parameter name (required).</td></tr> |
− | <tr><td><code>description</code> ''<!--T:22--> (or second unnamed | + | <tr><td><code>description</code> ''<!--T:22--> (or second unnamed)''</td><td><!--T:23--> A description of the parameter.</td></tr> |
− | <tr><td><code>required</code></td><td><!--T:24--> Specify a value if the parameter is required. | + | <tr><td><code>required</code></td><td><!--T:24--> Specify a value if the parameter is required. <!--T:25--> The name of the required parameter will be bolded.</td></tr> |
− | <tr><td><code>maxallowed</code></td><td><!--T:26--> For pipe-separated values or numeric quantities, the maximum allowed. | + | <tr><td><code>maxallowed</code></td><td><!--T:26--> For pipe-separated values or numeric quantities, the maximum allowed.</td></tr> |
− | <tr><td><code>maxallowedbot</code></td><td><!--T:27--> As above, for bots. | + | <tr><td><code>maxallowedbot</code></td><td><!--T:27--> As above, for bots. <!--T:28--> If 50 or 500 is used for <code>maxallowed</code>, this will default to 500 or 5000, respectively.</td></tr> |
− | <tr><td><code>type</code></td><td><!--T:29--> The data type of the parameter. | + | <tr><td><code>type</code></td><td><!--T:29--> The data type of the parameter.</td></tr> |
− | <tr><td><code>values</code></td><td><!--T:30--> A list of possible values for the parameter. | + | <tr><td><code>values</code></td><td><!--T:30--> A list of possible values for the parameter.</td></tr> |
− | <tr><td><code>default</code></td><td><!--T:31--> The default value for the parameter. | + | <tr><td><code>default</code></td><td><!--T:31--> The default value for the parameter.</td></tr> |
− | <tr><td><code>version</code></td><td><!--T:32--> The version the parameter was introduced in. | + | <tr><td><code>version</code></td><td><!--T:32--> The version the parameter was introduced in. <!--T:33--> Use the plain MediaWiki version number only.</td></tr> |
− | <tr><td><code>deprecated</code></td><td><!--T:34--> The version the parameter was deprecated in. | + | <tr><td><code>deprecated</code></td><td><!--T:34--> The version the parameter was deprecated in. <!--T:35--> Use the plain MediaWiki version number only.</td></tr> |
− | <tr><td><code>removed</code></td><td><!--T:36--> The version the parameter was removed in. | + | <tr><td><code>removed</code></td><td><!--T:36--> The version the parameter was removed in. <!--T:37--> Use the plain MediaWiki version number only.</td></tr> |
</table> | </table> | ||
== Examples == <!--T:10--> | == Examples == <!--T:10--> | ||
− | + | ||
<pre style="display:inline-block">*{{ApiParam|rcid|One or more recent changes IDs from which to add or remove the tag.|maxallowed=50}}</pre> | <pre style="display:inline-block">*{{ApiParam|rcid|One or more recent changes IDs from which to add or remove the tag.|maxallowed=50}}</pre> | ||
*{{ApiParam|rcid|One or more recent changes IDs from which to add or remove the tag.|maxallowed=50}} | *{{ApiParam|rcid|One or more recent changes IDs from which to add or remove the tag.|maxallowed=50}} | ||
Line 70: | Line 70: | ||
== See also == <!--T:11--> | == See also == <!--T:11--> | ||
− | + | ||
− | * {{tl|Parameter}} – <!--T:12--> older version of <tvar|1>ApiParam</ | + | * {{tl|Parameter}} – <!--T:12--> older version of <tvar|1>ApiParam</> |
}} | }} |
Revision as of 04:20, 21 December 2019

- Consider replacing invocations of this template with Special:ApiHelp transclusion (<tvar