refactor: remove frontmatter related functions

This commit is contained in:
Henrique Dias 2018-11-11 16:14:52 +00:00
parent 36f145790d
commit 50f11456a2

View File

@ -415,44 +415,3 @@ func isInTextExtensions(name string) bool {
i := sort.SearchStrings(textExtensions, search) i := sort.SearchStrings(textExtensions, search)
return i < len(textExtensions) && textExtensions[i] == search return i < len(textExtensions) && textExtensions[i] == search
} }
// hasRune checks if the file has the frontmatter rune
func hasRune(file string) bool {
return strings.HasPrefix(file, "---") ||
strings.HasPrefix(file, "+++") ||
strings.HasPrefix(file, "{")
}
func editorMode(language string) string {
switch language {
case "markdown", "asciidoc", "rst":
return "content+metadata"
}
return "content"
}
func editorLanguage(mode string) string {
mode = strings.TrimPrefix(mode, ".")
switch mode {
case "md", "markdown", "mdown", "mmark":
mode = "markdown"
case "yml":
mode = "yaml"
case "asciidoc", "adoc", "ad":
mode = "asciidoc"
case "rst":
mode = "rst"
case "html", "htm", "xml":
mode = "htmlmixed"
case "js":
mode = "javascript"
case "go":
mode = "golang"
case "":
mode = "text"
}
return mode
}