Skip to content

Commit 54b349f

Browse files
authored
Bugfix: Docs - module and actions rendering (#614)
* add logging * more debugging * https://arc.net/l/quote/pplohupq * copy from .github * further debugging * Revert "copy from .github" This reverts commit 7df0b98. * use python 3.12 * try something * try something * fix actions * cleanup * troubleshooting * remove gomplate version * remove foo * rename * add / * add / * add / * cleanup
1 parent 50c5558 commit 54b349f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

scripts/docs-collator/GitHubActionRenderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __render_readme(self, module_download_dir, module_docs_dir):
5656
f"README_FILE={readme_md_file}",
5757
f"README_YAML={readme_yaml_file}",
5858
f"README_TEMPLATE_YAML={readme_yaml_file}",
59-
f"README_INCLUDES={module_download_dir}"], capture_output=True)
59+
f"README_INCLUDES={module_download_dir}/"], capture_output=True)
6060

6161
if response.returncode != 0:
6262
error_message = response.stderr.decode("utf-8")

scripts/docs-collator/ModuleRenderer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ def __render_readme(self, module_download_dir, module_docs_dir):
6060

6161
io.create_dirs(module_docs_dir)
6262

63+
logging.info(f"Running `make readme README_TEMPLATE_FILE={readme_tmpl_file} README_FILE={readme_md_file} README_YAML={readme_yaml_file} README_TEMPLATE_YAML={readme_yaml_file} README_INCLUDES={module_download_dir}`")
6364
response = subprocess.run(["make", "readme",
6465
f"README_TEMPLATE_FILE={readme_tmpl_file}",
6566
f"README_FILE={readme_md_file}",
6667
f"README_YAML={readme_yaml_file}",
6768
f"README_TEMPLATE_YAML={readme_yaml_file}",
68-
f"README_INCLUDES={module_download_dir}"], capture_output=True)
69+
f"README_INCLUDES={module_download_dir}/"], capture_output=True)
6970

7071
if response.returncode != 0:
7172
error_message = response.stderr.decode("utf-8")

scripts/docs-collator/templates/github-actions/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" -}}
2-
{{- defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" -}}
1+
{{- defineDatasource "config" .Env.README_YAML -}}
2+
{{- defineDatasource "includes" (env.Getenv "README_INCLUDES") -}}
33
{{- $deprecated := has (ds "config") "deprecated" -}}
44
{{- $fullName := (ds "config").name -}}
55
{{- $shortName := (index ($fullName | strings.SplitN "-" 3) 2) -}}

scripts/docs-collator/templates/modules/readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- defineDatasource "config" .Env.README_YAML | regexp.Replace ".*" "" -}}
2-
{{- defineDatasource "includes" .Env.README_INCLUDES | regexp.Replace ".*" "" -}}
1+
{{- defineDatasource "config" .Env.README_YAML -}}
2+
{{- defineDatasource "readmeIncludesDir" .Env.README_INCLUDES -}}
33
{{- $deprecated := has (ds "config") "deprecated" -}}
44
{{- $fullModuleName := (ds "config").name -}}
55
{{- $shortModuleName := (index ($fullModuleName | strings.SplitN "-" 3) 2) -}}
@@ -18,6 +18,7 @@ tags:
1818
custom_edit_url: https://github.com/cloudposse/{{ $fullModuleName }}/edit/master/README.md
1919
---
2020

21+
2122
# Module: `{{ $shortModuleName }}`
2223

2324
{{- if $deprecated }}
@@ -75,7 +76,7 @@ custom_edit_url: https://github.com/cloudposse/{{ $fullModuleName }}/edit/master
7576

7677
{{ if has (ds "config") "include" }}
7778
{{ range $file := (datasource "config").include -}}
78-
{{ (include "includes" $file) }}
79+
{{ (include "readmeIncludesDir" $file) }}
7980
{{- end }}
8081
{{- end }}
8182
{{- end }}

0 commit comments

Comments
 (0)