Template:Magic word/doc: Difference between revisions
More actions
→Examples: Add more examples |
Use main {{TemplateBox}} |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{Shared Template Warning|Template:Magic word}} | {{Shared Template Warning|Template:Magic word}} | ||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
{{TemplateBox | {{TemplateBox | ||
| name = Magic word | | name = Magic word | ||
| mbox = | |||
{{Uses TemplateStyles|Template:Mono/styles.css|Template:Nowrap/styles.css}} | |||
| desc-en = Creates a formatted link to the documentation of a magic word. | | desc-en = Creates a formatted link to the documentation of a magic word. | ||
Latest revision as of 20:35, 24 November 2024
Creates a formatted link to the documentation of a magic word.
Usage
{{Magic word}}
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
Creates a formatted link to the documentation of a magic word.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Magic Word | 1 | The name of the magic word or parser function. | String | required |
| Parameter 0 | 2 | The parameter passed immediately after the colon. | Content | optional |
| Extension | ext | The name of the extension that adds the parser function (without the “Extension:” namespace prefix) | String | optional |
| Code? | code | Whether to use <code> styling.
| Boolean | optional |
| Monospaced? | mono | Whether to use `style="font-family:monospace"`.
| Boolean | optional |
| Nowrap? | nowrap | Whether to use `style="white-space:nowrap"`.
| Boolean | optional |
Edit parameter translations
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Examples
{{Magic word|nowrap=1|ext=Translate|#translation}}
renders as:
{{#translation:}}
{{Magic word|mono=1|nowrap=1|ext=Scribunto|#invoke|Example}}
renders as:
{{#invoke:Example}}
{{Magic word|code=1|#language|{{Magic word|PAGELANGUAGE}}}}
renders as:
{{#language:{{PAGELANGUAGE}}}}
See also
Localization
This template is not intended to be localized.