From c3076b84788f78a075764e4d9e8fb28fef5db60c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 20 Mar 2015 16:54:22 -0400 Subject: [PATCH] added module returnval documentation to web docs --- hacking/module_formatter.py | 5 +++- hacking/templates/rst.j2 | 53 ++++++++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index 6d595c634d..c3aca94949 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -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... diff --git a/hacking/templates/rst.j2 b/hacking/templates/rst.j2 index 6d3c21f424..6873c3fea5 100644 --- a/hacking/templates/rst.j2 +++ b/hacking/templates/rst.j2 @@ -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 -

-

-    @{ returndocs }@
-    
-

+ + + + + + + + -:: + {% for entry in returndocs %} + + + + + + + + {% if returndocs[entry].type == 'dictionary' %} + + + + {% endif %} + {% endfor %} + +
namedespcriptionreturnedtypesample
@{ entry }@ @{ returndocs[entry].description }@ @{ returndocs[entry].returned }@ @{ returndocs[entry].type }@ @{ returndocs[entry].sample}@
contains: + + + + + + + + + {% for sub in returndocs[entry].contains %} + + + + + + + + {% endfor %} + +
namedespcriptionreturnedtypesample
@{ sub }@ @{ returndocs[entry].contains[sub].description }@ @{ returndocs[entry].contains[sub].returned }@ @{ returndocs[entry].contains[sub].type }@ @{ returndocs[entry].contains[sub].sample}@
+
+

{% endif %} {% if notes %}