click-contrib / sphinx-click

A Sphinx plugin to automatically document click-based applications
MIT License
212 stars 57 forks source link

Possibility to generate a flat toctree with subcommands #59

Closed abey79 closed 2 years ago

abey79 commented 4 years ago

Hello @stephenfin, while building the documentation of a pipeline CLI tool (subcommands = stage in the pipeline), I found I'd rather have a flat toctree with all subcommands, instead of them being subsection of the main command. In this patch, I've added a :flat-toctree: flag for that purpose. Let me know if this makes sense.

sidujjain commented 4 years ago

This retains main command in the toctree. Is that intentional?

stephenfin commented 4 years ago

Apologies for the delay getting to this. I've no issues with the idea, but we need tests and documentation (pro tip: having these in the PR would have let me review this much faster, since I wouldn't need to generate these myself. No biggie though! :smile:). We should also error out if someone specifies the new flag without specifying :show-nested:. I wonder if it might be better to add this as a new mode to the new :nested: option we're introducing in #62? Let me know what you think!

stephenfin commented 4 years ago

Also, apologies for the merge conflicts. I suspect it's the introduction of black to blame. Hopefully they are relatively easy resolve :crossed_fingers:

stephenfin commented 2 years ago

This has been open for some time with no activity. If someone wants to revive this, I'm happy to reopen it. Until then, closing to keep the backlog down