Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emoji ¶
type Emoji struct { Desc string Unicode []rune // 該emoji可能是有很多個codepoints組合而成,例如: red_haired_man: {👨 U+1F468, U+200D, 🦰 U+1F9B0} 是由這三者組合而成: https://apps.timwhitlock.info/unicode/inspect?s=%F0%9F%91%A8%E2%80%8D%F0%9F%A6%B0 Aliases []string // 允許有很多別名 }
type Emojis ¶
func NewEmojis ¶
Example ¶
package main import ( "fmt" "github.com/CarsonSlovoka/goldmark-emoji/v2/def" ) func main() { es := def.NewEmojis( def.NewEmoji("man: red hair", []rune{0x1F468, 0x200D, 0x1F9B0}, "red_haired_man", "man_red_hair"), def.NewEmoji("😊", []rune{0x1F60A}, "blush", "smiling_face_with_smiling_eyes", "微笑"), ) e, _ := es.Get("man_red_hair") fmt.Println(e.Desc) fmt.Printf("%s\n", string(e.Unicode)) fmt.Println(e.Aliases[0]) }
Output: man: red hair 👨🦰 red_haired_man
Click to show internal directories.
Click to hide internal directories.