Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Sphinx docstyle #25

Closed
guillochon opened this issue Nov 14, 2018 · 7 comments
Closed

Support Sphinx docstyle #25

guillochon opened this issue Nov 14, 2018 · 7 comments

Comments

@guillochon
Copy link

As described here: http://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists

@Kilo59
Copy link

Kilo59 commented Nov 16, 2018

You may already be aware but Sphinx can support Numpy or Google Style Docstrings with the Napoleon extension.
https://github.com/sphinx-contrib/napoleon

I believe you can pip install it, add the extension to your conf.py and it will just work without extra configuration.

@guillochon
Copy link
Author

I am aware, unfortunately my company insists upon this particular docstring format.

@Kilo59
Copy link

Kilo59 commented Nov 16, 2018

My condolences 😉

I know this isn't what you wanted, but you might give pyment a try. It's a python based command line tool you can use to generate docstrings in different formats.
https://github.com/dadadel/pyment/blob/master/doc/sphinx/source/pyment.rst

If you are willing to ditch Atom, there is also the autoDocstring VScode plugin.

Both of these tools support the Sphinx/reST style.

@guillochon
Copy link
Author

pyment looks like a nice option, thanks!

And yes I saw that VScode has a plugin to do the format I want (and so does pycharm), but I'm resisting the urge to switch over...

@spadarian
Copy link
Owner

I will add the new style, so need to change to VScode.

@spadarian
Copy link
Owner

@guillochon
I don't use that specific style, so let me know if I need to fix or add something.

@guillochon
Copy link
Author

@spadarian I have one requested thing to add: A checkbox option to separate param description and type, like so:

:param variable This variable describes this.
:type  variable string

This is immensely helpful already though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants