gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.75k stars 7.53k forks source link

hugo convert, documentation: add section 'Available commands' #11168

Open deining opened 1 year ago

deining commented 1 year ago

When using the help function of the convert command, a section Available commands is printed out:

$ hugo convert --help
Convert your content (e.g. front matter) to different formats.

See convert's subcommands toJSON, toTOML and toYAML for more information.

Usage:
  hugo convert [command] [flags]
  hugo convert [command]

Available Commands:
  toJSON      Convert front matter to JSON
  toTOML      Convert front matter to TOML
  toYAML      Convert front matter to YAML

Flags:
  -h, --help            help for convert
...

This section is not given on the documentation page for the convert command. Were nice if this section could be added. Alternatively, we could add links to the three subcommands toJSON, toTOML and toYAML which link to their corresponding documentation site. Not sure if this an option since the documentation page is auto-generated AFAICS.

bep commented 1 year ago

I moved this issue to where it belongs. The above documentation is auto generated (from Cobra). I'm pretty sure the above should be possible to fix (it's a good idea), but it needs someone to look into the hugo gen doc command.

z0li commented 1 year ago

You can find the subcommands and links to their documentation at the bottom of the page under the "SEE ALSO" section.

Going through the source code of Cobra (see md_docs.go), I was not able to find a way to add the very same "Available Commands" section to the generated MD docs.

deining commented 1 year ago

You can find the subcommands and links to their documentation at the bottom of the page under the "SEE ALSO" section.

I know.

Going through the source code of Cobra (see md_docs.go), I was not able to find a way to add the very same "Available Commands" section to the generated MD docs.

I submitted a PR in the cobra repo that addresses the issue raised by me. Feel free to give it a like!