More actions
No edit summary Tag: 2017 source edit |
m →Examples: Add another example Tag: 2017 source edit |
||
(34 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<templatestyles src="Template:Type/style.css"/>{{# | <includeonly><templatestyles src="Template:Type/style.css"/>{{#invoke:Type|run}}</includeonly><noinclude> <!-- Documentation starts here. --> | ||
'''Displays a ''type widget''.''' | |||
* All options are routed through [[Module:Type]]. (Edit to add aliases or custom links for matching types.) | |||
* Stylesheet: [[Template:Type/style.css]]. (Edit to add colors and decorations for custom types.) | |||
== Examples == | |||
* {{type|nil}} <code><nowiki>{{type|nil}}</nowiki></code> | |||
* {{type|number}} | |||
* {{type|integer}}, {{type|double}}, {{type|float}} | |||
* {{type|numbers|?}} (optional number) | |||
* {{type|numbers|[]}} (array of numbers) | |||
* {{type|string}} | |||
* {{type|boolean}} | |||
* {{type|function}} | |||
* {{type|table}} | |||
* {{type|Vector}} ({{type|Vector2}}, {{type|Vector3}}, {{type|Vector4}}) | |||
* {{type|Matrix}} ({{type|Matrix2}}, {{type|Matrix3}}, {{type|Matrix4}}) | |||
* {{type|Event}} (custom type that exists) | |||
* {{type|CrashAPI}} (custom type that doesn't exist) | |||
* {{type|Main Page|link=Event}} (links to [[Event]]) <code><nowiki>{{type|Main Page|link=Event}}</nowiki></code> | |||
[[Template:Type/testcases|Testcases page.]] | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Type name", | |||
"suggestedvalues": [ | |||
"nil", | |||
"boolean", | |||
"integer", | |||
"number", | |||
"string", | |||
"function", | |||
"table", | |||
"Vector", | |||
"Matrix" | |||
], | |||
"required": true, | |||
"aliases": [ | |||
"name" | |||
], | |||
"description": "Type name ('table' etc.) Supports modifiers, like ? and [].", | |||
"type": "string" | |||
}, | |||
"2": { | |||
"description": "Type modifiers (compatibility)", | |||
"deprecated": "Attach modifiers directly to the type name." | |||
}, | |||
"link": { | |||
"label": "Custom link target", | |||
"type": "wiki-page-name" | |||
}, | |||
"text": { | |||
"label": "Custom text", | |||
"description": "If provided, this text will be displayed instead of the type name. The link and styling will still be determined by the type name.", | |||
"type": "content" | |||
} | |||
}, | |||
"description": "Displays and links to types.", | |||
"paramOrder": [ | |||
"1", | |||
"link", | |||
"text", | |||
"2" | |||
], | |||
"format": "inline" | |||
} | |||
</templatedata></noinclude> |
Latest revision as of 23:56, 29 October 2024
Displays a type widget.
- All options are routed through Module:Type. (Edit to add aliases or custom links for matching types.)
- Stylesheet: Template:Type/style.css. (Edit to add colors and decorations for custom types.)
Examples
- nil
{{type|nil}}
- number
- integer, double, float
- numbers | nil (optional number)
- numbers[] (array of numbers)
- string
- boolean
- function
- table
- Vector (Vector2, Vector3, Vector4)
- Matrix (Matrix2, Matrix3, Matrix4)
- Event (custom type that exists)
- CrashAPI (custom type that doesn't exist)
- Main Page (links to Event)
{{type|Main Page|link=Event}}
Displays and links to types.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Type name | 1 name | Type name ('table' etc.) Supports modifiers, like ? and [].
| String | required |
Custom link target | link | no description | Page name | optional |
Custom text | text | If provided, this text will be displayed instead of the type name. The link and styling will still be determined by the type name. | Content | optional |
2 | 2 | Type modifiers (compatibility) | Unknown | deprecated |