Improve module doc parameter list (#36688)

This PR includes:
- Indentation of Jinja constructs
- Put parameter name in bold
- Title-case table headers
- Show 'required' when parameter is required (not yes/no)
- Left-align all values
pull/36720/head
Dag Wieers 6 years ago committed by GitHub
parent 07e8fb5dbb
commit 4ff0317f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,10 +7,9 @@
{% else %}
{% set title = module %}
{% endif %}
{% set title_len = title|length %}
@{ title }@
@{ '+' * title_len }@
@{ '+' * title|length }@
{% if version_added is defined and version_added != '' -%}
.. versionadded:: @{ version_added | default('') }@
@ -91,14 +90,14 @@ Options
<table border=0 cellpadding=0 class="documentation-table">
{# Header of the documentation #}
<tr>
<th class="head"><div class="cell-border">parameter</div></th>
<th class="head"><div class="cell-border">required</div></th>
<th class="head"><div class="cell-border">default</div></th>
<th class="head"><div class="cell-border">choices</div></th>
<th class="head"><div class="cell-border">Parameter</div></th>
<th class="head"><div class="cell-border">Required?</div></th>
<th class="head"><div class="cell-border">Default</div></th>
<th class="head"><div class="cell-border">Choices</div></th>
{% if plugin_type != 'module' %}
<th class="head"><div class="cell-border">configuration</div></th>
<th class="head"><div class="cell-border">Configuration</div></th>
{% endif %}
<th class="head"><div class="cell-border">comments</div></th>
<th class="head"><div class="cell-border">Comments</div></th>
</tr>
{% for key, value in options|dictsort recursive %}
<tr class="return-value-column">
@ -110,14 +109,14 @@ Options
</div>
{% endfor %}
<div class="elbow-key">
@{ key }@<br/><div style="font-size: small;">{% if value.version_added %} (added in @{value.version_added}@){% endif %}</div>
<b>@{ key }@</b><br/><div style="font-size: small;">{% if value.version_added %} (added in @{value.version_added}@){% endif %}</div>
</div>
<div class="outer-elbow-container">
</td>
{# required #}
<td><div class="cell-border">{% if value.get('required', False) %}required{% else %}optional{% endif %}</div></td>
<td><div class="cell-border">{% if value.get('required', False) %}required{% endif %}</div></td>
{# default value #}
<td><div class="cell-border">{% if value.default %}@{ value.default }@{% endif %}</div></td>
<td><div class="cell-border">{% if value.default %}@{ value.default | html_ify }@{% endif %}</div></td>
{# choices #}
<td>
<div class="cell-border">
@ -217,11 +216,11 @@ Common return values are documented :ref:`here <common_return_values>`, the foll
<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th class="head"><div class="cell-border">name</div></th>
<th class="head"><div class="cell-border">description</div></th>
<th class="head"><div class="cell-border">returned</div></th>
<th class="head"><div class="cell-border">type</div></th>
<th class="head"><div class="cell-border">sample</div></th>
<th class="head"><div class="cell-border">Name</div></th>
<th class="head"><div class="cell-border">Description</div></th>
<th class="head"><div class="cell-border">Returned</div></th>
<th class="head"><div class="cell-border">Type</div></th>
<th class="head"><div class="cell-border">Sample</div></th>
</tr>
{% for key, value in returndocs|dictsort recursive %}
<tr class="return-value-column">
@ -232,7 +231,7 @@ Common return values are documented :ref:`here <common_return_values>`, the foll
</div>
{% endfor %}
<div class="elbow-key">
@{ key }@
<b>@{ key }@</b>
</div>
</div>
</td>
@ -245,9 +244,9 @@ Common return values are documented :ref:`here <common_return_values>`, the foll
{% endfor %}
{% endif %}
</td>
<td align=center><div class="cell-border">@{ value.returned }@</div></td>
<td align=center><div class="cell-border">@{ value.type }@</div></td>
<td align=center><div class="cell-border">@{ value.sample | replace('\n', '\n ') | html_ify }@</div></td>
<td><div class="cell-border">@{ value.returned }@</div></td>
<td><div class="cell-border">@{ value.type }@</div></td>
<td><div class="cell-border">@{ value.sample | replace('\n', '\n ') | html_ify }@</div></td>
</tr>
{# ---------------------------------------------------------
# sadly we cannot blindly iterate through the child dicts,

Loading…
Cancel
Save