Registry / utility / yuin-goldmark-highlighting

yuin-goldmark-highlighting

JSON →
library0.0.0-20220924101130-fa6e4c4a0d55gogounverified

Package highlighting is a extension for the goldmark Markdown parser that adds syntax-highlighting to fenced code blocks using chroma.

go get github.com/yuin/goldmark-highlighting
INSTALL
IMPORT
SIG · YUIN-GOLDMARK-HIGH
Y
yuin-goldmark-highlighting
utilitygov0.0.0-20220924101130-fa6e4c4a0d55
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

highlighting
github.com/yuin/goldmark-highlighting

Convert Markdown with syntax-highlighted code blocks.

package main import ( "bytes" "fmt" "github.com/yuin/goldmark" highlighting "github.com/yuin/goldmark-highlighting" ) func main() { markdown := goldmark.New( goldmark.WithExtensions( highlighting.Highlighting, ), ) var buf bytes.Buffer source := []byte("```go\nfmt.Println(\"hello\")\n```") if err := markdown.Convert(source, &buf); err != nil { panic(err) } fmt.Println(buf.String()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20220924101130-fa6e4c4a0d55latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Resources
yuin-goldmark-highlighting — go get yuin-goldmark-highlighting · libregistry