docs: children -> option

This commit is contained in:
phaer 2024-06-14 15:32:42 +02:00
parent 4266fcc0ab
commit d4c77a62d6
2 changed files with 11 additions and 11 deletions

View File

@ -32,7 +32,7 @@ i.e. from inside the shell in `./docs`:
``` shellsession
# update
ln -sfT $(nix build --print-out-paths --no-link ..#reference) ./src/reference
ln -sfT $(nix build --print-out-paths --no-link ..#optionsReference) ./src/reference
# remove
rm ./src/reference
```

View File

@ -1,37 +1,37 @@
## Options
{%- for name, children in options.items() recursive %}
{%- for name, option in options.items() recursive %}
##{{loop.depth * "#"}} {{ name }}
{% if "type" in children -%}
{% if "type" in option -%}
{{ children.description }}
{{ option.description }}
<table>
<tr>
<td>type</td>
<td><code>{{ children.type }}</code> {{ "(read only)" if children.readOnly else "" }}</td>
<td><code>{{ option.type }}</code> {{ "(read only)" if option.readOnly else "" }}</td>
</tr>
<tr>
<td>source</td>
<td>{%- for d in children.declarations -%}<a href="{{d.url}}">{{d.name}}</a>{{ ", " if not loop.last else "" }}{%- endfor -%}</td>
<td>{%- for d in option.declarations -%}<a href="{{d.url}}">{{d.name}}</a>{{ ", " if not loop.last else "" }}{%- endfor -%}</td>
</tr>
{%- if children.default -%}
{%- if option.default -%}
<tr>
<td>default</td>
<td><pre>{{(children.default | default({})).text}}</pre></td>
<td><pre>{{(option.default | default({})).text}}</pre></td>
</tr>
{%- endif -%}
{%- if children.example -%}
{%- if option.example -%}
<tr>
<td>example</td>
<td>
<pre>{{(children.example | default({})).text | replace("\n", "\\n")}}</pre>
<pre>{{(option.example | default({})).text | replace("\n", "\\n")}}</pre>
</td>
</tr>
{%- endif -%}
</table>
{%- else -%}
{{ loop(children.items()) }}
{{ loop(option.items()) }}
{%- endif %}
{%- endfor %}