-
Notifications
You must be signed in to change notification settings - Fork 24
Switch to Google-style docstrings with Markdown and remove Sphinx/RST generation #592
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
base: develop
Are you sure you want to change the base?
Conversation
jonathan343
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Antonio, this is a great start!
This PR can really be broken down into two main components:
- Formatting docstrings to comply with the requirements of MkDocs
- Generating the MkDocs specific files and static
.md
The first 100% needs to happen at codegen time. However, the more I look at this, the more I feel like doing 2 during codegen time and committing all the static files will really bloat our SDK repo when we're working with 400+ clients. This open PR is adding 4000+ lines for one client. The more scalable approach here might be to do all this generation on the fly when needed like we do with botocore.
I don't see anything in the generated files in https://github.com/awslabs/aws-sdk-python/pull/24/files that would make it difficult to do the approach mentioned above. The generated clients themselves have all the information we need.
.github/workflows/ci.yml
Outdated
| enable-cache: true | ||
|
|
||
| - name: Install pandoc | ||
| uses: pandoc/actions/setup@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - We should probably start pinning to commit SHAs instead of tags.
I'd recommend updating that here and then we can replace others in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
| writer.write("::: " + symbol.toString()); | ||
| writer.write(""" | ||
| options: | ||
| heading_level: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the default heading_level to 1 so we don't need to specify this case? Then if we need to go lower, we can be explicit
Related Docs: https://mkdocstrings.github.io/python/usage/configuration/headings/#heading_level
Description
This PR updates the generated docstring format to use the Google style with Markdown descriptions for all services (AWS and non-AWS).
This PR also removes the Sphinx-based reStructuredText (RST) documentation generation system introduced in #418. All documentation stubs will now be generated at build time in the
awslabs/aws-sdk-pythonrepo. This will prevent static doc stubs from bloating the repo when 400+ services are supported.Key changes:
Client,Structure,Config,Enum,Union) to generate Google style docstrings with Markdown descriptions using the newMarkdownConverterclassAwsRstDocFileGeneratorplugin that generates.rstfiles for Sphinx doc genNote
The new docstring format in AWS clients enables us to generate documentation using Material for MkDocs. We will generate MkDocs stubs in awslabs/aws-sdk-python that work with the
mkdocstringstool. This will automatically create documentation from docstrings for all clients.Testing
aws-sdk-bedrock-runtimeclient and confirmed all docstrings were updatedImportant
For local testing, please install pandoc v3.8.2 before running code generator.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.