docs: fix the rclone root command header levels
This commit is contained in:
parent
513653910c
commit
458d93ea7e
1 changed files with 22 additions and 22 deletions
|
@ -178,6 +178,13 @@ rclone.org website.`,
|
|||
}
|
||||
doc := string(b)
|
||||
|
||||
startCut := strings.Index(doc, `### Options inherited from parent commands`)
|
||||
endCut := strings.Index(doc, `### SEE ALSO`)
|
||||
if startCut < 0 || endCut < 0 {
|
||||
if name != "rclone.md" {
|
||||
return fmt.Errorf("internal error: failed to find cut points: startCut = %d, endCut = %d", startCut, endCut)
|
||||
}
|
||||
} else {
|
||||
var out strings.Builder
|
||||
if groupsString := cmd.Annotations["groups"]; groupsString != "" {
|
||||
groups := flags.All.Include(groupsString)
|
||||
|
@ -195,16 +202,9 @@ rclone.org website.`,
|
|||
See the [global flags page](/flags/) for global options not listed here.
|
||||
|
||||
`)
|
||||
|
||||
startCut := strings.Index(doc, `### Options inherited from parent commands`)
|
||||
endCut := strings.Index(doc, `### SEE ALSO`)
|
||||
if startCut < 0 || endCut < 0 {
|
||||
if name == "rclone.md" {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("internal error: failed to find cut points: startCut = %d, endCut = %d", startCut, endCut)
|
||||
}
|
||||
doc = doc[:startCut] + out.String() + doc[endCut:]
|
||||
}
|
||||
|
||||
// outdent all the titles by one
|
||||
doc = outdentTitle.ReplaceAllString(doc, `$1`)
|
||||
err = os.WriteFile(path, []byte(doc), 0777)
|
||||
|
|
Loading…
Reference in a new issue