MCPcopy Create free account
hub / github.com/aws/aws-cli / generate_docs

Function generate_docs

awscli/botocore/docs/__init__.py:18–45  ·  view source on GitHub ↗

Generates the reference documentation for botocore This will go through every available AWS service and output ReSTructured text files documenting each service. :param root_dir: The directory to write the reference files to. Each service's reference documentation is loacated at

(root_dir, session)

Source from the content-addressed store, hash-verified

16
17
18def generate_docs(root_dir, session):
19 """Generates the reference documentation for botocore
20
21 This will go through every available AWS service and output ReSTructured
22 text files documenting each service.
23
24 :param root_dir: The directory to write the reference files to. Each
25 service's reference documentation is loacated at
26 root_dir/reference/services/service-name.rst
27 """
28 # Create the root directory where all service docs live.
29 services_dir_path = os.path.join(root_dir, 'reference', 'services')
30 if not os.path.exists(services_dir_path):
31 os.makedirs(services_dir_path)
32
33 # Generate reference docs and write them out.
34 for service_name in session.get_available_services():
35 docs = ServiceDocumenter(
36 service_name, session, services_dir_path
37 ).document_service()
38
39 # Write the main service documentation page.
40 # Path: <root>/reference/services/<service>/index.rst
41 service_file_path = os.path.join(
42 services_dir_path, f'{service_name}.rst'
43 )
44 with open(service_file_path, 'wb') as f:
45 f.write(docs)

Callers 1

test_generate_docsMethod · 0.90

Calls 6

ServiceDocumenterClass · 0.90
existsMethod · 0.80
document_serviceMethod · 0.80
makedirsMethod · 0.45
writeMethod · 0.45

Tested by 1

test_generate_docsMethod · 0.72