Skip to content

Commit

Permalink
fix(doc): see also link to root command (#5994)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Nov 2, 2021
1 parent 37d5efc commit fec0611
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/doc/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ notoc: true
linkHandler := func(name string) string {
base := strings.TrimSuffix(name, path.Ext(name))
base = strings.Replace(base, rootName+"_", "", 1)
return fmt.Sprintf("/docs/components/%s/%s/", rootName, strings.Replace(strings.ToLower(base), "_", "/", -1))
base = strings.Replace(strings.ToLower(base), "_", "/", -1)
if rootName == base {
return fmt.Sprintf("/docs/components/%s/", rootName)
}
return fmt.Sprintf("/docs/components/%s/%s/", rootName, base)
}

fmt.Printf("%s\n", rootName)
Expand Down

0 comments on commit fec0611

Please sign in to comment.