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

mlange-42 / modo / 12821068519

17 Jan 2025 01:47AM CUT coverage: 36.563%. Remained the same
12821068519

Pull #53

github

web-flow
Merge 0bfc5ef9a into bc43036f2
Pull Request #53: Add CLI help to README

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/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