-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take hidden attribute into account #38
Conversation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
736c6db
to
530bde3
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
530bde3
to
851d1b7
Compare
@@ -208,6 +214,9 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) { | |||
b.WriteString("### Subcommands\n\n") | |||
table := newMdTable("Name", "Description") | |||
for _, c := range cmd.Commands() { | |||
if c.Hidden { | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need to log here, we already print log above for the command being skipped.
One other option would be to “warn” if no markdown file exists, but don’t create one if it’s not there. That way a project could decide to generate markdown for hidden commands by creating a .md for it, or to skip if by not creating one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
follow-up #37 (comment)
Set
hidden
attribute for commands in YAML generation so it can be used on docs website. For markdown do not generate docs for hidden commands.