-
Notifications
You must be signed in to change notification settings - Fork 13
Generate top-level and individual API reference docs for all SDK clients #36
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
Generate top-level and individual API reference docs for all SDK clients #36
Conversation
285ae10 to
a447c2b
Compare
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. I've left some initial comments around the configuration of the documentation. I'll get to the generation scripts later tonight, but wanted to comment on what I've seen so far.
Additionally, I have some high-level comment around the top-level clients page:
- We need to remove the
Nonelinks and replace them with individual client links. - The individual client links throw
404 - Not found. - We need to avoid including folders like
.ruff_cache
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.
More (mostly minor) comments after reviewing the generate_doc_stubs.py script. I know some of the navbar stuff is WIP, so I'll probably wait to review that file
mkdocs.yml
Outdated
| repo_url: https://github.com/awslabs/aws-sdk-python | ||
|
|
||
| exclude_docs: | | ||
| README.md |
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.
Why is this needed?
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.
This was left over from the individual client mkdocs.yml. Each client's docs/ directory has a README.md and a warning gets thrown since it conflicts with index.md:
WARNING - Excluding 'README.md' from the site because it conflicts with 'index.md'.
This isn't required in the top-level configuration since there isn't a README.md inside of the root docs directory. Will remove.
| plugins: | ||
| - search | ||
| - literate-nav: | ||
| nav_file: SUMMARY.md |
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 you explain this SUMMARY.md file and how it's used?
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.
SUMMARY.md is a file generated by the generate_nav.py script. It contains the navigation structure for the site.
For example:
* [Overview](index.md)
* [Contributing](contributing.md)
* [Available Clients](clients/index.md)
* [Bedrock Runtime](clients/bedrock-runtime/index.md)
* [Sagemaker Runtime Http2](clients/sagemaker-runtime-http2/index.md)
* [Transcribe Streaming](clients/transcribe-streaming/index.md)
The mkdocs-literate-nav plugin reads this file and builds the navigation structure as part of the mkdocs build.
This replaces the manual nav configuration inside of mkdocs.yml and allows us to generate navigation dynamically for all clients. This file gets cleaned up as part of make docs-clean so it gets regenerated each build.
Makefile
Outdated
|
|
||
| docs-serve: | ||
| @[ -d site ] || $(MAKE) docs | ||
| uv run python -m http.server $(DOCS_PORT) --bind 127.0.0.1 --directory site No newline at end of file |
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.
We may have discussed this before, but why not use something like uv run mkdocs serve --dev-addr 127.0.0.1:$(DOCS_PORT)?
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.
The issue with mkdocs serve is that it forces a rebuild of the entire docs site each time you run it. It doesn't create a site/ directory like mkdocs build. If an engineer accidentally interrupts or exists the server process, running mkdocs serve again forces a rebuild. As the documentation grows, this makes rebuilds longer.
This allows us to always serve the site/ directory if it exists and builds the site if it doesn't.
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.
Looks good to merge to the feature branch
Description
This PR adds documentation generation for all AWS clients in the
aws-sdk-pythonrepo. Users can either generate a single top-level documentation site for all clients or independently for individual clients (see Testing).Documentation is built using:
Testing
For top-level client docs, execute these commands in the root level of this repo. For individual client documentation, execute these commands in each client's directory.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.