README.md

 1goldmark-emoji
 2=========================
 3
 4[![GoDev][godev-image]][godev-url]
 5
 6[godev-image]: https://pkg.go.dev/badge/github.com/yuin/goldmark-emoji
 7[godev-url]: https://pkg.go.dev/github.com/yuin/goldmark-emoji
 8
 9goldmark-emoji is an extension for the [goldmark](http://github.com/yuin/goldmark)
10that parses `:joy:` style emojis.
11
12Installation
13--------------------
14
15```sh
16go get github.com/yuin/goldmark-emoji
17```
18
19Usage
20--------------------
21
22```go
23import (
24    "bytes"
25    "fmt"
26
27    "github.com/yuin/goldmark"
28    "github.com/yuin/goldmark-emoji"
29    "github.com/yuin/goldmark-emoji/definition"
30)
31
32func main() {
33    markdown := goldmark.New(
34        goldmark.WithExtensions(
35            emoji.Emoji,
36        ),
37    )
38    source := `
39    Joy :joy:
40    `
41    var buf bytes.Buffer
42    if err := markdown.Convert([]byte(source), &buf); err != nil {
43        panic(err)
44    }
45    fmt.Print(buf.String())
46}
47```
48
49See `emoji_test.go` for detailed usage.
50
51### Options
52
53Options for the extension
54
55| Option | Description |
56| ------ | ----------- |
57| `WithEmojis` | Definition of emojis. This defaults to github emoji set |
58| `WithRenderingMethod` | `Entity` : renders as HTML entities, `Twemoji` : renders as an img tag that uses [twemoji](https://github.com/twitter/twemoji), `Func` : renders using a go function |
59| `WithTwemojiTemplate` | Twemoji img tag printf template |
60| `WithRendererFunc` | renders by a go function |
61
62License
63--------------------
64
65MIT
66
67Author
68--------------------
69
70Yusuke Inuzuka