Skip to content
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

feat: Add an RST-style docstring parser #1

Merged
merged 6 commits into from
Sep 29, 2021
Merged

feat: Add an RST-style docstring parser #1

merged 6 commits into from
Sep 29, 2021

Conversation

pawamoy
Copy link
Member

@pawamoy pawamoy commented Sep 28, 2021

@plannigan, since you originally added the parser in pytkdocs, maybe you'd like to review this refactored version. Also let me know what you think is the most appropriate way to give you credits 🙂 It can be as a co-author of this PR / these commits, as a comment in the module, in the module docstring, or in the repository credits, or all of these! I'll anyway add every contributor of pytkdocs to the repository credits.

A quick explanation of the changes: there's no base parser anymore, so I exploded the class into several functions. They pass the parsed_values around to modify it by side-effect (not sure this is the right approach now that we're not using a class). The lines can be obtained from the docstring object, which has access to the whole object tree through its parent attribute. This removes the need for the obscure "context" dictionary we had in pytkdocs.

As for what is this project: it's a revisited pytkdocs, which parses the code instead of executing it (loading it in memory to introspect objects). It's far more robust and performant, and will allow extensions to customize the behavior.

@pawamoy pawamoy marked this pull request as ready for review September 29, 2021 17:31
@pawamoy pawamoy merged commit 742e7b2 into master Sep 29, 2021
@pawamoy
Copy link
Member Author

pawamoy commented Sep 29, 2021

I went with credits in the module docstring and co-authoring!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant