Nope, you can’t use “logic” (or let’s call it go functions). What you can do is look at the shortcode documentation and create a shortcode. That is usable in markdown files.
I must be doing something wrong… when I use {{% shortcode %}} instead of {{< shortcode >}}, the shortcode HTML shows up as raw HTML (<h3>...</h3>) instead of as rendered HTML.
Sorry for the confusion, that was meant to be an example – from the shortcode I posted, everything in angle brackets (<p>, <h3>, <h2>, <li>) shows up verbatim because it was indented, and the markdown processor changed that into a <pre> block. I now have (in the same .html file):
{{ range $tab := .Site.Data.configuration }}
## {{ $tab.name }}
{{ $tab.description }}
{{ range $pref, $details := $tab.preferences }}
#### {{ $pref }}
default: `{{ $details.default }}`
{{ $details.description }}
{{ with $details.options }}
Options:
{{ range $option := . }}
* {{ $option }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}