added module returnval documentation to web docs

pull/10457/head
Brian Coca 10 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['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
doc['ansible_version'] = options.ansible_version doc['ansible_version'] = options.ansible_version
doc['plainexamples'] = examples #plain text 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... # here is where we build the table of contents...

@ -111,18 +111,57 @@ Examples
Return Values 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 .. raw:: html
<p> <table border=1 cellpadding=4>
<pre> <tr>
@{ returndocs }@ <th class="head">name</th>
</pre> <th class="head">despcription</th>
</p> <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 %} {% endif %}
{% if notes %} {% if notes %}

Loading…
Cancel
Save