|
11 | 11 | import shutil |
12 | 12 | from operator import itemgetter |
13 | 13 |
|
14 | | -# placeholder for the autogenerated md files (used for each service) |
15 | | -DOCS_MD = """--- |
16 | | -title: "{service_name_title}" |
17 | | -linkTitle: "{service}" |
18 | | -description: > |
19 | | - {description} |
20 | | -hide_readingtime: true |
21 | | ---- |
22 | | -
|
23 | | -## Coverage Overview |
24 | | -{{{{< localstack_coverage_table service="{service}" >}}}} |
25 | | -
|
26 | | -## Testing Details |
27 | | -{{{{< localstack_coverage_details service="{service}" >}}}} |
28 | | -""" |
29 | | - |
30 | | - |
31 | | -def create_markdown_files_for_services( |
32 | | - target_dir: str, |
33 | | - services: list[str], |
34 | | - service_lookup_details: str = None, |
35 | | - delete_if_exists: bool = False, |
36 | | -): |
37 | | - """ |
38 | | - Creates markdown files for each service, which in turn uses shortcodes + templates to construct the site |
39 | | - :param target_dir: directory where the md-files should be stored |
40 | | - :param services: list of services |
41 | | - :service_lookup_details: path to service_display_name.json that contains "long_name" and "short_name" for each service. |
42 | | - If set the names will be used for the description of the md. Else we use the original "service" name. |
43 | | - :param delete_if_exists: checks if the target_dir exists and deletes it before creating new md-files. default: False |
44 | | - """ |
45 | | - service_lookup = Path(service_lookup_details) |
46 | | - service_info = {} |
47 | | - if service_lookup.exists() and service_lookup.is_file(): |
48 | | - with open(service_lookup, "r") as f: |
49 | | - service_info = json.load(f) |
50 | | - |
51 | | - for service in services: |
52 | | - dirpath = Path(target_dir).joinpath(f"coverage_{service}") |
53 | | - if delete_if_exists: |
54 | | - if dirpath.exists() and dirpath.is_dir(): |
55 | | - shutil.rmtree(dirpath) |
56 | | - |
57 | | - dirpath.mkdir(parents=True, exist_ok=True) |
58 | | - |
59 | | - # default names in case there is no service_name_details |
60 | | - service_name_title = service |
61 | | - description = f"Implementation details for API {service}" |
62 | | - |
63 | | - if service_name_details := service_info.get(service, {}): |
64 | | - service_name_title = service_name_details.get("long_name", service) |
65 | | - if service_name_title and (short_name := service_name_details.get("short_name")): |
66 | | - service_name_title = f"{short_name} ({service_name_title})" |
| 14 | +# # placeholder for the autogenerated md files (used for each service) |
| 15 | +# DOCS_MD = """--- |
| 16 | +# title: "{service_name_title}" |
| 17 | +# linkTitle: "{service}" |
| 18 | +# description: > |
| 19 | +# {description} |
| 20 | +# hide_readingtime: true |
| 21 | +# --- |
| 22 | + |
| 23 | +# ## Coverage Overview |
| 24 | +# {{{{< localstack_coverage_table service="{service}" >}}}} |
| 25 | + |
| 26 | +# ## Testing Details |
| 27 | +# {{{{< localstack_coverage_details service="{service}" >}}}} |
| 28 | +# """ |
| 29 | + |
| 30 | + |
| 31 | +# def create_markdown_files_for_services( |
| 32 | +# target_dir: str, |
| 33 | +# services: list[str], |
| 34 | +# service_lookup_details: str = None, |
| 35 | +# delete_if_exists: bool = False, |
| 36 | +# ): |
| 37 | +# """ |
| 38 | +# Creates markdown files for each service, which in turn uses shortcodes + templates to construct the site |
| 39 | +# :param target_dir: directory where the md-files should be stored |
| 40 | +# :param services: list of services |
| 41 | +# :service_lookup_details: path to service_display_name.json that contains "long_name" and "short_name" for each service. |
| 42 | +# If set the names will be used for the description of the md. Else we use the original "service" name. |
| 43 | +# :param delete_if_exists: checks if the target_dir exists and deletes it before creating new md-files. default: False |
| 44 | +# """ |
| 45 | +# service_lookup = Path(service_lookup_details) |
| 46 | +# service_info = {} |
| 47 | +# if service_lookup.exists() and service_lookup.is_file(): |
| 48 | +# with open(service_lookup, "r") as f: |
| 49 | +# service_info = json.load(f) |
| 50 | + |
| 51 | +# for service in services: |
| 52 | +# dirpath = Path(target_dir).joinpath(f"coverage_{service}") |
| 53 | +# if delete_if_exists: |
| 54 | +# if dirpath.exists() and dirpath.is_dir(): |
| 55 | +# shutil.rmtree(dirpath) |
| 56 | + |
| 57 | +# dirpath.mkdir(parents=True, exist_ok=True) |
| 58 | + |
| 59 | +# # default names in case there is no service_name_details |
| 60 | +# service_name_title = service |
| 61 | +# description = f"Implementation details for API {service}" |
| 62 | + |
| 63 | +# if service_name_details := service_info.get(service, {}): |
| 64 | +# service_name_title = service_name_details.get("long_name", service) |
| 65 | +# if service_name_title and (short_name := service_name_details.get("short_name")): |
| 66 | +# service_name_title = f"{short_name} ({service_name_title})" |
67 | 67 |
|
68 | 68 |
|
69 | | - file_name = dirpath.joinpath("index.md") |
70 | | - with open(file_name, "w") as fd: |
71 | | - fd.write(DOCS_MD.format(service=service, description=description, service_name_title=service_name_title)) |
| 69 | +# file_name = dirpath.joinpath("index.md") |
| 70 | +# with open(file_name, "w") as fd: |
| 71 | +# fd.write(DOCS_MD.format(service=service, description=description, service_name_title=service_name_title)) |
72 | 72 |
|
73 | 73 |
|
74 | 74 | def create_data_templates_for_service( |
@@ -184,12 +184,12 @@ def main( |
184 | 184 | services = sorted(impl_details.keys()) |
185 | 185 |
|
186 | 186 | # create the coverage-docs |
187 | | - services = sorted(impl_details.keys()) |
188 | | - create_markdown_files_for_services( |
189 | | - target_dir=target_dir + "/md", |
190 | | - services=services, |
191 | | - service_lookup_details=service_lookup_details, |
192 | | - ) |
| 187 | + # services = sorted(impl_details.keys()) |
| 188 | + # create_markdown_files_for_services( |
| 189 | + # target_dir=target_dir + "/md", |
| 190 | + # services=services, |
| 191 | + # service_lookup_details=service_lookup_details, |
| 192 | + # ) |
193 | 193 |
|
194 | 194 | for service in services: |
195 | 195 | # special handling for rds/neptune/docdb: the services "neptune" + "docdb" are recognized as "rds" calls |
|
0 commit comments