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:
parent
04782e0678
commit
d80c30ae4e
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user