package emoji
Import Path
github.com/yuin/goldmark-emoji (on go.dev)
Dependency Relation
imports 11 packages, and imported by one package
Involved Source Files
package emoji is a extension for the goldmark(http://github.com/yuin/goldmark).
Package-Level Type Names (total 14, in which 7 are exported)
Option interface sets options for this extension.
( T) emojiOption()
ParserOption (interface)
RendererOption (interface)
*withEmojis
*withRendererFunc
*withRenderingMethod
*withTwemojiTemplate
func WithEmojis(value definition.Emojis) Option
func WithRendererFunc(f RendererFunc) Option
func WithRenderingMethod(a RenderingMethod) Option
func WithTwemojiTemplate(s string) Option
func New(opts ...Option) goldmark.Extender
ParserConfig struct is a data structure that holds configuration of
the Emoji extension.
Emojis definition.Emojis
SetOption implements parser.SetOptioner
*T : github.com/yuin/goldmark/parser.SetOptioner
func ParserOption.SetEmojiOption(*ParserConfig)
A ParserOption interface sets options for the emoji parser.
( T) SetEmojiOption(*ParserConfig)
( T) SetParserOption(*parser.Config)
( T) emojiOption()
*withEmojis
T : Option
T : github.com/yuin/goldmark/parser.Option
func NewParser(opts ...ParserOption) parser.InlineParser
RendererConfig struct holds options for the emoji renderer.
Config html.Config
Config.HardWraps bool
Config.Unsafe bool
Config.Writer html.Writer
Config.XHTML bool
Method indicates how emojis are rendered.
RendererFunc is a RendererFunc that renders emojis. This value is valid only when Method is set to Func.
TwemojiTemplate is a printf template for twemoji. This value is valid only when Method is set to Twemoji.
`printf` arguments are:
1: name (e.g. "face with tears of joy")
2: file name without an extension (e.g. 1f646-2642)
3: '/' if XHTML, otherwise ''
SetOption implements renderer.SetOptioner.
*T : github.com/yuin/goldmark/renderer.SetOptioner
func RendererOption.SetEmojiOption(*RendererConfig)
RendererFunc will be used for rendering emojis.
func WithRendererFunc(f RendererFunc) Option
A RendererOption interface sets options for the emoji renderer.
( T) SetConfig(*renderer.Config)
( T) SetEmojiOption(*RendererConfig)
( T) emojiOption()
*withRendererFunc
*withRenderingMethod
*withTwemojiTemplate
T : Option
T : github.com/yuin/goldmark/renderer.Option
func NewHTMLRenderer(opts ...RendererOption) renderer.NodeRenderer
Package-Level Functions (total 7, all are exported)
New returns a new extension with given options.
NewHTMLRenderer returns a new HTMLRenderer.
NewParser returns a new parser.InlineParser that can parse emoji expressions.
WithMaping is a functional option that defines links names to unicode emojis.
WithRendererFunc is a functional option that changes a renderer func.
WithRenderingMethod is a functional option that indicates how emojis are rendered.
WithTwemojiTemplate is a functional option that changes a twemoji img tag.
Package-Level Variables (only one, which is exported)
Emoji is a goldmark.Extender implementation.
Package-Level Constants (total 11, in which 5 are exported)
Entity renders an emoji as an html entity.
Func renders an emoji using RendererFunc.
Twemoji renders an emoji as an img tag with [twemoji](https://github.com/twitter/twemoji).
Unicode renders an emoji as unicode character.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |