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

mlange-42 / modo / 12969829563

26 Jan 2025 12:39AM CUT coverage: 60.763% (-0.8%) from 61.534%
12969829563

Pull #118

github

web-flow
Merge 1f680c59c into 3f25a97de
Pull Request #118: Allow a folder as input, to process recursively

11 of 41 new or added lines in 5 files covered. (26.83%)

3 existing lines in 3 files now uncovered.

988 of 1626 relevant lines covered (60.76%)

28.99 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 Hugo struct{}
12

NEW
13
func (f *Hugo) Accepts(files []string) error {
×
NEW
14
        return nil
×
NEW
15
}
×
16

NEW
17
func (f *Hugo) Render(docs *document.Docs, config *document.Config, subdir string) error {
×
NEW
18
        return document.Render(docs, config, f, subdir)
×
UNCOV
19
}
×
20

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

32
func (f *Hugo) WriteAuxiliary(p *document.Package, dir string, proc *document.Processor) error {
×
33
        return nil
×
34
}
×
35

36
func (f *Hugo) ToFilePath(p string, kind string) (string, error) {
×
37
        if kind == "package" || kind == "module" {
×
38
                return path.Join(p, "_index.md"), nil
×
39
        }
×
40
        return p + ".md", nil
×
41
}
42

43
func (f *Hugo) ToLinkPath(p string, kind string) (string, error) {
×
44
        p, err := f.ToFilePath(p, kind)
×
45
        if err != nil {
×
46
                return "", err
×
47
        }
×
48
        return fmt.Sprintf("{{< ref \"%s\" >}}", p), nil
×
49
}
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