Debian Codegraph @

/

debian golang-github-yuin-goldmark-emoji 1.0.3-1debian golang-github-yuin-goldmark-emoji-dev gomod github.com/yuin/goldmark-emoji debiangogoinimakefilemarkdownshellyaml 18 files · 229 symbols
View dependency graph

Depends on

README (full)

goldmark-emoji

GoDev

goldmark-emoji is an extension for the goldmark that parses :joy: style emojis.

Installation

go get github.com/yuin/goldmark-emoji

Usage

import (
    "bytes"
    "fmt"

    "github.com/yuin/goldmark"
    "github.com/yuin/goldmark-emoji"
    "github.com/yuin/goldmark-emoji/definition"
)

func main() {
    markdown := goldmark.New(
        goldmark.WithExtensions(
            emoji.Emoji,
        ),
    )
    source := `
    Joy :joy:
    `
    var buf bytes.Buffer
    if err := markdown.Convert([]byte(source), &buf); err != nil {
        panic(err)
    }
    fmt.Print(buf.String())
}

See emoji_test.go for detailed usage.

Options

Options for the extension

OptionDescription
WithEmojisDefinition of emojis. This defaults to github emoji set
WithRenderingMethodEntity : renders as HTML entities, Twemoji : renders as an img tag that uses twemoji, Func : renders using a go function
WithTwemojiTemplateTwemoji img tag printf template
WithRendererFuncrenders by a go function

License

MIT

Author

Yusuke Inuzuka

dir _tools/
dir ast/
dir debian/
dir definition/
file .gitignore
file LICENSE
file README.md
file emoji.go
file emoji_test.go
file go.mod
file go.sum