Documentation
¶
Overview ¶
Package emoji is a emoji chars converter for golang.
This package is using Twemoji SVG link with MaxCDN (http://twemoji.maxcdn.com/) by some func, and this charactar map is based by ruby's emot (https://github.com/melborne/emot).
Twemoji Graphics Images is under the CC-BY 4.0: https://creativecommons.org/licenses/by/4.0/ <Copyright (c) 2014 Twitter, Inc and other contributors> ruby's emot is under the MIT: https://github.com/melborne/emot/blob/master/LICENSE.txt <Copyright (c) 2014 kyoendo>
Index ¶
- Constants
- func EmojiTagToHTMLEntities(src string) string
- func EmojiTagToTwemoji(src string, size int, isXHTML bool) string
- func EmojiTagToUnicode(src string) string
- func HTMLEntitiesToUnicode(src string) string
- func UnicodeToEmojiTag(src string) string
- func UnicodeToHTMLEntities(src string) string
- func UnicodeToTwemoji(src string, size int, isXHTML bool) string
Constants ¶
const ( TwemojiHTMLTemplate = `<img src="%s" width="%d" height="%d" >` TwemojiXHTMLTemplate = `<img src="%s" width="%d" height="%d" />` )
Variables ¶
This section is empty.
Functions ¶
func EmojiTagToHTMLEntities ¶
EmojiTagToHTMLEntities is replacing emoji tag to html entities of emoji unicode.
For example: :+1: => 👍
func EmojiTagToTwemoji ¶
EmojiTagToTwemoji is replace emoji tag to twemoji's SVG link with MaxCDN.
Arguments: - src (string) : source string - size (int) : html img tag's height and width valu - isXHTML (bool): output is XHTML (true) or HTML (false)
For Example: :+1: => <img src="//twemoji.maxcdn.com/svg/1f44d.svg" width="16" height="16" />
func EmojiTagToUnicode ¶
EmojiTagToUnicode is replacing emoji tag to unicode chars.
For example: :+1: => rune(0x1F44D)
func HTMLEntitiesToUnicode ¶
HTMLEntitiesToUnicode is replacing html entities of emoji unicode to unicode chars.
For Example: 👍 => rune(0x1F44D)
func UnicodeToEmojiTag ¶
UnicodeToEmojiTag is replacing emoji tag to unicode chars.
For example: rune(0x1F44D) => :+1:
func UnicodeToHTMLEntities ¶
UnicodeToHTMLEntities is replacing unicode emoji chars to html entities.
For Example: rune(0x1F44D) => 👍
func UnicodeToTwemoji ¶
UnicodeToTwemoji is replacing unicode emoji chars to twemoji's SVG link with MaxCDN.
Arguments: - src (string) : source string - size (int) : html img tag's height and width valu - isXHTML (bool): output is XHTML (true) or HTML (false)
For Example: rune(0x1F44D) => <img src="//twemoji.maxcdn.com/svg/1f44d.svg" width="16" height="16" />
Types ¶
This section is empty.