-
Notifications
You must be signed in to change notification settings - Fork 46
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
Document abstract methods #222
Comments
Sorry for the late reply and thanks for the report. It's related to #44, which has been there for many years. It has not been easy to solve, but I'll try again next week. |
This is just for reference. I tried the "textmate grammar" instead of pygments to converting some MATLAB code into tokens to compare the output. Using your example class Pygments output (removed consecutive
Textmate Grammar Output with
The nice thing with "textmate-grammar" is that tokens are more rich. Still it will require quite a lot a work to convert to "textmate-grammar" parsing. |
Abstract methods – which have a signature but not a body – are currently not documented. It would be nice to be able to document them though, since they exist to define an interface for users to extend ("if you inherit from this class, you must write a function that...<precise explanation that should live in a docstring>").
The trouble is that these methods are special cases lexically because they aren't bookended by
function
andend
. Here's an example.Now with this RST block somewhere,
we get documentation for
publicmethod()
but notabstractmethod1()
orabstractmethod2()
.This was discussed a little way back in #28. Is this something that can be added without too much trouble? Adding
function
andend
is not allowed for abstract methods, so it would have to be handled as a special case. It seems pretty natural to allow docstrings with this style:Thanks for writing this extension, it's a huge help for our project.
The text was updated successfully, but these errors were encountered: