2
1
Fork 0

typegen: add shorthand for type/property links

This commit is contained in:
outfoxxed 2024-07-14 16:16:37 -07:00
parent 11ff70f1a8
commit db5c3aa3f4
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 115 additions and 24 deletions

View file

@ -13,5 +13,16 @@
{{- $of = printf "<%s>" (partial "qmltype.html" .of) }}
{{- end -}}
<a href="{{ $link }}">{{ .name }}</a>{{ $of | safeHTML -}}
{{- $member := "" -}}
{{- if .prop -}}
{{- $member = printf ".%s" .prop -}}
{{- if eq .type "qt" -}}
{{- $link = printf "%s#%s-prop" $link .prop -}}
{{- else if eq .type "local" -}}
{{- $link = printf "%s#prop.%s" $link .prop -}}
{{- end -}}
{{- end -}}
<a href="{{ $link }}">{{ .name }}{{ $member }}</a>{{ $of | safeHTML -}}
{{- end -}}