{{- define "headings" }} {{ if .Title -}} {{ print (strings.Repeat (sub .Level 1) "\t") }}
  • {{ print (strings.Repeat (sub .Level 1) "\t") }}{{.Title | htmlUnescape}} {{- if .Headings }} {{ print (strings.Repeat (sub .Level 1) "\t") }}
      {{- range $k, $v := .Headings }} {{- template "headings" $v }} {{- end }} {{ print (strings.Repeat (sub .Level 1) "\t") }}
    {{- end }} {{ print (strings.Repeat (sub .Level 1) "\t") }}
  • {{- else }} {{- if .Headings -}} {{ print (strings.Repeat .Level "\t") }}
      {{- range $k, $v := .Headings }} {{- template "headings" $v }} {{- end }} {{ print (strings.Repeat .Level "\t") }}
    {{- end }} {{- end }} {{- end }}