diff --git a/hacking/templates/rst.j2 b/hacking/templates/rst.j2
index f6f38e5910..a30e16e41f 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 %}
{% for choice in v.get('choices',[]) -%}- @{ choice }@
{% endfor -%} |
{% 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 %}