doc/user/layouts/shortcodes/explain-plans/operator-table.skill.md
{{- /* Skill output: operator-table renders as markdown table */ -}} {{- $dataFile := .Get "data" -}} {{- $planType := .Get "planType" -}}
{{- if not $dataFile -}} {{- errorf "operator-table shortcode requires a 'data' parameter" -}} {{- end -}} {{- if not $planType -}} {{- errorf "operator-table shortcode requires a 'planType' parameter" -}} {{- end -}}
{{- $data := index $.Site.Data $dataFile -}}
{{- $filteredOperators := slice -}} {{- range $data.operators -}} {{- if in .plan_types $planType -}} {{- $filteredOperators = $filteredOperators | append . -}} {{- end -}} {{- end -}}
{{- if gt (len $filteredOperators) 0 -}} The following table lists the operators that are available in the {{ $planType }} plan.
{{- $rows := slice -}} {{- range $filteredOperators -}} {{- $description := .description | markdownify -}} {{- $expansiveText := "No" -}} {{- if .expansive -}} {{- $expansiveText = .expansive_details | markdownify -}} {{- end -}} {{- $memoryText := "No" -}} {{- if .uses_memory -}} {{- $memoryText = printf "✅ %s" (.memory_details | markdownify) -}} {{- end -}} {{- $fullDescription := printf "%s\n\nCan increase data size: %s\nUses memory: %s" $description $expansiveText $memoryText -}} {{- $row := dict "Operator" (printf "%s" .operator) "Description" $fullDescription "Example" (.example | markdownify) -}} {{- $rows = $rows | append $row -}} {{- end -}}
{{- $columns := slice -}} {{- $columns = $columns | append (dict "column" "Operator") -}} {{- $columns = $columns | append (dict "column" "Description") -}} {{- $columns = $columns | append (dict "column" "Example") -}}
{{- partial "yaml-tables/generic-table.skill.md" (dict "rows" $rows "columns" $columns) -}}
Notes: