Skip to content

Commit 15bb9cd

Browse files
committed
Add per-client documentation
1 parent a447c2b commit 15bb9cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2817
-787
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
# Python bytecode cache
15+
__pycache__/
16+
17+
# Dependency lock file for uv
18+
uv.lock

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- --8<-- [start:docs] -->
21
# Contributing Guidelines
32

43
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
@@ -54,7 +53,7 @@ [email protected] with any additional questions or comments.
5453
## Security issue notifications
5554
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5655

57-
<!-- --8<-- [end:docs] -->
56+
5857
## Licensing
5958

60-
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## AWS SDK for Python
2-
<!-- --8<-- [start:docs] -->
32
[![Apache 2 licensed][apache-badge]][apache-url]
43

54
[apache-badge]: https://img.shields.io/badge/license-APACHE2-blue.svg
@@ -30,10 +29,9 @@ features we are actively working on.
3029
You can provide feedback or report a bug by submitting an [issue](https://github.com/awslabs/aws-sdk-python/issues/new/choose).
3130
This is the preferred mechanism to give feedback so that other users can engage in the conversation, +1 issues, etc.
3231

33-
<!-- --8<-- [end:docs] -->
3432
## Security
3533

36-
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.
3735

3836
## License
3937

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 &copy; {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)