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

mlange-42 / modo / 12775901286

14 Jan 2025 08:31PM CUT coverage: 34.058% (+0.2%) from 33.838%
12775901286

Pull #36

github

web-flow
Merge a0c741f43 into 2dc9d3121
Pull Request #36: Add Hugo export format

16 of 53 new or added lines in 7 files covered. (30.19%)

1 existing line in 1 file now uncovered.

282 of 828 relevant lines covered (34.06%)

2.1 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
        "text/template"
7

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

11
type HugoFormatter struct{}
12

13
const hugoFrontMatter = `+++
14
type = "docs"
15
title = "%s"
16
#summary = """%s"""
17
+++
18

19
%s
20
`
21

NEW
22
func (f *HugoFormatter) ProcessMarkdown(name, summary, text string) (string, error) {
×
NEW
23
        return fmt.Sprintf(hugoFrontMatter, name, summary, text), nil
×
NEW
24
}
×
25

NEW
26
func (f *HugoFormatter) WriteAuxiliary(p *document.Package, dir string, t *template.Template) error {
×
NEW
27
        return nil
×
NEW
28
}
×
29

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

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