mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
This commit is contained in:
parent
77e7ae6838
commit
c661f9f561
2 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue