Skip to content

Commit

Permalink
Bump glamour dependency and adopt functional options API
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Dec 28, 2019
1 parent fa9d64c commit 79fad4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/charmbracelet/glow
go 1.13

require (
github.com/charmbracelet/glamour v0.0.0-20191224014535-3a479d0c8515
github.com/charmbracelet/glamour v0.0.0-20191228015520-339b3e9df8f4
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.4
github.com/spf13/cobra v0.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ github.com/alecthomas/kong-hcl v0.1.8-0.20190615233001-b21fea9723c8/go.mod h1:MR
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY=
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/charmbracelet/glamour v0.0.0-20191224014535-3a479d0c8515 h1:veOhtHNb5vZMTYneGZOj7A1S+0gU9df6ftoWaTo6Gfo=
github.com/charmbracelet/glamour v0.0.0-20191224014535-3a479d0c8515/go.mod h1:pnwzzHkgr91y3cCdPydiwDkJjApGSkUCXj2kYJyVQM8=
github.com/charmbracelet/glamour v0.0.0-20191228015520-339b3e9df8f4 h1:DrAUDqoZs9kxigJTmKnCECFxxEjtV72prWMOHorJhzM=
github.com/charmbracelet/glamour v0.0.0-20191228015520-339b3e9df8f4/go.mod h1:pnwzzHkgr91y3cCdPydiwDkJjApGSkUCXj2kYJyVQM8=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/spf13/cobra"

"github.com/charmbracelet/glamour"
"github.com/charmbracelet/glamour/ansi"
)

var (
Expand Down Expand Up @@ -130,10 +129,11 @@ func execute(cmd *cobra.Command, args []string) error {
baseURL = u.String() + "/"
}

r, err := glamour.NewTermRenderer(style, ansi.Options{
BaseURL: baseURL,
WordWrap: int(width),
})
r, err := glamour.NewTermRenderer(
glamour.WithStylePath(style),
glamour.WithWordWrap(int(width)),
glamour.WithBaseURL(baseURL),
)
if err != nil {
return err
}
Expand Down

0 comments on commit 79fad4d

Please sign in to comment.