Files
terraform-docs/format/templates/asciidoc_table_resources.tmpl
Khosrow Moossavi 90942f73b8 Move format package from internal to public
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 14:43:26 -04:00

24 lines
885 B
Cheetah

{{- if or .Settings.ShowResources .Settings.ShowDataSources -}}
{{- if not .Module.Resources -}}
{{- if not .Settings.HideEmpty -}}
{{- indent 0 "=" }} Resources
No resources.
{{ end }}
{{ else }}
{{- indent 0 "=" }} Resources
[cols="a,a",options="header,autowidth"]
|===
|Name |Type
{{- range .Module.Resources }}
{{- $isResource := and $.Settings.ShowResources ( eq "resource" (printf "%s" .GetMode)) }}
{{- $isDataResource := and $.Settings.ShowDataSources ( eq "data source" (printf "%s" .GetMode)) }}
{{- if or $isResource $isDataResource }}
{{- $fullspec := ternary .URL (printf "%s[%s]" .URL .Spec) .Spec }}
|{{ $fullspec }} |{{ .GetMode }}
{{- end }}
{{- end }}
|===
{{ end }}
{{ end -}}