Skip to content
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

Merged
merged 2 commits into from
Jun 27, 2023
Merged

Conversation

crazy-max
Copy link
Member

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.

@crazy-max crazy-max requested a review from thaJeztah June 27, 2023 12:13
clidocstool_test.go Outdated Show resolved Hide resolved
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@@ -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
Copy link
Member Author

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.

@crazy-max crazy-max requested a review from thaJeztah June 27, 2023 12:21
@thaJeztah
Copy link
Member

One other option would be to “warn” if no markdown file exists, but don’t create one if it’s not there.
Are we currently always creating (so, not just “updating”)?

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

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 5cb124c into docker:main Jun 27, 2023
@crazy-max crazy-max deleted the missing-hidden branch June 27, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants