Template:Infobox command/doc: Difference between revisions

m Undo revision 1850706 by Dhranios (talk)
Examples and templatedata
Line 1: Line 1:
{{documentation header}}
{{documentation header}}
{{Infobox command}}
This template provides a uniform design for the infobox on the [[commands]] page.
This template provides a uniform design for the infobox on the [[commands]] page.


Line 34: Line 33:
| Others restriction.
| Others restriction.
|}
|}
=== Examples ===
==== Empty ====
{{Infobox command}}
<pre>
{{Infobox command}}
</pre>
==== Some ====
{{Infobox command
| name = msg
| alias = * tell * w
| permission = 0
}}
<pre>
{{Infobox command
| name = msg
| alias = * tell * w
| permission = 0
}}
</pre>
==== Everything ====
{{Infobox command
| name = {{{name}}}
| alias = {{{alias}}}
| added = {{{added}}}
| removed = {{{removed}}}
| editions = {{{editions}}}
| oplevel = 1
| nocmdblock = 1
| cheat = 1
| serveronly = 1
| singleplayer = 1
| others = {{{others}}}
| related = {{{related}}}
}}
<pre>
{{Infobox command
| name = {{{name}}}
| alias = {{{alias}}}
| added = {{{added}}}
| removed = {{{removed}}}
| editions = {{{editions}}}
| oplevel = 1
| nocmdblock = 1
| cheat = 1
| serveronly = 1
| singleplayer = 1
| others = {{{others}}}
| related = {{{related}}}
}}
</pre>




Line 52: Line 108:
[[zh:Template:Infobox command/doc]]
[[zh:Template:Infobox command/doc]]
</noinclude>
</noinclude>
<templatedata>
{
"description": "Shows an infobox for a command.",
"format": "block",
"params": {
"name": {
"label": "Name",
"type": "string",
"description": "Name of the command, if it differs from the title."
},
"alias": {
"label": "Aliases",
"type": "string",
"description": "Aliases for this command.",
"aliases": [
"aliases"
]
},
"added": {
"label": "Version added",
"type": "string",
"description": "Version this command was added."
},
"removed": {
"label": "Version removed",
"type": "string",
"description": "Version this command was removed."
},
"oplevel": {
"label": "Permission level",
"type": "number",
"description": "Permission level required to execute this command.",
"suggested": true,
"aliases": [
"op",
"permission"
]
},
"nocmdblock": {
"label": "Restricted to command blocks",
"description": "If set, mentions that this command is only available in command blocks.",
"autovalue": "1",
"aliases": [
"cmdblock",
"noCommandBlock"
]
},
"cheats": {
"label": "Restricted to cheats",
"description": "If set, mentions that this command is only available to players with cheats.",
"autovalue": "1",
"aliases": [
"cheat"
]
},
"serveronly": {
"label": "Restricted to servers",
"description": "If set, mentions that this command is only available on multiplayer servers.",
"autovalue": "1",
"aliases": [
"serverOnly",
"server"
]
},
"singleplayer": {
"label": "Restricted to singleplayer",
"description": "If set, mentions that this command is only available in singleplayer.",
"autovalue": "1",
"aliases": [
"cmdblock",
"noCommandBlock"
]
},
"others": {
"label": "Other restrictions",
"type": "string",
"description": "Any other restrictions to this command.",
"aliases": [
"restrictions"
]
},
"related": {
"label": "Related commands",
"type": "string",
"description": "Related commands."
},
"hidden": {
"label": "Hidden",
"description": "If set, the infobox is hidden.",
"autovalue": "1",
"aliases": [
"disabled"
]
}
}
}
</templatedata>