-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add reStructured parser #67
Comments
Hello! Maybe I can help you get started with an explanation of the current code. A docstring parser is a class inheriting from {
"attr1": {"docstring": "string": "annotation": int},
} The rest is completely up to you! You can of course get inspiration from the Google style parser, though it's not the best looking or best structured code I've written.
|
That is a helpful intro into the parser API. I'll play around with it this weekend and see what I come up with. That is a good point about RST, it is a large specification. For the initial version, I was thinking about parsing out the fields I linked to in the initial request (which seems to match what is supported by the google format). This would focus on the documentation of a functions contract, without trying to cover the whole RST specification. This would be sufficient for my needs. If there is a future request for more full support, I could look into using something like docutils to do the parsing and accessing the data it produces. |
Status update: Things are coming along nicely. I haven't run into any hard blockers. Once I get things into a good state, I'll try to break it into smaller PRs so it isn't big dump of >1k lines. Other Notes:
|
Great! About the fixtures: sure, we should move them where relevant, and make sure to remove unnecessary sections.
Yes! Music to my ears 😄 You are totally right about the
Sounds good to me! Thank you for your contributions! |
This implementation should be mostly complete. Not implemented: - references: Not planned at this time - examples: I'm not aware of a standard format for this Still needed: - more test: - Many of the error cases aren't currently covered - More full fixture test cases To be cleaned up: - I'm not confident I got the types right for all of the data that comes in with the context - ParseContext works, but it is a bit awkward with the rest of the project using the dict References: mkdocstrings#67
Initial support in #71 |
Is your feature request related to a problem? Please describe.
I have some projects that uses reStructured style of docstrings. I'd like to use mkdocstrings for these projects, but currently the google style is the only supported style supported.
Describe the solution you'd like
A second parser implementation that supports the directives documented on the Sphinx.
Describe alternatives you've considered
I found this blog post. However, it seems like multiple hoops to jump through when I'm already using
mkdocs
for the rest of the documentation for the these projects.Additional context
I might be able to help with the implementation. I'd need to spend some time reading though the google parse to see how easy it would be to add a second parser.
The text was updated successfully, but these errors were encountered: