click-contrib / sphinx-click

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

Arguments don't show help text #132

Closed aeisenbarth closed 3 months ago

aeisenbarth commented 4 months ago

(This is not really a bug)

Generated documentation shows a section for options with help text for each, and a section for arguments with only "Required argument".

I am using typer (probably not officially supported by sphinx-click) and I converted typer commands to click commands so that I can generate Sphinx documentation:

click_command = typer.main.get_command(typer_app)

Typer supports the help attribute for both options and arguments. To me, sphinx-click's arguments section implied that there should be descriptive text and that it was missing for some reason. It took me a while to find out that click.Argument does not have the help attribute by design (https://github.com/pallets/click/issues/587, https://github.com/pallets/click/issues/1049, https://github.com/pallets/click/pull/1051, https://github.com/pallets/click/issues/1217), and that click developers are so pertinaciously opinionated that they won't ever offer that flexibility (which is ok for an opinionated tool, but unfortunate for anything building on top of it).

That leaves the arguments without description.

My aim: