doc(refacto): Rewrite label types, and format table

- I prefer using Go types, more explicit in my humble opinion
- The markdown table wasn't well-formed
This commit is contained in:
2024-11-26 23:42:39 +01:00
parent 9f1f6c7e78
commit bb1354e228
4 changed files with 46 additions and 37 deletions

View File

@@ -166,9 +166,9 @@ func generateMarkdownHelp(names []string) string {
}
for _, name := range names {
help := labelFullHelp[name]
maxNameLength = max(maxNameLength, len(name)+2+len(KatenaryLabelPrefix))
maxNameLength = max(maxNameLength, len(name)+3+len(KatenaryLabelPrefix))
maxDescriptionLength = max(maxDescriptionLength, len(help.Short))
maxTypeLength = max(maxTypeLength, len(help.Type))
maxTypeLength = max(maxTypeLength, len(help.Type)+3)
}
fmt.Fprintf(&builder, "%s\n", generateTableHeader(maxNameLength, maxDescriptionLength, maxTypeLength))
@@ -179,7 +179,7 @@ func generateMarkdownHelp(names []string) string {
fmt.Fprintf(&builder, "| %-*s | %-*s | %-*s |\n",
maxNameLength, "`"+LabelName(name)+"`", // enclose in backticks
maxDescriptionLength, help.Short,
maxTypeLength, help.Type,
maxTypeLength, "`"+help.Type+"`",
)
}