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

mlange-42 / modo / 12899273857

22 Jan 2025 01:27AM CUT coverage: 62.587% (-0.9%) from 63.46%
12899273857

Pull #91

github

web-flow
Merge 4d4abc2cd into 74accf922
Pull Request #91: CLI rework for sub-commands

19 of 44 new or added lines in 5 files covered. (43.18%)

5 existing lines in 1 file now uncovered.

987 of 1577 relevant lines covered (62.59%)

29.89 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) Render(docs *document.Docs, config *document.Config) error {
×
14
        return document.Render(docs, config, f)
×
15
}
×
16

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

28
func (f *HugoFormatter) WriteAuxiliary(p *document.Package, dir string, proc *document.Processor) error {
×
29
        return nil
×
30
}
×
31

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

39
func (f *HugoFormatter) ToLinkPath(p string, kind string) (string, error) {
×
40
        p, err := f.ToFilePath(p, kind)
×
41
        if err != nil {
×
42
                return "", err
×
43
        }
×
44
        return fmt.Sprintf("{{< ref \"%s\" >}}", p), nil
×
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