-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Numpydoc "Methods" section formatting #256
Comments
Indeed, while several kinds of sections are accounted for, Methods is not among them: Lines 188 to 204 in 6cfbc4f
Given the variability of the section syntax (methods' default parameters can take form of any valid Python code), this will require a complete new regex, I believe. The workaround I can think of is to opt for simple markdown and jot a list form:
Note, to force a line break instead of dash separator, you need to end the line with TBH, with methods listed in the index and documented further below, the section does feel somewhat redundant. |
This only tells something at the moment. But in a short while, the only fixed reference one can use will be the original post date, requiring of one to look up the version history of the time ... |
For brief member function descriptions an explicit methods section is indeed redundant. But if the method functions's docstrings are very long with long parameter descriptions and nice example codes, then a concise methods section with a meaningful order of functions and a brief description of each function can be quite useful. Since it is listed in the numpy docstring guide the user should decide whether to use it or not. Anyways, a quick solution would be to add the methods section along with 'Returns' and 'Raises' to line 192 Lines 188 to 204 in 6cfbc4f
this produces somewhat ok results in the html output. But it could be improved by making the function names links to the full descriptions. You would get links by marking the functions as inline code and qualify them by the class name:
Not perfect either, see issue #188 . Seems you are right, support for methods sections needs an extra regexp. Maybe I manage to look into this. |
Excuse me, is there any progress here? |
No, unfortunately not. I did not find time to wrap my head around these regexps. |
Thank you for the answer! |
Expected Behavior
The numpy docstring guide allows for a Methods section where you could list class member functions.
I expect this section to be formatted similar like the Parameters section, i.e. as a list with each function an extra element in this list.
Actual Behavior
The 'Members' heading is formatted in the right way, but the functions are not formatted into a list. They are just merged into a single paragraph.
Steps to Reproduce
Additional info
The text was updated successfully, but these errors were encountered: