From dfd992e1051b2429cc99d0e149b9c430924e42eb Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Fri, 25 Oct 2024 22:20:53 +0200 Subject: [PATCH] fix(clustertool): more docs generation fixes --- clustertool/pkg/helper/tooldocs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clustertool/pkg/helper/tooldocs.go b/clustertool/pkg/helper/tooldocs.go index e66651c7a86..975010754f1 100644 --- a/clustertool/pkg/helper/tooldocs.go +++ b/clustertool/pkg/helper/tooldocs.go @@ -92,9 +92,13 @@ func addYamlTitle(content []byte, isPrimaryIndex bool) []byte { if isPrimaryIndex { builder.WriteString("commands\n---\n") - log.Debug().Msg("Set primary index title to 'clustertool'") + log.Debug().Msg("Set primary index title to 'commands'") } else if scanner.Scan() && strings.HasPrefix(scanner.Text(), "## ") { title := strings.TrimPrefix(scanner.Text(), "## ") + if title == "clustertool" { + title = "command" + } + title = strings.TrimPrefix(title, "clustertool ") builder.WriteString(title + "\n---\n") builder.WriteString(scanner.Text() + "\n") log.Debug().Str("title", title).Msg("Set title from first line")