click-contrib / sphinx-click

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

Click commands docstring in Sphinx format #142

Closed azmeuk closed 2 months ago

azmeuk commented 2 months ago

sphinx-click allows to build Sphinx documentation from click command docstrings, and this is great. However, if one uses Sphinx directives in a click command docstring, then the command help flag will display the raw Sphinx code instead of the rendered code, and that sucks.

I wondered if there was a way to render the CLI docstrings with the Sphinx text builder before there are displayed in a terminal.

I opened a bug here, as using sphinx-click makes it appealing to use Sphinx directive in command docstrings, but maybe this would the scope of another click-sphinx-docstrings package?

What do you think?

hakonhagland commented 2 months ago

@azmeuk See also #135.

azmeuk commented 2 months ago

I can't believe I did not see this one among the 11 issues :/ Anyways, thank you, this is exactly what I needed. I will try to use it in the coming weeks and give you feedback if needed.