Template:Type: Difference between revisions

From FiguraMC
m depluralize example Vector and Matrix plus suggestion
PenguinEncounter (talk | contribs)
switch to module (part 1 of ?)
Tag: 2017 source edit
Line 1: Line 1:
<includeonly><templatestyles src="Template:Type/style.css"/>{{#if:{{{3|{{{link|}}}}}}
<includeonly><templatestyles src="Template:Type/style.css"/>{{#invoke:Type|run}}</includeonly><noinclude> <!-- Documentation starts here. -->
|{{type/link|{{{1}}}|mod={{{2|{{{mod|}}}}}}|link={{{3|{{{link}}}}}}}}
|{{#switch:{{{1}}}
| nil
| number
| numbers
| double
| doubles
| integer
| integers
| string
| strings
| boolean
| bool
| booleans
| true
| false
| function
| functions
| table
| any
| tables = {{type/builtin|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
| Vectors
| vectors
| Vector
| Vector2
| Vector3
| Vector4 = {{type/vector|{{{1}}}|name=Vector|mod={{{2|{{{mod|}}}}}}}}
| Matrices
| matrices
| Matrix
| Matrix2
| Matrix3
| Matrix4 = {{type/vector|{{{1}}}|name=Matrix|mod={{{2|{{{mod|}}}}}}}}
| {{type/custom|{{{1}}}|mod={{{2|{{{mod|}}}}}}}}
  }}
}}</includeonly><noinclude> <!-- Documentation starts here. -->
'''Displays a ''type widget''.'''
'''Displays a ''type widget''.'''



Revision as of 20:01, 28 September 2024

Displays a type widget.

Stylesheet: Template:Type/style.css (edit to add colors and decorations for custom types)

Examples

  • nil {{type|nil}}
  • number
  • number | nil (optional number)
  • 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 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 Vector Matrix
Unknownrequired
Type modifiersmod 2

Modifiers to the type, like array / optional

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

no description

Page nameoptional