fix strip trailing whitespace for make_docs script (#4597)

This commit is contained in:
Justin Ma
2022-02-22 21:11:46 +08:00
committed by GitHub
parent 3e8a41fbc9
commit b448d1dbe1
9 changed files with 29 additions and 14 deletions

View File

@ -57,9 +57,12 @@ $"($example.description)
$example_top + $examples
} else { "" }
let doc = (($top + $signature + $parameters + $examples) |
each {|it| ($it | str trim -r)} |
str collect (char nl)) + (char nl)
let doc = (
($top + $signature + $parameters + $examples) |
lines |
each {|it| ($it | str trim -r) } |
str collect (char nl)
)
let safe_name = ($command.command | str find-replace '\?' '' | str find-replace ' ' '_')
$doc | save --raw $"./docs/commands/($safe_name).md"