diff --git a/formatters/api.go b/formatters/api.go index 9818abc..8710040 100644 --- a/formatters/api.go +++ b/formatters/api.go @@ -2,6 +2,7 @@ package formatters import ( "io" + "sort" "github.com/alecthomas/chroma" "github.com/alecthomas/chroma/formatters/html" @@ -28,6 +29,7 @@ func Names() []string { for name := range Registry { out = append(out, name) } + sort.Strings(out) return out } diff --git a/styles/api.go b/styles/api.go index d0f5a61..f3ce673 100644 --- a/styles/api.go +++ b/styles/api.go @@ -1,6 +1,10 @@ package styles -import "github.com/alecthomas/chroma" +import ( + "sort" + + "github.com/alecthomas/chroma" +) // Registry of Styles. var Registry = map[string]*chroma.Style{} @@ -20,6 +24,7 @@ func Names() []string { for name := range Registry { out = append(out, name) } + sort.Strings(out) return out }