-
Notifications
You must be signed in to change notification settings - Fork 46
display class members in separate lists w/headings #181
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
display class members in separate lists w/headings #181
Conversation
This looks really nice. I really like how you figured out how the rendering works, that's always been a bit of dark magic for me. |
I'm happy to work on getting the tests passing assuming you are ok with the approach and implementation as is. Any suggested changes before I do? And for the tests, it seems most are based on loading |
... to eliminate code duplication.
I pushed an update that cleans up the code a bit. I'm starting to work on the tests and realized, after seeing an empty constructor section show up on the first test, that I was missing some things. I want to make sure we can avoid outputting a section header if there are no corresponding items that will be displayed in that section. So, for one thing, unless we have But if It also appears the class signature is always pulled from the constructor. It might be nice to have an option to simply use the name as the class signature for the case where the constructor is displayed separately. What do you think? But I suppose that's a separate issue. |
Very nice that you made progress. Regarding testing with the text output, I usually debug it and check the output that is generated and verify manually that it is correct.
I like that you don't want to output empty sections. Please add that :)
Yes, with your approach (which is so close to MathWorks👍), it does not really makes sense does it?
I'm not sure I understand this. Can you give an example |
For a class
I'm suggesting we might want an option that simply removes the arguments from the class signature, so it would yield something like ...
|
I recommend we ignore the value of |
Squashed commits: [94f2ac2] autodoc_class_content "both" and "init" both add constructor docstring to class
On second thought, I don't find I think I'm happy with this PR if you are. I'll create a separate issue about the format of the class signature. |
Thank you! |
Here is one approach to addressing #179.
As I looked at the code in
MatClassDocumenter.document_members()
, it occurred to me that one could still take advantage of the superclass method by "borrowing" theexclude_members
option and calling the superclassdocument_members()
multiple times with different subsets excluded.I know this is a bit of a hack, but it does generate roughly the result I'm looking for.
What do you think of this approach?