click-contrib / sphinx-click

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

Feature request: Allow mix of click directives and custom sections in docs #78

Closed skjoedt closed 3 years ago

skjoedt commented 3 years ago

I'm having trouble mixing click directives with custom documentation (extended explanations etc.) because click directives are nested under the previous section.

In the use case below I want to have a flat section level:

===
CLI
===

.. _prog status:

.. click:: prog.cli.command:status
   :prog: prog status

prog command status
-------------------

See `prog status`_.

.. click:: prog.cli.command:test
   :prog: prog command test

Here, I expected to have

# CLI
## prog status
## prog command status
## prog command test

but ended up with

# CLI
## prog status
## prog command status
### prog command test

Is it possible to add a feature that let's you either control the section level or omit the section entirely, e.g.

prog command test
-----------------

.. click:: prog.cli.command:test
   :prog: prog command test
   :nofirstsection:
stephenfin commented 3 years ago

The :nested: option should do the trick. There's lots of information on this and other options in the docs.