{{- $colorMandatory := "#DD0055" -}} {{- $colorOptional := "#2567D1" -}} {{- $name := .Get "name" -}} {{- $prefix := .Get "prefix" }} {{- $found := false -}} {{- range .Site.Data.fpnaming -}} {{- if eq .name $name -}} {{- $.Scratch.Set "data" . -}} {{- end -}} {{- end -}} {{ $data := $.Scratch.Get "data" }} {{- $n := sub (len $data.entries) 1 -}}
{{- if $prefix }} {{- $prefix -}} {{ $.Scratch.Add "example" (slice $prefix) }} {{- end -}} {{- range $i, $d := $data.entries -}} {{- if $d.delimiter }}{{ $.Scratch.Set "delim" $d.delimiter }}{{ else }}{{ $.Scratch.Set "delim" "_" }}{{ end -}} {{ $delim := $.Scratch.Get "delim" }} {{- if $d.example -}} {{- if $.Scratch.Get "example" -}}{{- $.Scratch.Add "example" (slice $delim) -}}{{- end -}} {{- if $d.prefix }}{{ $.Scratch.Add "example" (slice $d.prefix) }}{{ end -}} {{- $.Scratch.Add "example" (slice $d.example) -}} {{- if $d.suffix }}{{ $.Scratch.Add "example" (slice $d.suffix) }}{{ end -}} {{ end -}} {{- if $d.title -}} {{- $.Scratch.Add "code" (slice $d.code) }} {{- $.Scratch.Add "title" (slice $d.title) }} {{- if $d.optional }} {{- $.Scratch.Add "optional" (slice "yes") -}} {{- else -}} {{- $.Scratch.Add "optional" (slice "no") -}} {{- end -}} {{ else }}"color: {{ $colorMandatory }}">{{- end -}} {{- if gt $i 0 }}{{ $delim }}{{ end -}} {{- if $d.prefix -}}{{- $d.prefix -}}{{- end -}}[{{- $d.code -}}] {{- if $d.suffix -}}{{- $d.suffix -}}{{ end -}} {{- else -}} {{- if gt $i 0 }}{{ $delim }}{{ end -}} {{- $d.code -}} {{- end -}} {{- end -}}
{{- $titles := $.Scratch.Get "title" -}} {{- $codes := $.Scratch.Get "code" -}} {{- $optionals := $.Scratch.Get "optional" -}} {{- if gt (len $codes) 0 }}

{{ end -}} {{- if $data.skip_example -}} {{- else -}}

Example:

{{ range $.Scratch.Get "example" }}{{ . }}{{ end }}
{{- end -}}