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

mlange-42 / modo / 12835912779

17 Jan 2025 07:54PM CUT coverage: 57.991% (+0.06%) from 57.927%
12835912779

Pull #58

github

web-flow
Merge 0eafdfbe6 into 45ab35eb0
Pull Request #58: Tweak CLI help, improve code structure

13 of 33 new or added lines in 6 files covered. (39.39%)

762 of 1314 relevant lines covered (57.99%)

6.88 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

NEW
13
func (f *HugoFormatter) Render(docs *document.Docs, config *document.Config) error {
×
NEW
14
        return document.Render(docs, config, f)
×
NEW
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
        return fmt.Sprintf("{{< ref \"%s\" >}}", p), nil
×
41
}
×
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