Template:Type: Difference between revisions

From FiguraMC
PenguinEncounter (talk | contribs)
No edit summary
Tag: 2017 source edit
PenguinEncounter (talk | contribs)
use fallthrough to reduce byte count
Tag: 2017 source edit
Line 2: Line 2:
  |{{type/link|{{{1}}}|mod={{{2|{{{mod|}}}}}}|link={{{3|{{{link}}}}}}}}
  |{{type/link|{{{1}}}|mod={{{2|{{{mod|}}}}}}|link={{{3|{{{link}}}}}}}}
  |{{#switch:{{{1}}}
  |{{#switch:{{{1}}}
  | nil = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | nil
  | number = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | number
  | numbers = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | numbers
  | double = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | double
  | doubles = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | doubles
  | integer = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | integer
  | integers = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | integers
  | string = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | string
  | strings = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | strings
  | boolean = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | boolean
  | bool = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | bool
  | booleans = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | booleans
  | true = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | true
  | false = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | false
  | function = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | function
  | functions = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | functions
  | table = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | table
  | tables = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | tables = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | {{type/custom|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  | {{type/custom|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}

Revision as of 01:42, 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