From f16933492dc96d10929dfe2158588f66b862f4e2 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 15 May 2018 16:19:04 +0200 Subject: [PATCH] Fix problems in documentation generation (#40050) * Treat C(...) as inline literal (as opposed to interpreted text). * Making test for true and false more precise, to avoid matching 1, 1.0, etc. * The 'is sameas' test already takes care of definedness. --- docs/bin/plugin_formatter.py | 2 +- docs/templates/plugin.rst.j2 | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/bin/plugin_formatter.py b/docs/bin/plugin_formatter.py index b1e558d0e27..e181eac409d 100755 --- a/docs/bin/plugin_formatter.py +++ b/docs/bin/plugin_formatter.py @@ -94,7 +94,7 @@ def rst_ify(text): t = _MODULE.sub(r":ref:`\1 <\1_module>`", t) t = _LINK.sub(r"`\1 <\2>`_", t) t = _URL.sub(r"\1", t) - t = _CONST.sub(r"`\1`", t) + t = _CONST.sub(r"``\1``", t) t = _RULER.sub(r"------------", t) except Exception as e: raise AnsibleError("Could not process (%s) : %s" % (text, e)) diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2 index ac8926c3a62..421e681c571 100644 --- a/docs/templates/plugin.rst.j2 +++ b/docs/templates/plugin.rst.j2 @@ -116,12 +116,10 @@ Parameters
{# Turn boolean values in 'yes' and 'no' values #} - {% if value.default is defined %} - {% if value.default == true %} - {% set _x = value.update({'default': 'yes'}) %} - {% elif value.default == false %} - {% set _x = value.update({'default': 'no'}) %} - {% endif %} + {% if value.default is sameas true %} + {% set _x = value.update({'default': 'yes'}) %} + {% elif value.default is sameas false %} + {% set _x = value.update({'default': 'no'}) %} {% endif %} {% if value.type == 'bool' %} {% set _x = value.update({'choices': ['no', 'yes']}) %} @@ -131,9 +129,9 @@ Parameters