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 ``` shellsession
# update # 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 # remove
rm ./src/reference rm ./src/reference
``` ```

View File

@ -1,37 +1,37 @@
## Options ## Options
{%- for name, children in options.items() recursive %} {%- for name, option in options.items() recursive %}
##{{loop.depth * "#"}} {{ name }} ##{{loop.depth * "#"}} {{ name }}
{% if "type" in children -%} {% if "type" in option -%}
{{ children.description }} {{ option.description }}
<table> <table>
<tr> <tr>
<td>type</td> <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>
<tr> <tr>
<td>source</td> <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> </tr>
{%- if children.default -%} {%- if option.default -%}
<tr> <tr>
<td>default</td> <td>default</td>
<td><pre>{{(children.default | default({})).text}}</pre></td> <td><pre>{{(option.default | default({})).text}}</pre></td>
</tr> </tr>
{%- endif -%} {%- endif -%}
{%- if children.example -%} {%- if option.example -%}
<tr> <tr>
<td>example</td> <td>example</td>
<td> <td>
<pre>{{(children.example | default({})).text | replace("\n", "\\n")}}</pre> <pre>{{(option.example | default({})).text | replace("\n", "\\n")}}</pre>
</td> </td>
</tr> </tr>
{%- endif -%} {%- endif -%}
</table> </table>
{%- else -%} {%- else -%}
{{ loop(children.items()) }} {{ loop(option.items()) }}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}