Switch to functional options

This commit is contained in:
Tom Payne
2019-12-28 02:55:20 +01:00
committed by Christian Muehlhaeuser
parent 7349948f7f
commit 339b3e9df8
4 changed files with 130 additions and 78 deletions
+4 -4
View File
@@ -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)