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

Font-lock support for keywords in numpydoc docstrings

Open twmr opened this issue 4 years ago • 3 comments

What is your stance about supporting font-locking of numpydoc keywords docstrings (similar to the code in https://github.com/glyph/python-docstring-mode/blob/master/python-docstring.el)? Do you think that it makes sense to add it to your numpydoc.el pkg or should it be part of a separate pkg?

twmr avatar May 11 '21 20:05 twmr

Thomas Hisch @.***> writes:

What is your stance about supporting font-locking of numpydoc keywords docstrings (similar to the code in https://github.com/glyph/python-docstring-mode/blob/master/python-docstring.el)? Do you think that it makes sense to add it to your numpydoc.el pkg or should it be part of a separate pkg?

Hmm, I'm not sure I understand what exactly you have in mind. Which part(s) of the docstring would you like to see fontified? I just tried the python-docstring.el package and it fontified a bit of the docstring that was obviously rst syntax.

douglasdavis avatar May 11 '21 21:05 douglasdavis

I would lke to see the RST sections fontified, e.g. Parameters and Returns. The python-docstring-mode currently fontifies RST roles, e.g., :func:abc but not the numpydoc style sections. We could also fontify the code in the Example section.

twmr avatar May 12 '21 15:05 twmr

Ah I see, thanks for the explanation. I personally prefer a hard visual separation between code and docstrings in my Emacs buffers, but I'd be happy to support this inside of numpydoc.el as a minor mode. I'd welcome and would be happy to test a PR.

douglasdavis avatar May 17 '21 13:05 douglasdavis