From bac12e68b13cefe4bdfedaab84149e8881be945f Mon Sep 17 00:00:00 2001 From: uint Date: Fri, 19 Dec 2025 21:29:53 +0000 Subject: rename fix_md_references->replace_md_references; better naming --- kew.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/kew.go b/kew.go index 509c246..208136d 100644 --- a/kew.go +++ b/kew.go @@ -79,21 +79,6 @@ func copy_file(src string, dst string) error { return err } -func fix_md_references(s string) string { - r := strings.NewReplacer( - /* common cases */ - ".md)", ".html)", - ".md\"", ".html\"", - ".md'", ".html'", - ".md)", ".html)", - ".md#", ".html#", - ".md>", ".html>", - ".md ", ".html ", - ".md,", ".html,", - ) - return r.Replace(s) -} - func markdown_to_html(path string) (string, error) { cmd := exec.Command("lowdown", "-Thtml") @@ -155,6 +140,21 @@ func render_nav(n NavNode, b *strings.Builder, cur string) { b.WriteString("\n") } +func replace_md_references(s string) string { + r := strings.NewReplacer( + /* common cases */ + ".md)", ".html)", + ".md\"", ".html\"", + ".md'", ".html'", + ".md)", ".html)", + ".md#", ".html#", + ".md>", ".html>", + ".md ", ".html ", + ".md,", ".html,", + ) + return r.Replace(s) +} + func title_from_name(name string) string { name = strings.TrimSuffix(name, ".md") name = strings.ReplaceAll(name, "-", " ") @@ -198,7 +198,7 @@ func main() { if err != nil { return err } - html = fix_md_references(html) + html = replace_md_references(html) relhtml := strings.TrimSuffix(rel, ".md") + ".html" cur := relhtml -- cgit v1.2.3