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

Loading…
Cancel
Save