2
1
Fork 0
quickshell-docs/layouts/partials/qmltype.html

29 lines
808 B
HTML

{{- if eq .type "unknown" -}}
unknown
{{- else -}}
{{- $link := "#ERROR" -}}
{{- if eq .type "qt" -}}
{{- $link = printf "https://doc.qt.io/qt-6/%s-%s.html" (lower (replace .module "." "-")) (lower .name) -}}
{{- else if eq .type "local" -}}
{{- $link = printf "/docs/types/%s/%s" (lower .module) (lower .name) -}}
{{- end -}}
{{- $of := "" -}}
{{- if .of -}}
{{- $of = printf "<%s>" (partial "qmltype.html" .of) }}
{{- end -}}
{{- $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 -}}