Template:Twemoji/doc: Difference between revisions
doc |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Lua|Twemoji}} | |||
[[File:Twemoji12 1f608.svg|thumb|right|150px|smiling imp]] | [[File:Twemoji12 1f608.svg|thumb|right|150px|smiling imp]] | ||
Line 4: | Line 5: | ||
== Usage == | == Usage == | ||
<code>{{Twemoji|'' | <code>{{Twemoji|''emoji''|''title (optional)''|''size (optional, default 20px)''}}</code> | ||
To specify what emoji to render, | === Simple example === | ||
To specify what emoji to render, simply enter the emoji in the first parameter. | |||
So, to | So, to render <nowiki>:smiling_imp:</nowiki> (😈) with this template, you would do: | ||
So, to render <nowiki>: | <code>{{Twemoji|😈}}</code> which outputs {{Twemoji|😈}} | ||
=== Full example === | |||
The second and third parameters are completely optional. | |||
The second parameter can be used to specify a tooltip that will show up when you hover over the emoji. | |||
The third parameter is meant to allow you to override the size of the emoji. Default is "20px". It can also be used to provide [[mediawikiwiki:Help:Images#Rendering a single image|any other image options]]. | |||
So, to render <nowiki>:cold_face:</nowiki> (🥶) with a tooltip of "NIGAR BOOTY CHEEKS" at a size of 30px, you would do: | |||
<code>{{Twemoji|🥶|NIGAR BOOTY CHEEKS|30px}}</code> which outputs {{Twemoji|🥶|NIGAR BOOTY CHEEKS|30px}} | |||
=== Limitations === | |||
Do not put multiple emojis into the same template. If you wanted to render "{{Twemoji|😂}}{{Twemoji|😂}}{{Twemoji|😂}}", <code>{{Twemoji|😂😂😂}}</code> would not work, you would have to do <code>{{Twemoji|😂}}{{Twemoji|😂}}{{Twemoji|😂}}</code>. | |||
Unicode 13 emojis are currently not supported. | |||
== Legacy usage == | |||
Previously, you had to specify the Unicode codepoint for the emoji you wanted to render. | |||
For example, to render <nowiki>:exploding_head:</nowiki> (🤯), you had to do: | |||
<code>{{Twemoji|1f92f}}</code> which outputs {{Twemoji|1f92f}} | |||
This is no longer required, but is still supported. | |||
== Template data == | == Template data == | ||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Emoji", | |||
"description": "The emoji you would like to render. Only use 1 emoji.", | |||
"example": "😈", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"2": { | |||
"label": "Title", | |||
"description": "What will show up when you hover over the emote", | |||
"example": ":smiling_imp:", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"3": { | |||
"label": "Size", | |||
"description": "The size of the emote", | |||
"type": "string", | |||
"default": "20px" | |||
} | |||
}, | |||
"description": "This template will render an emoji from the Twemoji project, which is what Discord uses to render its emojis.", | |||
"format": "inline" | |||
} | |||
</templatedata> |