docs: collapse double spaces in generated CLI docs
This commit is contained in:
parent
340edb5811
commit
c137e15174
1 changed files with 2 additions and 0 deletions
|
|
@ -74,6 +74,8 @@ func runGendoc(cmd *cobra.Command, args []string) {
|
||||||
// prettier-style list bullets
|
// prettier-style list bullets
|
||||||
s = strings.ReplaceAll(s, "* [", "- [")
|
s = strings.ReplaceAll(s, "* [", "- [")
|
||||||
s = strings.ReplaceAll(s, ")\t - ", ") - ")
|
s = strings.ReplaceAll(s, ")\t - ", ") - ")
|
||||||
|
// collapse double spaces after sentence end (prettier style)
|
||||||
|
s = strings.ReplaceAll(s, ". ", ". ")
|
||||||
// convert single line indented code to backtick surrounded code
|
// convert single line indented code to backtick surrounded code
|
||||||
s = codeRe.ReplaceAllString(s, "\n\n```\n$1\n```\n")
|
s = codeRe.ReplaceAllString(s, "\n\n```\n$1\n```\n")
|
||||||
// collapse multiple blank lines and trailing newlines (prettier style)
|
// collapse multiple blank lines and trailing newlines (prettier style)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue