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

mlange-42 / modo / 12829003556

17 Jan 2025 12:24PM CUT coverage: 56.552% (+20.0%) from 36.563%
12829003556

Pull #54

github

web-flow
Merge 1a1b11cc2 into 41ff6f833
Pull Request #54: More unit tests

32 of 49 new or added lines in 4 files covered. (65.31%)

13 existing lines in 2 files now uncovered.

725 of 1282 relevant lines covered (56.55%)

6.69 hits per line

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

0.0
/format/hugo.go
1
package format
2

3
import (
4
        "fmt"
5
        "path"
6
        "strings"
7

8
        "github.com/mlange-42/modo/document"
9
)
10

11
type HugoFormatter struct{}
12

13
func (f *HugoFormatter) ProcessMarkdown(element any, text string, proc *document.Processor) (string, error) {
×
14
        b := strings.Builder{}
×
15
        err := proc.Template.ExecuteTemplate(&b, "hugo_front_matter.md", element)
×
16
        if err != nil {
×
17
                return "", err
×
18
        }
×
19
        b.WriteRune('\n')
×
20
        b.WriteString(text)
×
21
        return b.String(), nil
×
22
}
23

24
func (f *HugoFormatter) WriteAuxiliary(p *document.Package, dir string, proc *document.Processor) error {
×
25
        return nil
×
26
}
×
27

28
func (f *HugoFormatter) ToFilePath(p string, kind string) (string, error) {
×
29
        if kind == "package" || kind == "module" {
×
30
                return path.Join(p, "_index.md"), nil
×
31
        }
×
32
        return p + ".md", nil
×
33
}
34

35
func (f *HugoFormatter) ToLinkPath(p string, kind string) (string, error) {
×
36
        return fmt.Sprintf("{{< ref \"%s\" >}}", p), nil
×
37
}
×
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