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

mlange-42 / modo / 12916744138

22 Jan 2025 08:44PM CUT coverage: 61.572%. Remained the same
12916744138

push

github

web-flow
Package for commands, extend CLI help (#100)

* move commands to package
* improve file structure
* remove commented out code
* add guide link to CLI help
* tweak user guide

987 of 1603 relevant lines covered (61.57%)

29.41 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
var formats = map[string]document.Formatter{
18
        "":       &PlainFormatter{},
19
        "plain":  &PlainFormatter{},
20
        "mdbook": &MdBookFormatter{},
21
        "hugo":   &HugoFormatter{},
22
}
23

24
func GetFormatter(f string) (document.Formatter, error) {
×
25
        fm, ok := formats[f]
×
26
        if !ok {
×
27
                return nil, fmt.Errorf("unknown format '%s'. See flag --format", f)
×
28
        }
×
29
        return fm, nil
×
30
}
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