forked from
tangled.org/core
fork
Configure Feed
Select the types of activity you want to include in your feed.
this repo has no description
fork
Configure Feed
Select the types of activity you want to include in your feed.
1package markup
2
3import "strings"
4
5type Format string
6
7const (
8 FormatMarkdown Format = "markdown"
9 FormatText Format = "text"
10)
11
12var FileTypes map[Format][]string = map[Format][]string{
13 FormatMarkdown: []string{".md", ".markdown", ".mdown", ".mkdn", ".mkd"},
14}
15
16func GetFormat(filename string) Format {
17 for format, extensions := range FileTypes {
18 for _, extension := range extensions {
19 if strings.HasSuffix(filename, extension) {
20 return format
21 }
22 }
23 }
24 // default format
25 return FormatText
26}