{{- $featureDataFiles := .Site.GetPage "page" "docs/reference/command-line-tools-reference/feature-gates" -}} {{- $removedFeatureGateRequested := .Get "show-removed" -}} {{- $includeValues := .Get "include" -}} {{- $sortedFeatureGates := sort ($featureDataFiles.Resources.ByType "page") -}}
{{- range $featureGateFile := $sortedFeatureGates -}} {{- $featureGateName := $featureGateFile.Params.Title -}} {{- $removedStatusForFeature := index $featureGateFile.Params.Removed -}} {{- $shouldDisplayThisFeatureGate := false -}} {{- if not (isSet $featureGateFile.Params "stages") -}} {{- warnf "Stages parameter is missing in the front matter for %s in %s" $featureGateName (print $featureGateFile.File.Lang "/" $featureGateFile.File.Path) -}} {{- else -}} {{- range $stage := $featureGateFile.Params.stages -}} {{- if and (eq ($stage).stage "stable") (in $includeValues "ga") -}} {{- $shouldDisplayThisFeatureGate = true -}} {{- continue -}} {{- end -}} {{- if (in $includeValues ($stage).stage ) -}} {{- $shouldDisplayThisFeatureGate = true -}} {{- continue -}} {{- end -}} {{- end -}} {{- if and (not $removedFeatureGateRequested) ($removedStatusForFeature) -}} {{- $shouldDisplayThisFeatureGate = false -}} {{- end -}} {{- if and ($removedFeatureGateRequested) ($removedStatusForFeature) -}} {{- $shouldDisplayThisFeatureGate = true -}} {{- end -}} {{- end -}} {{- if $shouldDisplayThisFeatureGate -}} {{- with $featureGateFile.Content -}}
{{ $featureGateName }}
{{- $hasParagraphWrapper := (hasPrefix ( . | markdownify ) "

") -}} {{- if not $hasParagraphWrapper }}

{{ end -}} {{ . | markdownify -}} {{- if not $hasParagraphWrapper }}

{{ end -}}
{{- end -}} {{- end -}} {{- end -}}