You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 (pallets/click#587, pallets/click#1049, pallets/click#1051, pallets/click#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:
Make this information findable if another user searches for it (done)
Maybe you could add a block to sphinx-click documentation mentioning that arguments should be described in the command's description, as recommended by click developers.
(Alternatively, one could consider following that philosophy and removing the arguments section altogether.)
(Another possibility would be to add partial support for typer's typer.main.TyperArgument which is a subclass of click.Argument, for example with getattr(arg, "help", ""))
The text was updated successfully, but these errors were encountered:
(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:
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 thatclick.Argument
does not have thehelp
attribute by design (pallets/click#587, pallets/click#1049, pallets/click#1051, pallets/click#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:
(Alternatively, one could consider following that philosophy and removing the arguments section altogether.)
typer.main.TyperArgument
which is a subclass ofclick.Argument
, for example withgetattr(arg, "help", "")
)The text was updated successfully, but these errors were encountered: