1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

added module returnval documentation to web docs

This commit is contained in:
Brian Coca 2015-03-20 16:54:22 -04:00
parent 64b447f01b
commit c3076b8478
2 changed files with 50 additions and 8 deletions

View file

@ -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...

View file

@ -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 %}