2017-04-19 09:24:01 +00:00
|
|
|
package generator
|
|
|
|
|
|
|
|
import "sort"
|
|
|
|
|
|
|
|
type languageInfo struct {
|
|
|
|
Type string `yaml:"type,omitempty"`
|
2017-05-04 13:03:54 +00:00
|
|
|
Aliases []string `yaml:"aliases,omitempty"`
|
2017-04-19 09:24:01 +00:00
|
|
|
Extensions []string `yaml:"extensions,omitempty,flow"`
|
|
|
|
Interpreters []string `yaml:"interpreters,omitempty,flow"`
|
|
|
|
Filenames []string `yaml:"filenames,omitempty,flow"`
|
2017-07-10 10:50:52 +00:00
|
|
|
MimeType string `yaml:"codemirror_mime_type,omitempty,flow"`
|
2017-04-19 09:24:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func getAlphabeticalOrderedKeys(languages map[string]*languageInfo) []string {
|
|
|
|
keyList := make([]string, 0)
|
|
|
|
for lang := range languages {
|
|
|
|
keyList = append(keyList, lang)
|
|
|
|
}
|
|
|
|
|
|
|
|
sort.Strings(keyList)
|
|
|
|
return keyList
|
|
|
|
}
|