Skip to content

Commit 496379b

Browse files
committed
feat(docs): generate docs from docstrings
This is a fairly major change to the docs and generates documentation for all public methods, attributes and variables in AWS Powertools. This is achieved using `mkdocstrings`, which replaces instances of ```markdown ::: some.module.path ``` with the documentation of the specified module. As a side effect of generating the documentation, an `objects.inv` file is also generated. From a quick purview of the generated docs, they seem pretty good as the underlying code appears well documented; however, this probably needs to be double checked. Especially for cases where the Numpy docstring style is not being followed which may result in errors generating the docs. Ref: #5125 Signed-off-by: JP-Ellis <[email protected]>
1 parent c2a2f86 commit 496379b

Some content is hidden

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

55 files changed

+835
-569
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ TMP_CHANGELOG.md
301301
docs/.cache/
302302
docs/public
303303
node_modules
304-
api/
304+
# api/
305305
site/
306306
!404.html
307307
!docs/overrides/*.html

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
docs/core/metrics/index.md
22
includes/abbreviations.md
3+
docs/api/**

docs/api/event_handler.md

Lines changed: 1 addition & 0 deletions

docs/api/event_handler/api_gateway.md

Lines changed: 1 addition & 0 deletions

docs/api/event_handler/appsync.md

Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions

docs/api/event_handler/exceptions.md

Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions

docs/api/event_handler/router.md

Lines changed: 1 addition & 0 deletions

docs/api/event_handler/types.md

Lines changed: 1 addition & 0 deletions

docs/api/event_handler/util.md

Lines changed: 1 addition & 0 deletions

docs/api/event_handler/vpc_lattice.md

Lines changed: 1 addition & 0 deletions

docs/api/exceptions.md

Lines changed: 1 addition & 0 deletions

docs/api/logging.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/constants.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/correlation_paths.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/exceptions.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/filters.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/formatter.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/lambda_context.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/logger.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/types.md

Lines changed: 1 addition & 0 deletions

docs/api/logging/utils.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/base.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/exceptions.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/functions.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/metric.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/metrics.md

Lines changed: 1 addition & 0 deletions

docs/api/metrics/types.md

Lines changed: 1 addition & 0 deletions

docs/api/middleware_factory.md

Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions

docs/api/shared.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/cache_dict.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/constants.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/cookies.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/functions.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/headers_serializer.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/json_encoder.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/lazy_import.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/types.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/user_agent.md

Lines changed: 1 addition & 0 deletions

docs/api/shared/version.md

Lines changed: 1 addition & 0 deletions

docs/api/tracing.md

Lines changed: 1 addition & 0 deletions

docs/api/tracing/base.md

Lines changed: 1 addition & 0 deletions

docs/api/tracing/extensions.md

Lines changed: 1 addition & 0 deletions

docs/api/tracing/tracer.md

Lines changed: 1 addition & 0 deletions

docs/api/utilities.md

Lines changed: 1 addition & 0 deletions

docs/api/utilities/serialization.md

Lines changed: 1 addition & 0 deletions

docs/api/warnings.md

Lines changed: 1 addition & 0 deletions

mkdocs.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,64 @@ nav:
6262
# - Overview: contributing/tracks/overview.md
6363
# - Casual to regular contributor: contributing/tracks/casual_regular_contributor.md
6464
# - Customer to advocate: contributing/tracks/customer_advocate.md
65+
- API:
66+
- Event Handler:
67+
- api/event_handler.md
68+
- api/event_handler/api_gateway.md
69+
- api/event_handler/appsync.md
70+
- api/event_handler/bedrock_agent.md
71+
- api/event_handler/content_types.md
72+
- api/event_handler/exceptions.md
73+
- api/event_handler/lambda_function_url.md
74+
- api/event_handler/router.md
75+
- api/event_handler/types.md
76+
- api/event_handler/util.md
77+
- api/event_handler/vpc_lattice.md
78+
- Exceptions: api/exceptions.md
79+
- Logging:
80+
- api/logging.md
81+
- api/logging/constants.md
82+
- api/logging/correlation_paths.md
83+
- api/logging/exceptions.md
84+
- api/logging/filters.md
85+
- api/logging/formatter.md
86+
- api/logging/lambda_context.md
87+
- api/logging/logger.md
88+
- api/logging/types.md
89+
- api/logging/utils.md
90+
- Metrics:
91+
- api/metrics.md
92+
- api/metrics/base.md
93+
- api/metrics/exceptions.md
94+
- api/metrics/functions.md
95+
- api/metrics/metric.md
96+
- api/metrics/metrics.md
97+
- api/metrics/types.md
98+
- Middleware Factory:
99+
- api/middleware_factory.md
100+
- api/middleware_factory/exceptions.md
101+
- api/middleware_factory/factory.md
102+
- Shared:
103+
- api/shared.md
104+
- api/shared/cache_dict.md
105+
- api/shared/constants.md
106+
- api/shared/cookies.md
107+
- api/shared/functions.md
108+
- api/shared/headers_serializer.md
109+
- api/shared/json_encoder.md
110+
- api/shared/lazy_import.md
111+
- api/shared/types.md
112+
- api/shared/user_agent.md
113+
- api/shared/version.md
114+
- Tracing:
115+
- api/tracing.md
116+
- api/tracing/base.md
117+
- api/tracing/extensions.md
118+
- api/tracing/tracer.md
119+
- Utilities:
120+
- api/utilities.md
121+
- api/utilities/serialization.md
122+
- Warnings: api/warnings.md
65123

66124
theme:
67125
name: material
@@ -136,6 +194,43 @@ copyright: Copyright &copy; 2023 Amazon Web Services
136194
plugins:
137195
- git-revision-date
138196
- search
197+
- mkdocstrings:
198+
default_handler: python
199+
enable_inventory: true
200+
handlers:
201+
python:
202+
import:
203+
- https://docs.python.org/3/objects.inv
204+
options:
205+
# General
206+
allow_inspection: true
207+
show_source: true
208+
show_bases: true
209+
# Headings
210+
heading_level: 2
211+
show_root_heading: false
212+
show_root_toc_entry: true
213+
show_root_full_path: true
214+
show_root_members_full_path: false
215+
show_object_full_path: false
216+
show_category_heading: true
217+
# Members
218+
filters: ["!^_[^_]"]
219+
group_by_category: true
220+
show_submodules: false
221+
# Docstrings
222+
docstring_style: numpy
223+
docstring_options:
224+
ignore_init_summary: true
225+
docstring_section_style: spacy
226+
merge_init_into_class: true
227+
show_if_no_docstring: true
228+
# Signature
229+
annotations_path: brief
230+
show_signature: true
231+
show_signature_annotations: true
232+
separate_signature: true
233+
139234

140235
extra_css:
141236
- stylesheets/extra.css

0 commit comments

Comments
 (0)