Regenerating CLI docs

When submitting a PR for a CLI change, how does one “regen CLI docs?”

Example commit: 74f0777

I am aware of hugo gen doc, but I was wondering if there’s an automated way of handling this. I did not find (perhaps not knowing where to look) a mage command for this.

I guess the procedure, from the root of the project, is:

  1. Delete everything in docs/content/en/commands/ except for:
    • hugo_check.md
    • hugo_check_ulimit.md
  2. hugo gen doc --dir docs/content/en/commands/

But I don’t understand why we have documentation for hugo check and hugo check ulimit. Entries for these commands are not created by:

  • hugo gen doc
  • hugo gen man
  • hugo completion

Sorry, but cc/ @belp

My procedure is hugo gen doc --dir docs/content/en/commands/ and that command only. I don’t delete anything unless I know somehting has moved (I probably should), but I also do a “git diff” to make sure It’s what I expect.

As to your last question, I don’t know. I suspect Cobra (the CLI) tool has a way to supress documentation for certain commands (maybe they were considered … not useful for general use or something, I don’t rememember).

Could the two additional files be produced when running on darwin, but not elsewhere?

Ah, yes, now I remember – the ulimit command has a darwin build flag (not sure about check) … But we should remove that command rather than spending time to fix this: Remove the "check" command · Issue #9454 · gohugoio/hugo · GitHub

I’ll take that one.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.