Closed trojkat closed 4 years ago
We have to switch to using a parser instead of actually importing the Python module(s), as the docstring for the variable is lost in that process. I would also like to support #
comments before the variable as docstring.
I intend to use lib2to3
for that purpose.
Just a heads up, I'm currently working on this in the develop branch.
A useful little feature for the meantime would be a flag or something to ignore non-callable members. This would at least allow to use pydocmd as it is now on a codebase with public class attributes without having to correct the markdown by hand after generation. Because right now I'm kinda tempted to pre-underscore my class attributes and wrap them in classmethods, just to make automated documentation work, and I guess that's not a good thing. I'd be willing to work on a PR for that, if that's fine with you. :)
Hey @sbischoff-ai , I must have missed your comment. If you are still willing to create a PR, please do! I do not plan to make many more changes to v2 but important fixes and want to focus the little time I can invest into this project on v3.
This is working in Pydoc-Markdown 3. 🙂
According to PEP 257 you can add string literals immediately after a simple assignment at the top level of a module, class, or init.
Current output (which also breaks the indentation of the next item):
Expected output: