added module returnval documentation to web docs

pull/10457/head
Brian Coca 9 years ago
parent 64b447f01b
commit c3076b8478

@ -289,7 +289,10 @@ def process_module(module, options, env, template, outputname, module_map, alias
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
doc['ansible_version'] = options.ansible_version
doc['plainexamples'] = examples #plain text
doc['returndocs'] = returndocs
if returndocs:
doc['returndocs'] = yaml.safe_load(returndocs)
else:
doc['returndocs'] = None
# here is where we build the table of contents...

@ -111,18 +111,57 @@ Examples
Return Values
-------------
Common return values are documented here ::doc::`common_return_values`, the following are the fields unique to this module:
Common return values are documented here :doc:`common_return_values`, the following are the fields unique to this module:
.. raw:: html
<p>
<pre>
@{ returndocs }@
</pre>
</p>
<table border=1 cellpadding=4>
<tr>
<th class="head">name</th>
<th class="head">despcription</th>
<th class="head">returned</th>
<th class="head">type</th>
<th class="head">sample</th>
</tr>
::
{% for entry in returndocs %}
<tr>
<td> @{ entry }@ </td>
<td> @{ returndocs[entry].description }@ </td>
<td align=center> @{ returndocs[entry].returned }@ </td>
<td align=center> @{ returndocs[entry].type }@ </td>
<td align=center> @{ returndocs[entry].sample}@ </td>
</tr>
{% if returndocs[entry].type == 'dictionary' %}
<tr><td>contains: </td>
<td colspan=4>
<table border=1 cellpadding=2>
<tr>
<th class="head">name</th>
<th class="head">despcription</th>
<th class="head">returned</th>
<th class="head">type</th>
<th class="head">sample</th>
</tr>
{% for sub in returndocs[entry].contains %}
<tr>
<td> @{ sub }@ </td>
<td> @{ returndocs[entry].contains[sub].description }@ </td>
<td align=center> @{ returndocs[entry].contains[sub].returned }@ </td>
<td align=center> @{ returndocs[entry].contains[sub].type }@ </td>
<td align=center> @{ returndocs[entry].contains[sub].sample}@ </td>
</tr>
{% endfor %}
</table>
</td></tr>
{% endif %}
{% endfor %}
</table>
</br></br>
{% endif %}
{% if notes %}

Loading…
Cancel
Save