Closed staticdev closed 4 years ago
You need to enable the extension by adding the following to your conf.py
.
extensions = ['sphinx_click']
@stephenfin I added the extension, but it changed the error message:
README.rst:69: WARNING: "<class 'function'>" of type "__main__:main" is not derived from "click.BaseCommand"
But I followed the documentation and am using the a @click.group. I also tried changing to another @click.group:
.. click:: __main__:create
:prog: gitp
:show-nested:
Then I get another error:
README.rst:69: WARNING: Module "__main__" has no attribute "create"
I suspect __main__
isn't what you think it is. Try git_portfolio.__main__:create
. If that doesn't work, I'd suggest starting with the examples and working backwards to get what you need.
@stephenfin you are absolutely correct again! git_portfolio.__main__:create
did the trick.
Double thanks for the issue!
I am using a following versions of packages:
click==7.1.2 Sphinx==3.2.1 sphinx-click==2.5.0
Then I added to my project directive as in the usage documentation:
But when I try to build documentation with
sphinx-build
I get the error:Unknown directive type "click"
.You can see my code here: https://github.com/staticdev/git-portfolio/blob/master/src/git_portfolio/__main__.py