Skip to content

Commit

Permalink
fix(gendocs): Remove old link prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.io>
  • Loading branch information
craciunoiuc committed Feb 9, 2024
1 parent 7261477 commit 7b1b7fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/gendocs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func generateMarkdown(cmd *cobra.Command, dir string) error {
if cmd.HasParent() {
parent := cmd.Parent()
pname := parent.CommandPath()
link := "/docs/cli/reference/" + strings.ReplaceAll(pname, " ", "/")
link := "/cli/" + strings.ReplaceAll(pname, " ", "/")
link = strings.ReplaceAll(link, "/kraft/cloud", "")
buf.WriteString(fmt.Sprintf("* [`%s`](%s): %s\n", pname, link, parent.Short))
cmd.VisitParents(func(c *cobra.Command) {
if c.DisableAutoGenTag {
Expand All @@ -106,8 +107,9 @@ func generateMarkdown(cmd *cobra.Command, dir string) error {
}

cname := name + " " + child.Name()
link := "/docs/cli/reference/" + cname
link := "/cli/" + cname
link = strings.ReplaceAll(link, " ", "/")
link = strings.ReplaceAll(link, "/kraft/cloud", "")
buf.WriteString(fmt.Sprintf("* [`%s`](%s): %s\n", cname, link, child.Short))
}

Expand Down

0 comments on commit 7b1b7fe

Please sign in to comment.