commands: Modify gen chromastyles to output all CSS classes
authorSteve <acahir@users.noreply.github.com>
Mon, 13 Apr 2020 16:31:33 +0000 (12:31 -0400)
committerGitHub <noreply@github.com>
Mon, 13 Apr 2020 16:31:33 +0000 (18:31 +0200)
Chroma was updated to include a new function to output all CSS
classes without skipping any considered redundant with the current
style.

This will modify the `hugo gen chromastyles` command to use this new
function by default, which avoids potential problems if the style is
later modified.

Also includes requires the updated Chroma (v0.7.2).

Resolves #7167

commands/genchromastyles.go
go.mod
go.sum

index 1f82d764e255914e3fd9cd30127540b607bed034..6d54b6ab49a22272c97da08f9a6543bd75ccbab8 100644 (file)
@@ -68,7 +68,7 @@ func (g *genChromaStyles) generate() error {
        if err != nil {
                return err
        }
-       formatter := html.New(html.WithClasses(true))
+       formatter := html.New(html.WithAllClasses(true))
        formatter.WriteCSS(os.Stdout, style)
        return nil
 }
diff --git a/go.mod b/go.mod
index a8bc9a0db55ebcebe7c2ba41a0ee9ff93edeaa94..904a642caf543c079e90b0c05eee73656c0bbba7 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
        github.com/BurntSushi/toml v0.3.1
        github.com/PuerkitoBio/purell v1.1.1
        github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
-       github.com/alecthomas/chroma v0.7.1
+       github.com/alecthomas/chroma v0.7.2
        github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect
        github.com/armon/go-radix v1.0.0
        github.com/aws/aws-sdk-go v1.27.1
diff --git a/go.sum b/go.sum
index 5122b70692c25f32fdd5288121ab7b89c87942dc..d1de6696bd75060e3cbd08caddc1462b80c212b6 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -42,6 +42,8 @@ github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm
 github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
 github.com/alecthomas/chroma v0.7.1 h1:G1i02OhUbRi2nJxcNkwJaY/J1gHXj9tt72qN6ZouLFQ=
 github.com/alecthomas/chroma v0.7.1/go.mod h1:gHw09mkX1Qp80JlYbmN9L3+4R5o6DJJ3GRShh+AICNc=
+github.com/alecthomas/chroma v0.7.2 h1:B76NU/zbQYIUhUowbi4fmvREmDUJLsUzKWTZmQd3ABY=
+github.com/alecthomas/chroma v0.7.2/go.mod h1:fv5SzZPFJbwp2NXJWpFIX7DZS4HgV1K4ew4Pc2OZD9s=
 github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
 github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
 github.com/alecthomas/kong v0.1.17-0.20190424132513-439c674f7ae0/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI=