Documentation ¶
Overview ¶
Package emoji handles Unicode emoji.
Index ¶
- func Replace(nodes ...*html.Node) []*html.Node
- type Config
- func (conf *Config) AddEmoji(unicodeEmoji, description string, aliases []string, category string, ...)
- func (conf *Config) AddImage(imageURL, description string, aliases []string, category string, tags []string)
- func (conf *Config) Replace(nodes ...*html.Node) []*html.Node
- func (conf *Config) Search(query string, max int) []SearchResult
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a custom emoji set that extends the default set.
func (*Config) AddEmoji ¶
func (conf *Config) AddEmoji(unicodeEmoji, description string, aliases []string, category string, tags []string)
AddEmoji adds a custom Unicode emoji to the Config.
func (*Config) AddImage ¶
func (conf *Config) AddImage(imageURL, description string, aliases []string, category string, tags []string)
AddImage adds an image as a pseudo-emoji. At least one alias is required.
type SearchResult ¶
type SearchResult struct {
// contains filtered or unexported fields
}
SearchResult is a result from the Search function.
Either Emoji or ImageURL will return a non-empty string, but not both.
func Search ¶
func Search(query string, max int) []SearchResult
Search returns a list of possible emoji for a query. The query is the text between the colon (:) and the user's cursor.
func (SearchResult) Aliases ¶
func (s SearchResult) Aliases() []string
Aliases is a slice of textual shortcodes that can be used between colons to represent the emoji.
func (SearchResult) Description ¶
func (s SearchResult) Description() string
Description is the English textual description of the emoji.
func (SearchResult) ImageURL ¶
func (s SearchResult) ImageURL() string
ImageURL is the URL of an image representing this emoji.
func (SearchResult) Score ¶
func (s SearchResult) Score() int
Score is the likelihood of the result being correct. Higher is better.