1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-17 20:58:08 +02:00

Sort formatters and styles Names().

This commit is contained in:
Alec Thomas 2017-09-19 11:31:51 +10:00
parent 04782e0678
commit d80c30ae4e
2 changed files with 8 additions and 1 deletions

View File

@ -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
}

View File

@ -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
}