Skip to content

Commit aebeb75

Browse files
authored
Merge pull request #36 from arandito/add-top-level-docs
Generate top-level and individual API reference docs for all SDK clients
2 parents 2a4d0ac + 83c2d40 commit aebeb75

File tree

40 files changed

+2981
-3
lines changed

40 files changed

+2981
-3
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# macOS system files
2+
.DS_Store
3+
4+
# MkDocs build artifacts
5+
site/
6+
docs/SUMMARY.md
7+
docs/clients/
8+
**/docs/client/
9+
10+
# Virtual environments
11+
.venv
12+
venv
13+
14+
# Caches
15+
__pycache__/
16+
.ruff_cache/
17+
18+
# Dependency lock file for uv
19+
uv.lock

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ If you discover a potential security issue in this project we ask that you notif
5656

5757
## Licensing
5858

59-
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
59+
See the [LICENSE](https://github.com/awslabs/aws-sdk-python/blob/develop/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
DOCS_PORT ?= 8000
2+
PYTHON_VERSION := 3.12
3+
4+
.PHONY: docs docs-serve docs-clean docs-install venv
5+
6+
venv:
7+
uv venv --python $(PYTHON_VERSION)
8+
9+
docs-install: venv
10+
uv pip install -r requirements-docs.in
11+
uv pip install -e clients/*
12+
13+
docs-clean:
14+
rm -rf site docs/clients docs/SUMMARY.md
15+
16+
docs-generate:
17+
uv run python scripts/docs/generate_all_doc_stubs.py
18+
uv run python scripts/docs/generate_nav.py
19+
20+
docs: docs-generate
21+
uv run mkdocs build
22+
23+
docs-serve:
24+
@[ -d site ] || $(MAKE) docs
25+
uv run python -m http.server $(DOCS_PORT) --bind 127.0.0.1 --directory site

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This is the preferred mechanism to give feedback so that other users can engage
3131

3232
## Security
3333

34-
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
34+
See [CONTRIBUTING](https://github.com/awslabs/aws-sdk-python/blob/develop/CONTRIBUTING.md#security-issue-notifications) for more information.
3535

3636
## License
3737

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
DOCS_PORT ?= 8000
2+
CLIENT_DIR := src/aws_sdk_bedrock_runtime
3+
DOCS_OUTPUT_DIR := docs/client
4+
PYTHON_VERSION := 3.12
5+
6+
.PHONY: docs docs-serve docs-clean docs-install venv
7+
8+
venv:
9+
uv venv --python $(PYTHON_VERSION)
10+
11+
docs-install: venv
12+
uv sync --group docs
13+
14+
docs-clean:
15+
rm -rf site $(DOCS_OUTPUT_DIR)
16+
17+
docs-generate:
18+
uv run python scripts/docs/generate_doc_stubs.py -c $(CLIENT_DIR) -o $(DOCS_OUTPUT_DIR)
19+
20+
docs: docs-generate
21+
uv run mkdocs build
22+
23+
docs-serve:
24+
@[ -d site ] || $(MAKE) docs
25+
uv run python -m http.server $(DOCS_PORT) --bind 127.0.0.1 --directory site
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Generating Client Documentation
2+
3+
Material for MkDocs is used for documentation. You can generate the documentation HTML
4+
for this client locally with the following:
5+
6+
```bash
7+
# Install documentation dependencies
8+
make docs-install
9+
10+
# Serve documentation locally
11+
make docs-serve
12+
13+
# OR build static HTML documentation
14+
make docs
15+
16+
# Clean docs artifacts
17+
make docs-clean
18+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from datetime import datetime
2+
3+
4+
def on_config(config, **kwargs):
5+
config.copyright = f"Copyright © {datetime.now().year}, Amazon Web Services, Inc"
6+
return config
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--8<-- "README.md"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* Custom breadcrumb styling */
2+
.breadcrumb {
3+
font-size: 0.85em;
4+
color: var(--md-default-fg-color--light);
5+
}
6+
7+
p:has(span.breadcrumb) {
8+
margin-top: 0;
9+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
site_name: AWS SDK for Python - Bedrock Runtime
2+
site_description: Documentation for AWS Bedrock Runtime Client
3+
4+
repo_name: awslabs/aws-sdk-python
5+
repo_url: https://github.com/awslabs/aws-sdk-python
6+
7+
exclude_docs: |
8+
README.md
9+
10+
hooks:
11+
- docs/hooks/copyright.py
12+
13+
theme:
14+
name: material
15+
favicon: ""
16+
palette:
17+
# Palette toggle for automatic mode
18+
- media: "(prefers-color-scheme)"
19+
scheme: default
20+
toggle:
21+
icon: material/brightness-auto
22+
name: Switch to light mode
23+
primary: white
24+
# Palette toggle for light mode
25+
- media: "(prefers-color-scheme: light)"
26+
scheme: default
27+
toggle:
28+
icon: material/brightness-7
29+
name: Switch to dark mode
30+
primary: white
31+
# Palette toggle for dark mode
32+
- media: "(prefers-color-scheme: dark)"
33+
scheme: slate
34+
toggle:
35+
icon: material/brightness-4
36+
name: Switch to system preference
37+
primary: black
38+
features:
39+
- navigation.indexes
40+
- navigation.instant
41+
- navigation.top
42+
- search.suggest
43+
- search.highlight
44+
- content.code.copy
45+
46+
plugins:
47+
- search
48+
- mkdocstrings:
49+
handlers:
50+
python:
51+
options:
52+
show_source: false
53+
show_signature: true
54+
show_signature_annotations: true
55+
show_root_heading: true
56+
show_root_full_path: false
57+
show_object_full_path: false
58+
show_symbol_type_heading: true
59+
show_symbol_type_toc: true
60+
show_if_no_docstring: true
61+
show_category_heading: true
62+
group_by_category: true
63+
separate_signature: true
64+
signature_crossrefs: true
65+
filters:
66+
- "!^_"
67+
- "!^deserialize"
68+
- "!^serialize"
69+
70+
markdown_extensions:
71+
- pymdownx.highlight
72+
- pymdownx.inlinehilite
73+
- pymdownx.snippets:
74+
check_paths: true
75+
- pymdownx.superfences
76+
- admonition
77+
- def_list
78+
- toc:
79+
permalink: true
80+
toc_depth: 3
81+
82+
nav:
83+
- Overview: index.md
84+
- Client: client/index.md
85+
86+
extra:
87+
social:
88+
- icon: fontawesome/brands/github
89+
link: https://github.com/awslabs/aws-sdk-python
90+
91+
extra_css:
92+
- stylesheets/extra.css
93+
94+
validation:
95+
nav:
96+
omitted_files: ignore

0 commit comments

Comments
 (0)