From c661f9f561437edfbc6f8293aa3e29ac38572808 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Wed, 12 Oct 2016 16:07:53 +1000 Subject: [PATCH] Module examples should be in YAML format Given that Ansible best practices say to use YAML format, our documentation should not make the excuse that it's too hard, but rather represent examples in YAML format. This will allow those using the examples to instantly see best practices --- docsite/rst/dev_guide/developing_modules.rst | 10 +++++----- docsite/rst/developing_modules.rst | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docsite/rst/dev_guide/developing_modules.rst b/docsite/rst/dev_guide/developing_modules.rst index 3575f16023..feed460c07 100644 --- a/docsite/rst/dev_guide/developing_modules.rst +++ b/docsite/rst/dev_guide/developing_modules.rst @@ -426,13 +426,13 @@ for URL, module, italic, and constant-width respectively. It is suggested to use ``C()`` for file and option names, and ``I()`` when referencing parameters; module names should be specified as ``M(module)``. -Examples (which typically contain colons, quotes, etc.) are difficult -to format with YAML, so these must be -written in plain text in an ``EXAMPLES`` string within the module -like this:: +Examples should be written in YAML format in plain text in an +``EXAMPLES`` string within the module like this:: EXAMPLES = ''' - - action: modulename opt1=arg1 opt2=arg2 + - modulename: + opt1: arg1 + opt2: arg2 ''' The EXAMPLES section, just like the documentation section, is required in diff --git a/docsite/rst/developing_modules.rst b/docsite/rst/developing_modules.rst index 94f114cbd2..5f6a21f318 100644 --- a/docsite/rst/developing_modules.rst +++ b/docsite/rst/developing_modules.rst @@ -432,13 +432,13 @@ for URL, module, italic, and constant-width respectively. It is suggested to use ``C()`` for file and option names, and ``I()`` when referencing parameters; module names should be specified as ``M(module)``. -Examples (which typically contain colons, quotes, etc.) are difficult -to format with YAML, so these must be -written in plain text in an ``EXAMPLES`` string within the module -like this:: +Examples should be written in YAML format in plain text in an +``EXAMPLES`` string within the module like this:: EXAMPLES = ''' - - action: modulename opt1=arg1 opt2=arg2 + - modulename: + opt1: arg1 + opt2: arg2 ''' The EXAMPLES section, just like the documentation section, is required in