docs: improve options reference layout

This commit is contained in:
phaer 2024-06-18 13:17:34 +02:00
parent 5f3051487a
commit c1d1502486
2 changed files with 9 additions and 3 deletions

View File

@ -6,3 +6,7 @@
[data-md-component="toc"] .md-nav__link {
display: inline-flex;
}
.md-typeset td pre {
margin: 0;
}

View File

@ -3,13 +3,15 @@
##{{loop.depth * "#"}} {{ ((option.loc | join (".")) or name).replace("<", "&lt;").replace(">", "&gt;") }}
{% if (option.description or '') != "This option has no description." -%}
{{ option.description or '' }}
{%- endif %}
{% if "type" in option %}
<table>
<tr>
<td>type</td>
<td><code>{{ option.type }}</code> {{ "(read only)" if option.readOnly else "" }}</td>
<td>{{ option.type}} {{ "(read only)" if option.readOnly else "" }}</td>
</tr>
<tr>
<td>source</td>
@ -18,14 +20,14 @@
{%- if option.default -%}
<tr>
<td>default</td>
<td><pre>{{(option.default | default({})).text | pygments("nix")}}</pre></td>
<td>{{(option.default | default({})).text | pygments("nix")}}</td>
</tr>
{%- endif -%}
{%- if option.example -%}
<tr>
<td>example</td>
<td>
<pre>{{(option.example | default({})).text | pygments("nix")}}</pre>
{{(option.example | default({})).text | pygments("nix")}}
</td>
</tr>
{%- endif -%}