Template:Magic word/doc
Warning: | Do not edit. This page is maintained by an automated tool. All edits should be done at mediawiki.org. (translate this warning) |
This template uses TemplateStyles: |
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
[ subpage]
Template links
editCode | Result | Notes | lock |
---|---|---|---|
{{T|example}} |
{{Example}} | makes brackets part of the link; see docu | |
{{T0|example}} |
Example | just link, without the brackets; see docu | |
{{T1|example}} |
{{Example}} | inner brackets are part of the link; see docu | |
{{T2|example}} |
{{Example}} | brackets are not a part of the link; see docu | |
{{Tl|example}} |
{{Example}} | makes brackets around the link; see docu | |
{{Tls|example}} |
{{subst:example}} | no parameters, adds "subst:" | |
Templates showing parameters Meta template {{Tle}} is easiest to parametrize. | |||
{{Tle|T=F|p1=1|v1|p2=2|v2|p3=3|v3}} |
{{ F | 1 = v1 | 2 = v2 | 3 = v3 }} |
decribes template parameters by names and values | |
{{Tlx|example|1|2|3|4|5||7|8|9}} |
{{example|1|2|3|4|5|7|8|...}} | up to 8 parameters | |
{{Tlf|example|1|2|3|...up to 8}} |
{{example|1|2|3|...up to 8}} | up to 8 parameters, no link; see docu | |
{{Tlc|example|1|2|3|4|||7|up to 8|9}} |
{{example|1|2|3|4|||7|up to 8}} |
up to 8 parameters, no link, <code> style |
|
{{Tld|example|1|2||3||}} |
{{example|1||2|3||}} | up to 8 parameters, <code> style; see docu |
|
{{Tlr|User:Example}} |
{{User:Example}} | like {{tl}} but for any namespace | |
{{Tlsu|User:Example}} |
{{subst:User:Example}} | like {{tlr}}, but also adds "subst:" | |
Alternative forms These ignore empty parameters. | |||
{{Tlp|example|1|2|3|4|5||7|8|9}} |
{{example|1|2|3|4|5|7|8}} | up to 8 parameters; ignores empty parms | |
{{Tl2|example|p1|p2}} |
{{example|p1|p2}} |
up to 2 parameters, <code> style; see docu |
|
{{Tlsp|example|1|2|3|4|5|6|7|8|9}} |
{{subst:example|1|2|3|4|5|6|7|8|...}} | up to 8 parameters, adds linked "subst:"; see doc | |
{{Tlsx|example|1|2|3|4|5|6|7|8|9}} |
{{subst:example|1|2|3|4|5|...}} |
up to 5 parameters, adds linked "subst:", <code> style |
General-purpose formatting
editText style ↓ | {{tlg}} options[note 1] to achieve text style |
Link style | ||||
---|---|---|---|---|---|---|
Linked | Unlinked | Linked with subst | Unlinked with subst | Linked including braces | ||
{{tlg}} options[note 1] to achieve link style |
N/A | DEFAULT | nolink=yes
|
subst=yes
|
nolink=yes
|
braceinside=yes
|
normal | DEFAULT |
|
|
N/A | ||
code
|
code=yes
|
|
|
N/A | ||
monospace | plaincode=yes |
N/A | N/A | |||
kbd | kbd=yes |
- ↑ a b c
{{tlg}}
is the most general template, allowing any combination of text style and/or link style options. - ↑ a b c d e Prevents wrapping of text by placing it inside
<span class="nowrap">...</span>
tags. - ↑ a b c Allows links to templates in any namespace.
- ↑
{{tlg|plaincode=yes}}
uses<code style="border: none; background-color: transparent;">...</code>
. - ↑ a b c d Displays monospaced font using
<span style="font-family: monospace;">...</span>
.
Localization
This template is not intended to be localized.