Template:TemplatePreview/doc: Difference between revisions
From IdleOn MMO Wiki
(Created page with "This template formats usage previews for templates and accepts up to 8 parameters. == Usage == {{TemplatePreview|TemplatePreview|name|arg1?|arg2?|arg3?|...|arg8?}} {| class="wikitable" style="width: 80%" ! Parameter !! Description |- | ''name'' | The name of the template. |- | ''argN'' (optional) | The names of the parameters that can be passed to the template. Currently up to 8 parameters are supported. Parameters that are optional should end with a "?" character. |}...") |
No edit summary |
||
Line 1: | Line 1: | ||
This template formats | This template formats previews for template usage. It supports both positional and named arguments. | ||
== | == Examples == | ||
{| class="wikitable" style="width: 100%" | |||
{| class="wikitable" style="width: | ! What you type !! What it produces | ||
! | |||
|- | |- | ||
| | | {{TemplatePreview|TemplatePreview|PageType}} || {{TemplatePreview|PageType}} | ||
| | |||
|- | |- | ||
| | | {{TemplatePreview|TemplatePreview|Bitsdisplay|1000}} || {{TemplatePreview|Bitsdisplay|1000}} | ||
| | |- | ||
| {{TemplatePreview|TemplatePreview|MessageBox|title=Hello|content=World}} || {{TemplatePreview|MessageBox|title=Hello|content=World}} | |||
|} | |} | ||
<templatedata> | |||
{ | |||
"description": "", | |||
"params": { | |||
{ | "1": { | ||
"label": "Template Name", | |||
"description": "The name of the template to generate a usage preview for.", | |||
"type": "wiki-template-name", | |||
"required": true | |||
}, | |||
"args": { | |||
"label": "Arguments", | |||
"description": "The template arguments, can be either positional or named." | |||
} | |||
}, | |||
"paramOrder": [ | |||
"1", | |||
"args" | |||
], | |||
"format": "inline" | |||
} | |||
</templatedata> |
Latest revision as of 22:32, 13 June 2024
This template formats previews for template usage. It supports both positional and named arguments.
Examples
What you type | What it produces |
---|---|
{{TemplatePreview|PageType}} |
{{PageType}}
|
{{TemplatePreview|Bitsdisplay|1000}} |
{{Bitsdisplay|1000}}
|
{{TemplatePreview|MessageBox|title=Hello|content=World}} |
{{MessageBox|title=Hello|content=World}}
|
Parameter | Description | Type | Status | |
---|---|---|---|---|
Template Name | 1 | The name of the template to generate a usage preview for. | Template | required |
Arguments | args | The template arguments, can be either positional or named. | Unknown | optional |