-
Notifications
You must be signed in to change notification settings - Fork 24
Replace Sphinx doc gen with MkDocs and Markdown #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.
| 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
| 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 replaces the Sphinx-based reStructuredText (RST) documentation generation system introduced in #418 with MkDocs and Markdown for AWS services only. It also updates the docstring format to use the Google style with Markdown descriptions fro all services (AWS and non-AWS).
Key changes:
Client,Structure,Config,Enum,Union) to output Google style docstrings with Markdown descriptions usingMarkdownConverterAwsMkDocsFileGeneratorplugin to generate MkDocs stub files for only AWS services in theirdocs/directoryAwsRstDocFileGeneratorplugin and RST-to-Markdown conversion logicImportant
This PR only adds standalone docs for individual AWS clients. These can be built in each client and hosted separately. We plan to aggregate these all into a single top-level documentation site in awslabs/aws-sdk-python. This will happen post client generation and will use the stub files generated in
docs/directory for each client. We will also use Material for MkDocs.Testing
aws-sdk-bedrock-runtimeclient and confirmed updates were functionalaws-sdk-bedrock-runtimevisit hereNote
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.