Template:Twemoji/doc: Difference between revisions

From Irony Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 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>&#123;{Twemoji|''codepoint''|''title (optional)''|''size (optional)''}}</code>
<code>&#123;{Twemoji|''emoji''|''title (optional)''|''size (optional, default 20px)''}}</code>


To specify what emoji to render, you will have to enter the Unicode codepoint of the emoji. Yeah, I wish you could just type the emoji too, but I don't know how to make that work without it either slowing down the wiki or being massively time-consuming for me to do.
=== Simple example ===
To specify what emoji to render, simply enter the emoji in the first parameter.


So, to find the codepoint of the emoji you want, you can go to [https://emojipedia.org/ Emojipedia] and enter your emoji into the search bar. Once you're at the page for your emoji, scroll down until you find the "Codepoints" section. There, it should say something like "U+1F608". That "1F608" is the codepoint you need. Do not include "U+" in the template. You will need to convert any capital letters to lowercase letters too; so it would be "1f608" instead of "1F608", otherwise it won't work.
So, to render <nowiki>:smiling_imp:</nowiki> (😈) with this template, you would do:


So, to render <nowiki>:smiling_imp:</nowiki> (😈) with this template, you would do:
<code>&#123;{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>&#123;{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>&#123;{Twemoji|😂😂😂}}</code> would not work, you would have to do <code>&#123;{Twemoji|😂}}&#123;{Twemoji|😂}}&#123;{Twemoji|😂}}</code>.
 
Unicode 13 emojis are currently not supported.


<code>&#123;{Twemoji|1f608}}</code> which outputs {{Twemoji|1f608}}
== Legacy usage ==
Previously, you had to specify the Unicode codepoint for the emoji you wanted to render.


If your emoji has two codepoints, such as for a flag or emoji with skin tone, put a hyphen between the two codepoints.
For example, to render <nowiki>:exploding_head:</nowiki> (🤯), you had to do:


For example, to render the nigga santa emoji (🎅🏿) with this template, you would do:
<code>&#123;{Twemoji|1f92f}}</code> which outputs {{Twemoji|1f92f}}


<code>&#123;{Twemoji|1f385-1f3ff}}</code> which outputs {{Twemoji|1f385-1f3ff}}
This is no longer required, but is still supported.


== Template data ==
== Template data ==
Line 25: Line 44:
"params": {
"params": {
"1": {
"1": {
"label": "Emoji codepoint",
"label": "Emoji",
"description": "The Unicode codepoint of the emoji you would like to render. For a detailed explanation, see the template documentation [[Template:Twemoji]]",
"description": "The emoji you would like to render. Only use 1 emoji.",
"example": "1f608",
"example": "😈",
"type": "string",
"type": "string",
"required": true
"required": true

Latest revision as of 04:24, 25 April 2021

smiling imp

This template will render an emoji from the Twemoji project, which is what Discord uses to render its emojis.

Usage[edit source]

{{Twemoji|emoji|title (optional)|size (optional, default 20px)}}

Simple example[edit source]

To specify what emoji to render, simply enter the emoji in the first parameter.

So, to render :smiling_imp: (😈) with this template, you would do:

{{Twemoji|😈}} which outputs 😈

Full example[edit source]

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 any other image options.

So, to render :cold_face: (🥶) with a tooltip of "NIGAR BOOTY CHEEKS" at a size of 30px, you would do:

{{Twemoji|🥶|NIGAR BOOTY CHEEKS|30px}} which outputs 🥶

Limitations[edit source]

Do not put multiple emojis into the same template. If you wanted to render "😂😂😂", {{Twemoji|😂😂😂}} would not work, you would have to do {{Twemoji|😂}}{{Twemoji|😂}}{{Twemoji|😂}}.

Unicode 13 emojis are currently not supported.

Legacy usage[edit source]

Previously, you had to specify the Unicode codepoint for the emoji you wanted to render.

For example, to render :exploding_head: (🤯), you had to do:

{{Twemoji|1f92f}} which outputs

This is no longer required, but is still supported.

Template data[edit source]

This template will render an emoji from the Twemoji project, which is what Discord uses to render its emojis.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Emoji1

The emoji you would like to render. Only use 1 emoji.

Example
😈
Stringrequired
Title2

What will show up when you hover over the emote

Example
:smiling_imp:
Stringsuggested
Size3

The size of the emote

Default
20px
Stringoptional