Skip to content

Commit 676b8d4

Browse files
committed
docs: Expand on what a "click object" is
This was a source of confusion, as highlighted by #13. Resolve this. Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent 59010a8 commit 676b8d4

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

docs/usage.rst

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Usage
22
=====
33

4-
`sphinx-click` enables automatic documentation by way of a `Sphinx
5-
directive`__.
4+
*sphinx-click* enables automatic documentation for `click-based`_ applications
5+
by way of a `Sphinx directive`_.
66

77
.. rst:directive:: .. click:: module:parser
88
9-
Automatically extract documentation from a `click-based`__ application and
9+
Automatically extract documentation from a `click-based`_ application and
1010
include it in your docs.
1111

1212
.. code-block:: rst
@@ -15,31 +15,34 @@ directive`__.
1515
:prog: hello-world
1616
:show-nested:
1717
18-
The directive takes the import name of the parser object as its sole
19-
argument.
18+
The directive takes the import name of a *click* object as its sole
19+
argument. This should be a subclass of |click.core.BaseCommand|_, such as
20+
``click.Command``, ``click.Group``, ``click.MultiCommand``, etc.
2021

2122
In addition, the following options are required:
2223

23-
`:prog:`
24+
``:prog:``
2425
The name of your tool (or how it should appear in your documentation). For
2526
example, if you run your script as ``./boo --opts args`` then ``:prog:``
2627
will be ``boo``. If this is not given, the module name is used.
2728

2829
The following options are optional:
2930

30-
`:show-nested:`
31+
``:show-nested:``
3132
Enable full documentation for sub-commands.
3233

33-
`:commands:`
34+
``:commands:``
3435
Document only listed commands.
3536

36-
__ http://www.sphinx-doc.org/en/stable/extdev/markupapi.html
37-
__ http://click.pocoo.org/
37+
.. _Sphinx directive: http://www.sphinx-doc.org/en/stable/extdev/markupapi.html
38+
.. _click-based: http://click.pocoo.org/6/
39+
.. |click.core.BaseCommand| replace:: ``click.core.BaseCommand``
40+
.. _click.core.BaseCommand: http://click.pocoo.org/6/api/#click.BaseCommand
3841

3942
Example
4043
-------
4144

42-
Take the below `click` application, which is defined in the `example_app`
45+
Take the below ``click`` application, which is defined in the ``hello_world``
4346
module:
4447

4548
.. code-block:: python

0 commit comments

Comments
 (0)