Files
terraform-docs/format/templates/markdown_document_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

21 lines
864 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
The following resources are used by this module:
{{ 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)" .Spec .URL) .Spec }}
- {{ $fullspec }} {{ printf "(%s)" .GetMode -}}
{{- end }}
{{- end }}
{{ end }}
{{ end -}}