{{ define "packages" }}
{{ range .packages }} {{/* Only display package that has a group name */}} {{ if ne .GroupName "" }}

Package: {{- .DisplayName -}}

{{ .GetComment }}

{{ end }} {{ end }} {{ range .packages }} {{ if ne .GroupName "" }} {{/* TODO: Make the following line conditional */}}

Resource Types:

{{/* For package with a group name, list all type definitions in it. */}} {{ range .VisibleTypes }} {{- if or .Referenced .IsExported -}} {{ template "type" . }} {{- end -}} {{ end }} {{ else }} {{/* For package without a group name, list only type definitions that are referenced. */}} {{ range .VisibleTypes }} {{ if .Referenced }} {{ template "type" . }} {{ end }} {{ end }} {{ end }}
{{ end }}
{{ end }}