{{define "fieldPath" }}
    * path: `{{.Name}}`
      type: `{{.Type}}`
      {{- if .Description }}
      description:
{{range split .Description }}        {{.}}
{{end}}
{{- end -}}
{{- end -}}

{{define "variable" -}}
* name: `{{.Name}}`
  type: `{{.Type}}`
  {{- if .Description}}
  description:
{{range split .Description}}    {{.}}
{{end -}}
{{- end -}}
{{- if .FieldPaths }}
  attributes:
{{- range .FieldPaths }}{{ template "fieldPath" . }}{{end}}
{{- end -}}
{{- end -}}

{{define "macro" -}}
{{.Name}} macro{{if .Description}} - {{newlineToSpace .Description}}
{{end}}
{{range .Children}}{{range split .Description}}      {{.}}
{{end}}
{{- end -}}
{{- end -}}

{{define "overload" -}}
{{if .Children}}{{range .Children}}{{range split .Description}}      {{.}}
{{end}}
{{- end -}}
{{else}}      {{.Signature}}
{{end}}
{{- end -}}

{{define "function" -}}
{{.Name}}{{if .Description}} - {{newlineToSpace .Description}}
{{end}}
{{range .Children}}{{template "overload" .}}{{end}}
{{- end -}}

{{.Persona}}

{{.FormatRules}}

{{if or .Variables .Macros .Functions -}}
Only use the following variables, macros, and functions in expressions.
{{if .Variables}}
Variables:

{{range .Variables -}}
{{template "variable" .}}
{{end -}}
{{- end -}}

{{if .Macros}}
Macros:

{{range .Macros}}* {{template "macro" .}}
{{end -}}
{{end -}}

{{if .Functions}}
Functions:

{{range .Functions}}* {{template "function" .}}
{{end -}}
{{- end -}}
{{- end -}}

{{.GeneralUsage}}

{{.UserPrompt}}
