package web
import "strings"
// renderedByDefault says a file opens on its rendered page rather than
// its source: the documents fossil's /file renders unless asked for the
// text (Markdown, fossil wiki, HTML, Pikchr). Plain text is its own
// source, and opens as one.
func renderedByDefault(path string) bool {
dot := strings.LastIndex(path, ".")
if dot < 0 {
return false
}
switch strings.ToLower(path[dot+1:]) {
case "md", "markdown", "wiki", "html", "htm", "pikchr":
return true
}
return false
}