2023-02-18 00:04:20 +00:00
|
|
|
{{ define "schema" }}
|
|
|
|
<code>
|
|
|
|
{{ with .element }}
|
|
|
|
{{ with $.name }}
|
2023-02-18 12:02:00 +00:00
|
|
|
<div class="nameblock"><span class="name">{{ . }}</span>:</div>
|
2023-02-18 00:04:20 +00:00
|
|
|
{{ end }}
|
2023-02-18 00:27:11 +00:00
|
|
|
{{ if (eq $.kind "array") }}
|
|
|
|
<span class="kind {{ $.kind }}">arrayOf</span> [
|
|
|
|
{{ template "schema" . }}
|
|
|
|
]
|
|
|
|
{{ end }}
|
|
|
|
{{ if (eq $.kind "dictionary") }}
|
|
|
|
<span class="kind {{ $.kind }}">dictionary</span>
|
|
|
|
<div class="dict">
|
|
|
|
<
|
|
|
|
<span class="key">
|
|
|
|
<span class="kind {{ $.key.kind }}">{{ $.key.name }}</span></span
|
|
|
|
>, <span class="element">{{ template "schema" . }}</span>>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2023-02-18 00:04:20 +00:00
|
|
|
{{ else }}
|
|
|
|
{{ if (eq .name .kind) }}
|
2023-02-18 00:27:11 +00:00
|
|
|
<span class="kind {{ $.kind }}">{{ .kind }}</span>
|
2023-02-18 00:04:20 +00:00
|
|
|
{{ else }}
|
|
|
|
{{ with .name }}
|
|
|
|
<div class="nameblock">
|
|
|
|
<span class="name">{{ . }}</span>{{ if $.isPointer }}
|
|
|
|
<abbr class="pointer" title="Optional, might not be in the object"
|
|
|
|
>*</abbr
|
|
|
|
>
|
2023-02-18 12:02:00 +00:00
|
|
|
{{ end }}:
|
2023-02-18 00:04:20 +00:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
2023-02-18 00:27:11 +00:00
|
|
|
<span class="kind {{ $.kind }}">{{ .kind }}</span>
|
2023-02-18 00:04:20 +00:00
|
|
|
{{ end }}
|
|
|
|
{{ with .keys }}
|
|
|
|
{
|
|
|
|
{{ range . }}
|
|
|
|
<ul>
|
|
|
|
<li>{{ template "schema" . }}</li>
|
|
|
|
</ul>
|
|
|
|
{{ end }}
|
|
|
|
}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</code>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "main" }}
|
|
|
|
{{ $keys := .Site.Data.api.v310.api }}
|
|
|
|
<main class="apidocs">
|
|
|
|
<nav>
|
|
|
|
<ul>
|
|
|
|
{{ range $key, $spec := $keys }}
|
|
|
|
<li>
|
|
|
|
<a href="#{{ anchorize $key }}" class="monotitle">{{ $key }}</a>
|
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<div class="doc">
|
|
|
|
<section class="copy">{{ .Content }}</section>
|
|
|
|
<section class="reference">
|
|
|
|
{{ range $key, $spec := $keys }}
|
|
|
|
<article class="api" id="{{ anchorize $key }}">
|
|
|
|
<header>
|
|
|
|
<h3>
|
|
|
|
<span class="monotitle">{{ $key }}</span> {{ range .tags }}
|
|
|
|
<span class="tag {{ . }}">{{ . }}</span>
|
|
|
|
{{ end }}
|
|
|
|
</h3>
|
|
|
|
{{ with .description }}
|
|
|
|
<div class="description">{{ . }}</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ with .schema }}
|
|
|
|
<div class="schema">
|
|
|
|
{{ template "schema" . }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</header>
|
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
{{ end }}
|