Open srkunze opened 8 years ago
I just thought about that!! :D Shit is there are different formats within the docstring. for instance
:tag name:
)@tag name:
)But yeah! Doesn't seem impossible to do :]
This would be a really nice feature. Otherwise your just repeating yourself in the docstring
I've made a pull request #109 which adds a decorator which parses the Sphinx docstring to add type and description information.
It hasn't got tests yet but wanted it out there to see if there is an appetite to merge in.
Any comments? It would be great if someone added to it so it could also parse Google and Numpy style docstrings.
Thanks guys, I've commented in PR #109 for now.
Hi guys,
I tackled a similar problem with defopt. I thought I had done my homework before writing yet another argument parser, but apparently I missed argh at the time. In retrospect I think it would have been better as an addition to argh instead of a standalone library.
If you would like to take inspiration from it or want me to help out in some way, I'd be happy to. Ideally it would be great if argh ended up with a superset of defopt's functionality and then I wouldn't need to maintain a separate project.
Note that defopt handles Google/Numpy formats using sphinxcontrib-napoleon, and also a limited set of typing annotations as described in #107.
It seems that this should be configurable, perhaps an extension. I'll try to gather all plugin-ish issues under the appropriate label and see if it makes sense to add such mechanism to Argh.
Would you find it reasonable to include something like https://www.chromium.org/chromium-os/python-style-guidelines#TOC-Describing-arguments-in-docstrings into argh?
Internally, we still need to use Python 2, so I would love to have this kind of help-text generation in order to reduce usage of the
@arg
decorator. Btw. it's a great package.