Template:Type: Difference between revisions

From FiguraMC
No edit summary
PenguinEncounter (talk | contribs)
No edit summary
Tag: 2017 source edit
Line 24: Line 24:
'''Displays a ''type widget''.'''
'''Displays a ''type widget''.'''


Chooses between...
* If a link is provided: [[Template:Type/link]]
* If argument 2 is provided, [[Template:Type/link|use that as the link target]].
* Built-in types: [[Template:Type/builtin]]
* Specialized template for [[Template:Type/builtin|built-in Lua types]].
* Custom types (fallback): [[Template:Type/custom]]. If the page with <code>[argument 1] (type)</code> (i.e. disambiguated) exists, that page will be used instead of the plain name for the link.
* Specialized template for [[Template:Type/custom|custom Figura types]]. If the page with <code>[argument 1] (type)</code> (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)
Stylesheet: [[Template:Type/style.css]] (edit to add colors and decorations for custom types)

Revision as of 00:41, 27 September 2024

Displays a type widget.

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 (optional number)
  • 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/link (links to the Main Page) {{type|Main Page|link=Main Page}}

Testcases page.

Displays and links to types.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Type name1

no description

Suggested values
nil boolean integer number string function table
Unknownrequired
Type modifiersmod 2

Modifiers to the type, like array / optional

Suggested values
[] ? []?
Contentoptional
Custom link targetlink 3

no description

Page nameoptional