diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
| commit | c6cc0108ca7738023b45e0eeac0fa2390532dd93 (patch) | |
| tree | 36890e6cd3091bbab8efbe686cc56f467f645bfd /vendor/github.com/yuin/goldmark-highlighting/v2/README.md | |
| parent | 0130404a1dc663d4aa68d780c9bcb23a4243e68d (diff) | |
| download | jbmafp-master.tar.gz | |
Diffstat (limited to 'vendor/github.com/yuin/goldmark-highlighting/v2/README.md')
| -rw-r--r-- | vendor/github.com/yuin/goldmark-highlighting/v2/README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/vendor/github.com/yuin/goldmark-highlighting/v2/README.md b/vendor/github.com/yuin/goldmark-highlighting/v2/README.md new file mode 100644 index 0000000..5f33672 --- /dev/null +++ b/vendor/github.com/yuin/goldmark-highlighting/v2/README.md @@ -0,0 +1,66 @@ +goldmark-highlighting +========================= + +goldmark-highlighting is an extension for the [goldmark](http://github.com/yuin/goldmark) +that adds syntax-highlighting to the fenced code blocks. + +goldmark-highlighting uses [chroma](https://github.com/alecthomas/chroma) as a +syntax highlighter. + +Installation +-------------------- + +``` +go get github.com/yuin/goldmark-highlighting/v2 +``` + +Usage +-------------------- + +```go +import ( + "bytes" + "fmt" + "github.com/alecthomas/chroma/formatters/html" + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark-highlighting/v2" + +) + +func main() { + markdown := goldmark.New( + goldmark.WithExtensions( + highlighting.Highlighting, + ), + ) + var buf bytes.Buffer + if err := markdown.Convert([]byte(source), &buf); err != nil { + panic(err) + } + fmt.Print(title) +} +``` + + +```go + markdown := goldmark.New( + goldmark.WithExtensions( + highlighting.NewHighlighting( + highlighting.WithStyle("monokai"), + highlighting.WithFormatOptions( + html.WithLineNumbers(), + ), + ), + ), + ) +``` + +License +-------------------- +MIT + +Author +-------------------- +Yusuke Inuzuka |
