mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-28 04:46:29 -04:00
Switch to functional options
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
7349948f7f
commit
339b3e9df8
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/charmbracelet/glamour"
|
||||
"github.com/charmbracelet/glamour/ansi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -17,9 +16,10 @@ line.
|
||||
Bye!
|
||||
`
|
||||
|
||||
r, _ := glamour.NewTermRenderer("dark", ansi.Options{
|
||||
WordWrap: int(40),
|
||||
})
|
||||
r, _ := glamour.NewTermRenderer(
|
||||
glamour.WithStandardStyle("dark"),
|
||||
glamour.WithWordWrap(40),
|
||||
)
|
||||
|
||||
out, _ := r.Render(in)
|
||||
fmt.Print(out)
|
||||
|
||||
Reference in New Issue
Block a user