More actions
No edit summary Tag: 2017 source edit |
add mod; link is now named Tag: 2017 source edit |
||
Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Type/style.css"/>{{#if:{{{3|{{{link|}}}}}}|{{type/link|{{{1}}}|{{{2}}}|link={{{3|{{{link}}}}}}}}|{{#switch:{{{1}}} | <includeonly><templatestyles src="Template:Type/style.css"/>{{#if:{{{3|{{{link|}}}}}} | ||
| nil = {{type/builtin|{{{1}}}|{{{2}}}}} | |{{type/link|{{{1}}}|mod={{{2|{{{mod}}}}}}|link={{{3|{{{link}}}}}}}} | ||
| number = {{type/builtin|{{{1}}}|{{{2}}}}} | |{{#switch:{{{1}}} | ||
| integer = {{type/builtin|{{{1}}}|{{{2}}}}} | | nil = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| string = {{type/builtin|{{{1}}}|{{{2}}}}} | | number = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| boolean = {{type/builtin|{{{1}}}|{{{2}}}}} | | integer = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| true = {{type/builtin|{{{1}}}|{{{2}}}}} | | string = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| false = {{type/builtin|{{{1}}}|{{{2}}}}} | | boolean = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| function = {{type/builtin|{{{1}}}|{{{2}}}}} | | true = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| table = {{type/builtin|{{{1}}}|{{{2}}}}} | | false = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| {{type/custom|{{{1}}}|{{{2}}}}} | | function = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
}}}}</includeonly><noinclude> <!-- Documentation starts here. --> | | table = {{type/builtin|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | ||
| {{type/custom|{{{1}}}|mod={{{2|{{{mod}}}}}}}} | |||
}} | |||
}}</includeonly><noinclude> <!-- Documentation starts here. --> | |||
'''Displays a ''type widget''.''' | '''Displays a ''type widget''.''' | ||
Line 47: | Line 50: | ||
"required": true | "required": true | ||
}, | }, | ||
" | "link": { | ||
"aliases": [ | |||
"3" | |||
], | |||
"label": "Custom link target", | "label": "Custom link target", | ||
"type": "wiki-page-name" | "type": "wiki-page-name" | ||
}, | |||
"mod": { | |||
"aliases": [ | |||
"2" | |||
], | |||
"label": "Type modifiers", | |||
"description": "Modifiers to the type, like array / optional", | |||
"type": "content", | |||
"suggestedvalues": [ | |||
"[]", | |||
"?", | |||
"[]?" | |||
] | |||
} | } | ||
}, | }, | ||
Line 55: | Line 74: | ||
"paramOrder": [ | "paramOrder": [ | ||
"1", | "1", | ||
" | "mod", | ||
"link" | |||
], | ], | ||
"format": "inline" | "format": "inline" | ||
} | } | ||
</templatedata></noinclude> | </templatedata></noinclude> |
Revision as of 00:24, 27 September 2024
Displays a type widget.
Chooses between...
- If argument 2 is provided, use that as the link target.
- Specialized template for built-in Lua types.
- Specialized template for custom Figura types. If the page with
[argument 1] (type)
(i.e. disambiguated) exists, that page will be used instead of the plain name for the link.
Stylesheet: Template:Type/style.css (edit to add colors and decorations for custom types)
Examples
- Template:Type/builtin
{{type|nil}}
- Template:Type/builtin
- Template:Type/builtin
- Template:Type/builtin
- Template:Type/builtin
- Template:Type/builtin
- Template:Type/custom (custom type that exists)
- Template:Type/custom (custom type that doesn't exist)
- Template:Type/custom (links to the Main Page)
{{type|Main Page|Main Page}}
Displays and links to types.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Type name | 1 | no description
| Unknown | required |
Type modifiers | mod 2 | Modifiers to the type, like array / optional
| Content | optional |
Custom link target | link 3 | no description | Page name | optional |