numpydoc.el icon indicating copy to clipboard operation
numpydoc.el copied to clipboard

Support classes?

Open jdtsmith opened this issue 4 years ago • 3 comments
trafficstars

This looks very nice. I immediately ran into trouble documenting a class, which numpydoc style indicates should contain all normal sections, documenting __init__ parameters, attributes, and (possibly) methods. This would be a great addition. Possibly just __init__ parameters to start and placing a to-be-filled attributes section?

jdtsmith avatar Oct 11 '21 20:10 jdtsmith

I'd welcome any PR that adds support for classes! I can give it a try but there are no guarantees that I'll find any consistent time to work on it in the immediate future.

douglasdavis avatar Oct 12 '21 19:10 douglasdavis

Any news on this?

I think an interims solution would be to have docstrings for __init__ inserted as the class definition.

Numpydoc says that for classes all sections but Returns can be used and that "[t]he constructor (init) should also be documented here, the Parameters section of the docstring details the constructor’s parameters.

lu-pl avatar Jul 10 '24 05:07 lu-pl

I don't have the bandwidth to work on this, but I'd welcome a PR. Somewhat related: it's on the very bottom of my todo list to investigate using built-in tree-sitter support that landed in Emacs some time ago to improve this package and perhaps make it easier to contribute to.

douglasdavis avatar Jul 18 '24 15:07 douglasdavis