Template:Item/doc: Difference between revisions

Standardizing parameter naming convention to snake_case
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
==Syntax==
==Syntax==
<syntaxhighlight lang="wikitext" copy>
<syntaxhighlight lang="wikitext" copy>
{{Item|}}
{{Item}}
</syntaxhighlight>
</syntaxhighlight>
This template has 2 unnamed parameters:
This template has 2 unnamed parameters:
* {{F|1}} / {{F|name}} &ndash; Name of the item.
* {{F|1}} / {{F|name}} &ndash; Name of the item.
* {{F|2}} / {{F|size}} &ndash; Size of the icon. Default: {{F|30}}.
* {{F|2}} / {{F|size}} &ndash; Size of the icon {{Color|Old|excluding}} the length unit. Default: {{F|30}}.
* {{F|x}} / {{F|count}} &ndash; Quantity of the item. Part of the text.
* {{F|x}} / {{F|count}} &ndash; Quantity of the item.
* {{F|type}} &ndash; Special keyword to adjust the file's suffix and prefix.
* {{F|type}} &ndash; Special keyword to adjust the file's suffix and prefix.
* {{F|link}} &ndash; Set another page to be linked.
* {{F|link}} &ndash; Set another page to be linked.
* {{F|text}} &ndash; Display another text instead of the name of the item.
* {{F|text}} &ndash; Display another text instead of the name of the item.
* {{F|no_text}} &ndash; Set to {{F|1}} to omit the complete text. The icon will no longer behave like an inline-block.
* {{F|no_text}} &ndash; Set to {{F|1}} to omit the complete text.
* {{F|invert}} &ndash; Set to apply a filter to the image for either day/light or night/dark mode. Available values:
** Default &ndash; See: [[Module:Item/Invert]].
** {{F|Day}} &ndash; Invert the image in day/light mode. Will invert light-colored icons to gray in day/light mode.
** {{F|Night}} &ndash; Invert the image in night/dark mode. Will invert dark-colored icons to white in night/dark mode.
* {{F|note}} &ndash; Append a note after the item text and count.
* {{F|note}} &ndash; Append a note after the item text and count.
* {{F|ref}} &ndash; Append a reference to the item text.
* {{F|ref}} &ndash; Append a reference to the item text.
Line 24: Line 28:


==Examples==
==Examples==
{{T|Item|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item}}</nowiki>}}
{{T|Item|p1=Unknown|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Kabuto Beetle}}</nowiki>}}
{{T|Item|p1=Kabuto Beetle|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Kabuto Beetle|size=64}}</nowiki>}}
{{T|Item|p1=Kabuto Beetle|p2=40|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Kabuto Beetle|link=Insect|text=Custom text}}</nowiki>}}
{{T|Item|p1=Kabuto Beetle|p2=link=Insect|p3=text=Custom text|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Dough|x=15|no_text=1}}</nowiki>}}
{{T|Item|p1=Dough|p2=x=15|p3=no_text=1|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Hexia|note=Galaxy}}</nowiki>}}
{{T|Item|p1=Elsasani|_Ybr_=1}}<br />
{{Example|no_copy=1|<nowiki>{{Item|Elsasani|text="Sani"|dot=1}}</nowiki>}}
{{T|Item|p1=Hexia|p2=note=Galaxy|_Ybr_=1}}


==Template Data==
==Template Data==
Line 52: Line 55:
],
],
"label": "Size",
"label": "Size",
"description": "Size of the icon.",
"description": "Size of the icon excluding the length unit.",
"example": "20, 40",
"example": "20, 40",
"type": "number",
"type": "number",
Line 117: Line 120:
"example": "1",
"example": "1",
"type": "boolean"
"type": "boolean"
},
"invert": {
"label": "Invert",
"description": "Set to apply a filter to the image for either day/light or night/dark mode.",
"example": "Day, Night",
"type": "string"
}
}
},
},
Line 128: Line 137:
"link",
"link",
"no_text",
"no_text",
"invert",
"note",
"note",
"ref",
"ref",