sphinx-doc.el
sphinx-doc.el copied to clipboard
Switch to `pydocstring` backend ?
Hi !
I have discovered the existence of https://github.com/robodair/pydocstring.
Instead of re-invented the wheel, I think it could be worth replacing the current sphinx-doc
backend by the pydocstring
one.
What do you think @naiquevin ?
I can make a proof of concept draft PR if necessary.
Hi @naiquevin , happy new year ! What do you think of my proposal ? I think using a real python backend to generate the docstring can be much more powerful than using the the elisp code we currently have. It can also handle more cases and also more styles (it currently supports google
, numpy
, reST
).
Hi @wizmer Happy new year to you too. I missed your earlier message, sorry about that. I don't mind the change you are proposing. But IMO, it'd be good if the current implementation of generating docstring in elisp is also supported as a fallback in case pydocstring is not installed in the environment. What do you think?
Have you guys considered pyment
? seems more active project than pydocstring
and IIUIC does the same thing isn't it?
@naiquevin Yes, I think keeping a fallback option would be nice.
@zzantares Thanks for your suggestion, I was not aware of pyment
, it seems indeed more active and also more complete. I'll give it a try.
On the emacs side of things there's also https://github.com/glyph/python-docstring-mode, unfortunately unmaintained currently. Bringing it up because it's tangentially related. It also uses its own implementation. Perhaps there's room to build something that does both?
I have started refactoring pyment
here https://github.com/dadadel/pyment/pull/112
I also plan to enhance it and make it more customizable.
That will be for the backend side but when I'll be done with it, it will be time to think whether to integrate it in sphinx-doc
or build a new package if it goes too much beyond sphinx-doc
scope. Also, sphinx-doc
name suggests that it is only for sphinx docstring while pyment
is able to handle more styles.