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

52 lines
1.4 KiB
HTML
Raw Normal View History

2024-02-12 12:07:01 +00:00
{{- if eq .type "unknown" -}}
unknown
{{- else -}}
{{- $link := "" -}}
2024-02-12 12:07:01 +00:00
{{- 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 -}}
{{- $prefix := "" -}}
{{- $member := "" -}}
{{- if .mtype -}}
{{- if .type -}}
{{- $member = printf ".%s" .mname -}}
{{- else -}}
{{- $member = .mname -}}
{{- end -}}
{{- if eq .mtype "prop" -}}
{{- if eq .type "qt" -}}
{{- $link = printf "%s#%s-prop" $link .mname -}}
{{- else -}}
{{- $link = printf "%s#prop.%s" $link .mname -}}
{{- end -}}
{{- else if eq .mtype "func" -}}
{{- $member = printf "%s()" $member -}}
{{- if eq .type "qt" -}}
{{- $link = printf "%s#%s-method" $link .mname -}}
{{- else -}}
{{- $link = printf "%s#func.%s" $link .mname -}}
{{- end -}}
{{- else if eq .mtype "signal" -}}
{{- $prefix = "[signal] " -}}
{{- $member = printf "%s()" $member -}}
{{- if eq .type "qt" -}}
{{- $link = printf "%s#%s-signal" $link .mname -}}
{{- else -}}
{{- $link = printf "%s#signal.%s" $link .mname -}}
{{- end -}}
{{- end -}}
{{- end -}}
<a href="{{ $link }}">{{ $prefix }}{{ .name }}{{ $member }}</a>{{ $of | safeHTML -}}
2024-02-12 12:07:01 +00:00
{{- end -}}