|
18 | 18 | {{- range . -}}{{ $sectionContent := index (ds "config") . -}}{{ if and $sectionContent (gt (len $sectionContent) 2048) -}}{{ . }} {{ end -}}{{ end -}} |
19 | 19 | {{- end -}} |
20 | 20 | {{- $firstNonEmptySection := (tmpl.Exec "nonEmptySections" $sections) | strings.TrimSpace | regexp.Replace " .*" "" -}} |
| 21 | + |
| 22 | +{{/* Inspired https://github.com/Dirrk/action-docs/blob/master/src/default_template.tpl */}} |
| 23 | +{{- define "escape_chars" }}{{ . | strings.ReplaceAll "_" "\\_" | strings.ReplaceAll "|" "\\|" | strings.ReplaceAll "*" "\\*" }}{{- end }} |
| 24 | +{{- define "sanatize_string" }}{{ . | strings.ReplaceAll "\n\n" "<br><br>" | strings.ReplaceAll " \n" "<br>" | strings.ReplaceAll "\n" "<br>" | tmpl.Exec "escape_chars" }}{{- end }} |
| 25 | + |
21 | 26 | {{- define "tip_use_atmos" }} |
22 | 27 | {{- if .is_terraform }} |
23 | 28 | > [!TIP] |
@@ -204,6 +209,29 @@ We literally have <a href="{{ $terraform_modules }}">*hundreds of other terrafor |
204 | 209 | <!-- markdownlint-restore --> |
205 | 210 | {{ end }} |
206 | 211 |
|
| 212 | +{{- $action := (datasource "config") -}} |
| 213 | +{{ if has $action "inputs" }} |
| 214 | +## Inputs |
| 215 | +<!-- markdownlint-disable --> |
| 216 | +| Name | Description | Default | Required | |
| 217 | +|------|-------------|---------|----------| |
| 218 | +{{- range $key, $input := $action.inputs }} |
| 219 | +| {{ tmpl.Exec "escape_chars" $key }} | {{ if (has $input "description") }}{{ tmpl.Exec "sanatize_string" $input.description }}{{ else }}{{ tmpl.Exec "escape_chars" $key }}{{ end }} | {{ if (has $input "default") }}{{ tmpl.Exec "sanatize_string" $input.default }}{{ else }}N/A{{ end }} | {{ if (has $input "required") }}{{ $input.required }}{{ else }}false{{ end }} | |
| 220 | +{{- end }} |
| 221 | +<!-- markdownlint-restore --> |
| 222 | +{{- end }} |
| 223 | + |
| 224 | +{{ if has $action "outputs" }} |
| 225 | +## Outputs |
| 226 | +<!-- markdownlint-disable --> |
| 227 | +| Name | Description | |
| 228 | +|------|-------------| |
| 229 | +{{- range $key, $output := $action.outputs }} |
| 230 | +| {{ tmpl.Exec "escape_chars" $key }} | {{ if (has $output "description") }}{{ tmpl.Exec "sanatize_string" $output.description }}{{ else }}{{ tmpl.Exec "escape_chars" $key }}{{ end }} | |
| 231 | +{{- end }} |
| 232 | +<!-- markdownlint-restore --> |
| 233 | +{{- end }} |
| 234 | + |
207 | 235 | {{ if has (ds "config") "include" }} |
208 | 236 | {{ range $file := (datasource "config").include -}} |
209 | 237 | {{ (include "includes" $file) }} |
|
0 commit comments