initial commit
This commit is contained in:
commit
27b3274027
25 changed files with 1696 additions and 0 deletions
18
layouts/docs/single.html
Normal file
18
layouts/docs/single.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{ define "main" }}
|
||||
<div class='mx-auto flex {{ partial "utils/page-width" . }}'>
|
||||
{{ partial "sidebar.html" (dict "context" .) }}
|
||||
{{ partial "toc.html" . }}
|
||||
<article class="w-full break-words flex min-h-[calc(100vh-var(--navbar-height))] min-w-0 justify-center pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
|
||||
<main class="w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
<div class="content">
|
||||
{{- if not (isset .Params "hidetitle") -}}<h1>{{ .Title }}</h1>{{- end -}}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ partial "components/last-updated.html" . }}
|
||||
{{ partial "components/pager.html" . }}
|
||||
{{ partial "components/comments.html" . }}
|
||||
</main>
|
||||
</article>
|
||||
</div>
|
||||
{{ end }}
|
6
layouts/partials/qmlparams.html
Normal file
6
layouts/partials/qmlparams.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{- $first := true -}}
|
||||
{{- range $param, $type := . -}}
|
||||
{{- if ne $first true -}}, {{ end -}}
|
||||
{{- $first = false -}}
|
||||
{{ $param }}: {{ partial "qmltype.html" $type }}
|
||||
{{- end -}}
|
17
layouts/partials/qmltype.html
Normal file
17
layouts/partials/qmltype.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{{- 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 -}}
|
||||
|
||||
<a href="{{ $link }}">{{ .name }}</a>{{ $of | safeHTML -}}
|
||||
{{- end -}}
|
14
layouts/shortcodes/qmlmodule.html
Normal file
14
layouts/shortcodes/qmlmodule.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{- $modulename := .Get "module" -}}
|
||||
{{- $module := index .Site.Data.modules $modulename -}}
|
||||
{{- $module.index.description | $.Page.RenderString (dict "display" "block") -}}
|
||||
<h3>Types</h3>
|
||||
<table>
|
||||
{{- range $name, $type := $module -}}
|
||||
{{- if ne $name "index" -}}
|
||||
<tr>
|
||||
<td><a href="/docs/types/{{ lower $modulename }}/{{ lower $name }}">{{ $name }}</a></td>
|
||||
<td>{{ $type.description }}</td>
|
||||
</tr>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</table>
|
8
layouts/shortcodes/qmlmodulelisting.html
Normal file
8
layouts/shortcodes/qmlmodulelisting.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<table>
|
||||
{{- range $name, $module := .Site.Data.modules -}}
|
||||
<tr>
|
||||
<td><a href="/docs/types/{{ lower $name }}">{{ $name }}</a></td>
|
||||
<td>{{ $module.index.shortDescription }}</td>
|
||||
</tr>
|
||||
{{- end -}}
|
||||
</table>
|
204
layouts/shortcodes/qmltype.html
Normal file
204
layouts/shortcodes/qmltype.html
Normal file
|
@ -0,0 +1,204 @@
|
|||
{{ $modulename := .Get "module" }}
|
||||
{{ $typename := .Get "type" }}
|
||||
{{ $type := index .Site.Data.modules $modulename $typename }}
|
||||
|
||||
{{- define "partials/qmltypeflag.html" -}}
|
||||
{{- if eq . "default" -}}
|
||||
<span title="Components written directly into an object are collected in its default property.">{{ . }}</span>
|
||||
{{- else if eq . "singleton" -}}
|
||||
<span title="Only one instance of this type exists, accessible by its name.">{{ . }}</span>
|
||||
{{- else if eq . "uncreatable" -}}
|
||||
<span title="This type cannot be manually created.">{{ . }}</span>
|
||||
{{- else if eq . "readonly" -}}
|
||||
<span title="This property cannot be assigned to, only read from.">{{ . }}</span>
|
||||
{{- else if eq . "writeonly" -}}
|
||||
<span title="This property cannot be read, only assigned.">{{ . }}</span>
|
||||
{{- else -}}
|
||||
<span>{{ . }}</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "partials/qmltypeflags.html" -}}
|
||||
{{- $first := true -}}
|
||||
[
|
||||
{{- range $flag := . }}
|
||||
{{- if not $first -}}, {{ end -}}
|
||||
{{- $first = false -}}
|
||||
{{ partial "qmltypeflag.html" $flag }}
|
||||
{{- end -}}
|
||||
]
|
||||
{{- end -}}
|
||||
|
||||
<h1>
|
||||
{{ $typename -}}
|
||||
<span class="typegray" style="font-weight: normal">
|
||||
{{- if eq $type.type "class" -}}
|
||||
: {{ partial "qmltype.html" $type.super }}
|
||||
{{ if $type.flags -}}
|
||||
<span class="qmlprops">{{ partial "qmltypeflags.html" $type.flags }}</span>
|
||||
{{- end -}}
|
||||
{{- else if eq $type.type "enum" -}}
|
||||
<span class="qmlprops">[enum]</span>
|
||||
{{- end -}}
|
||||
</span>
|
||||
</h1>
|
||||
|
||||
<code>
|
||||
<i>import {{ $modulename }}</i>
|
||||
</code>
|
||||
|
||||
{{- if $type.description -}}
|
||||
<br><br>
|
||||
{{- $type.description | $.Page.RenderString (dict "display" "inline") }}
|
||||
{{ if $type.details -}} <a href="#details">More</a> {{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.properties -}}
|
||||
<h4>Properties</h4>
|
||||
<ul>
|
||||
{{- range $propname, $prop := $type.properties -}}
|
||||
<li>
|
||||
<span class="typegray">
|
||||
<a href="#prop.{{ $propname }}">{{ $propname }}</a>
|
||||
{{- if not $prop.type.gadget -}}
|
||||
: {{ partial "qmltype.html" $prop.type }}
|
||||
{{- end -}}
|
||||
{{ if in $prop.flags "default" }}
|
||||
[{{ partial "qmltypeflag.html" "default" }}]
|
||||
{{ end }}
|
||||
</span>
|
||||
{{- if $prop.type.gadget -}}
|
||||
<ul>
|
||||
{{- range $gadgetname, $gadgettype := $prop.type.gadget -}}
|
||||
<li>
|
||||
<a href="#prop.{{ $propname }}">{{ $propname }}.{{ $gadgetname }}</a>:
|
||||
{{ partial "qmltype.html" $gadgettype }}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.functions -}}
|
||||
<h4>Functions</h4>
|
||||
<ul>
|
||||
{{- range $funcname, $func := $type.functions -}}
|
||||
<li>
|
||||
<span class="typegray">
|
||||
{{ partial "qmltype.html" $func.ret }}
|
||||
<a href="#func.{{ $funcname }}">{{ $funcname }}</a>(
|
||||
{{- partial "qmlparams.html" $func.params -}}
|
||||
)
|
||||
</span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.variants -}}
|
||||
<h4>Variants</h4>
|
||||
<ul>
|
||||
{{- range $name, $variant := $type.variants -}}
|
||||
<li>
|
||||
<span class="typegray">
|
||||
<a href="#variant.{{ $name }}">{{ $name }}</a>
|
||||
</span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.details -}}
|
||||
<h3 id="details">Detailed Description</h3>
|
||||
{{- $type.details | $.Page.RenderString (dict "display" "block") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.properties -}}
|
||||
<h3>Property Details</h3>
|
||||
{{ range $propname, $prop := $type.properties }}
|
||||
<div id="prop.{{ $propname }}" class = "qmlpropdef">
|
||||
{{- if $prop.flags -}}
|
||||
<span class="qmlprops typegray">
|
||||
{{ partial "qmltypeflags.html" $prop.flags }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $prop.type.gadget -}}
|
||||
{{- range $gadgetname, $gadgettype := $prop.type.gadget -}}
|
||||
<p id="prop.{{ $propname }}.{{ $gadgetname }}">
|
||||
{{ $propname }}.{{ $gadgetname -}}
|
||||
<span class="typegray">:
|
||||
{{ partial "qmltype.html" $gadgettype -}}
|
||||
<span>
|
||||
</p>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<p>
|
||||
{{ $propname -}}
|
||||
<span class="typegray">:
|
||||
{{ partial "qmltype.html" $prop.type -}}
|
||||
<span>
|
||||
</p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
<div class="qmlpropdetails">
|
||||
{{- if $prop.details -}}
|
||||
{{- $prop.details | $.Page.RenderString (dict "display" "block") -}}
|
||||
{{- else -}}
|
||||
<p style="color: #999999"><i>No details provided.</i></p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.functions -}}
|
||||
<h3>Function Details</h3>
|
||||
{{ range $funcname, $func := $type.functions }}
|
||||
<div id="func.{{ $funcname }}" class = "qmlpropdef">
|
||||
{{- if $func.flags -}}
|
||||
<span class="qmlprops typegray">
|
||||
{{ partial "qmltypeflags.html" $func.flags }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
<p>
|
||||
<span class="typegray">
|
||||
{{ partial "qmltype.html" $func.ret -}}
|
||||
</span>
|
||||
{{ $funcname -}}
|
||||
<span class="typegray">(
|
||||
{{- partial "qmlparams.html" $func.params -}}
|
||||
)</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="qmlpropdetails">
|
||||
{{- if $func.details -}}
|
||||
{{- $func.details | $.Page.RenderString (dict "display" "block") -}}
|
||||
{{- else -}}
|
||||
<p style="color: #999999"><i>No details provided.</i></p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $type.variants -}}
|
||||
<h3>Variant Details</h3>
|
||||
{{ range $name, $variant := $type.variants }}
|
||||
<div id="variant.{{ $name }}" class = "qmlpropdef">
|
||||
<p>{{ $name -}}</p>
|
||||
</div>
|
||||
|
||||
<div class="qmlpropdetails">
|
||||
{{- if $variant.details -}}
|
||||
{{- $variant.details | $.Page.RenderString (dict "display" "block") -}}
|
||||
{{- else -}}
|
||||
<p style="color: #999999"><i>No details provided.</i></p>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue