From 0826106441d15820d086c1c9eaf6242aa80e4406 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 3 Jun 2015 22:19:26 -0400 Subject: [PATCH] minor docs reformat - clearer 'version added' for module options, now it sits under the option name - made notes a section, so it now appears in toc - moved requirements and made it a list, more prominent and more readable --- hacking/templates/rst.j2 | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/hacking/templates/rst.j2 b/hacking/templates/rst.j2 index f6f38e59101..a30e16e41f1 100644 --- a/hacking/templates/rst.j2 +++ b/hacking/templates/rst.j2 @@ -43,6 +43,17 @@ Synopsis @{ desc | convert_symbols_to_format }@ {% endfor %} + +{% if requirements %} +Requirements +------------ + +{% for req in requirements %} + * @{ req | convert_symbols_to_format }@ +{% endfor %} +{% endif %} + + {% if options -%} Options ------- @@ -60,7 +71,7 @@ Options {% for k in option_keys %} {% set v = options[k] %} - @{ k }@ + @{ k }@
{% if v['version_added'] %} (added in @{v['version_added']}@){% endif %}
{% if v.get('required', False) %}yes{% else %}no{% endif %} {% if v['default'] %}@{ v['default'] }@{% endif %} {% if v.get('type', 'not_bool') == 'bool' %} @@ -68,21 +79,16 @@ Options {% else %} {% endif %} - {% for desc in v.description -%}@{ desc | html_ify }@{% endfor -%}{% if v['version_added'] %} (added in Ansible @{v['version_added']}@){% endif %} + {% for desc in v.description -%}@{ desc | html_ify }@{% endfor -%} {% endfor %} + {% endif %} -{% if requirements %} -{% for req in requirements %} -.. note:: Requires @{ req | convert_symbols_to_format }@ -{% endfor %} -{% endif %} - -{% if examples or plainexamples %} +{% if examples or plainexamples -%} Examples -------- @@ -107,7 +113,7 @@ Examples {% endif %} -{% if returndocs %} +{% if returndocs -%} Return Values ------------- @@ -164,7 +170,10 @@ Common return values are documented here :doc:`common_return_values`, the follow

{% endif %} -{% if notes %} +{% if notes -%} +Notes +----- + {% for note in notes %} .. note:: @{ note | convert_symbols_to_format }@ {% endfor %}