pulumi/pkg/codegen/docs/templates/properties.tmpl
Christian Nunciato 3b8a0dd3e3
Remove leading and trailing whitespace in resource properties (#6959)
* Remove leading and trailing whitespace in resource properties

* Make tests pass

* Add PULUMI_ACCEPT support to docs gen tests

* Handle a couple more places

Co-authored-by: Pat Gavlin <pat@pulumi.com>
2021-05-04 17:59:30 -07:00

27 lines
1.3 KiB
Cheetah

{{ define "properties" }}
{{- range $lang, $props := . }}
{{ print "{{% choosable language" }} {{ print $lang }} {{ print "%}}" }}
<dl class="resources-properties">
{{- range . -}}
<dt class="property-{{- if .IsInput -}}{{- if .IsRequired -}}required{{- else -}}optional{{- end -}}{{- end -}}{{ if .DeprecationMessage }} property-deprecated{{- end -}}"
title="{{ if .IsInput -}}{{- if .IsRequired -}}Required{{- else -}}Optional{{- end -}}{{- end -}}{{- if .DeprecationMessage -}}, Deprecated{{- end -}}">
<span id="{{ htmlSafe .ID }}">{{ template "linkify_wo_style" . }}</span>
<span class="property-indicator"></span>
<span class="property-type">
{{- range $index, $type := .Types }}
{{- if gt $index 0 }} | {{ end -}}
{{- if eq .Link "#" "" -}}{{- htmlSafe .DisplayName -}}{{- else -}}{{ template "linkify" . }}{{- end -}}
{{- end -}}
</span>
</dt>
<dd>{{- print "{{% md %}}" -}}{{- htmlSafe .Comment -}}{{- print "{{% /md %}}" -}}{{- if .DeprecationMessage -}}<p class="property-message">Deprecated: {{ print "{{% md %}}" -}}{{- .DeprecationMessage -}}{{- print "{{% /md %}}" -}}</p>{{- end -}}
</dd>
{{- end -}}
</dl>
{{ print "{{% /choosable %}}" }}
{{- end }}
{{- end }}