Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/md_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine()))
}

if len(cmd.Aliases) > 0 {
buf.WriteString("### Aliases\n\n")
for _, alias := range cmd.Aliases {
buf.WriteString(fmt.Sprintf("* `%s`\n", alias))
}
buf.WriteString("\n")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 this is a pure stylistic feedbacks.

It's open for debate.

Maybe the rendering could be different when there is only one alias.

Because this might seem empty as a section

### Aliases

* foobar

So, here maybe another rendering could be considered.

When multiple aliases are available

Aliases: foobar, fooquz

And when there is only one

Aliases: foobar

Please note, I didn't use a section on purpose


if len(cmd.Example) > 0 {
buf.WriteString("### Examples\n\n")
buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example))
Expand Down