• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / modo / 12820506968

17 Jan 2025 12:58AM CUT coverage: 36.563%. Remained the same
12820506968

push

github

web-flow
Add missed Mojo馃敟 emoji (#52)

468 of 1280 relevant lines covered (36.56%)

2.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/format/formats.go
1
package format
2

3
import (
4
        "fmt"
5

6
        "github.com/mlange-42/modo/document"
7
)
8

9
type Format uint8
10

11
const (
12
        Plain Format = iota
13
        MdBook
14
        Hugo
15
)
16

17
func GetFormat(f string) (Format, error) {
脳
18
        fm, ok := formats[f]
脳
19
        if !ok {
脳
20
                return Plain, fmt.Errorf("unknown format '%s'. See flag --format", f)
脳
21
        }
脳
22
        return fm, nil
脳
23
}
24

25
var formats = map[string]Format{
26
        "":       Plain,
27
        "plain":  Plain,
28
        "mdbook": MdBook,
29
        "hugo":   Hugo,
30
}
31

32
var formatters = []document.Formatter{
33
        &PlainFormatter{},
34
        &MdBookFormatter{},
35
        &HugoFormatter{},
36
}
37

38
type Config struct {
39
        Format          Format
40
        CaseInsensitive bool
41
}
42

43
func GetFormatter(f Format) document.Formatter {
脳
44
        return formatters[f]
脳
45
}
脳
STATUS 路 Troubleshooting 路 Open an Issue 路 Sales 路 Support 路 CAREERS 路 ENTERPRISE 路 START FREE 路 SCHEDULE DEMO
ANNOUNCEMENTS 路 TWITTER 路 TOS & SLA 路 Supported CI Services 路 What's a CI service? 路 Automated Testing

漏 2025 Coveralls, Inc