mirror of
https://git.sr.ht/~ashkeel/strimertul-website
synced 2024-12-21 23:12:19 +00:00
dictionary support
This commit is contained in:
parent
59a0b97cbe
commit
73ea620b98
2 changed files with 30 additions and 5 deletions
|
@ -4,12 +4,23 @@
|
|||
{{ with $.name }}
|
||||
<div class="nameblock"><span class="name">{{ . }}</span>:</div>
|
||||
{{ end }}
|
||||
arrayOf [
|
||||
{{ template "schema" . }}
|
||||
]
|
||||
{{ 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 }}
|
||||
{{ else }}
|
||||
{{ if (eq .name .kind) }}
|
||||
<span class="kind">{{ .kind }}</span>
|
||||
<span class="kind {{ $.kind }}">{{ .kind }}</span>
|
||||
{{ else }}
|
||||
{{ with .name }}
|
||||
<div class="nameblock">
|
||||
|
@ -20,7 +31,7 @@
|
|||
{{ end }}:
|
||||
</div>
|
||||
{{ end }}
|
||||
<span class="kind">{{ .kind }}</span>
|
||||
<span class="kind {{ $.kind }}">{{ .kind }}</span>
|
||||
{{ end }}
|
||||
{{ with .keys }}
|
||||
{
|
||||
|
|
|
@ -78,6 +78,11 @@
|
|||
.nameblock {
|
||||
display: none;
|
||||
}
|
||||
.kind.array,
|
||||
.kind.object,
|
||||
.kind.dictionary {
|
||||
color: $grass12;
|
||||
}
|
||||
li {
|
||||
list-style-type: none;
|
||||
& > code > .nameblock {
|
||||
|
@ -90,6 +95,15 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
.dict {
|
||||
display: inline;
|
||||
.key {
|
||||
display: inline;
|
||||
}
|
||||
.element {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
|
Loading…
Reference in a new issue