You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docsite/rst/dev_guide/plugins_documenting.rst
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Every Ansible plugin must be written in Python, with modules being the main exce
23
23
Keen Python programmers may notice that contrary to PEP 8's advice we don't put ``imports`` at the top of the file. This is because the ``DOCUMENTATION`` through ``RETURN`` sections are essentially extra docstrings for the file. The imports are placed after these special variables for the same reason as PEP 8 puts the imports after the introductory comments and docstrings. This keeps the active parts of the code together and the pieces which are purely informational apart. The decision to exclude E402 is based on readability (which is what PEP 8 is about). Documentation strings in a plugin are much more similar to module level docstrings. Placing the imports below this documentation and closer to the code, consolidates and groups all related code in a congruent manner to improve readability, debugging and understanding.
24
24
25
25
26
-
.. _shebang:
26
+
.. _plugins_shebang_and_encoding:
27
27
28
28
Python shebang & UTF-8 coding
29
29
===============================
@@ -33,7 +33,7 @@ So your first line will normally be the encoding::
33
33
34
34
# -*- coding: utf-8 -*-
35
35
36
-
.. _copyright:
36
+
.. _plugins_copyright:
37
37
38
38
Copyright and license
39
39
=====================
@@ -52,7 +52,7 @@ Additions to the module (for example, rewrites) are not permitted to add additio
52
52
Any legal review will include the source control history, so an exhaustive copyright header is not necessary.
53
53
Please do not include a copyright year. If the existing copyright statement includes a year, do not edit the existing copyright year. Any existing copyright header should not be modified without permission from the copyright author.
54
54
55
-
.. _documentation_block:
55
+
.. _plugins_documentation_block:
56
56
57
57
DOCUMENTATION block
58
58
===================
@@ -217,7 +217,7 @@ All fields in the ``DOCUMENTATION`` block are lower-case. All fields are require
217
217
218
218
* Details of any important information that doesn't fit in one of the above sections.
219
219
220
-
.. _module_documents_linking:
220
+
.. _plugins_documents_linking:
221
221
222
222
Linking within plugin documentation
223
223
-----------------------------------
@@ -284,7 +284,7 @@ Possible macros include the following:
284
284
285
285
Note that ``C()``, ``B()``, and ``I()`` do **not allow escaping**, and thus cannot contain the value ``)`` as it always ends the formatting sequence. If you need to use ``)`` inside ``C()``, we recommend to use ``V()`` instead; see the above section on semantic markup.
286
286
287
-
.. _plugin_docs_fragments:
287
+
.. _plugins_docs_fragments:
288
288
289
289
Documentation fragments
290
290
-----------------------
@@ -344,7 +344,7 @@ For example, all AWS modules should include:
344
344
345
345
:ref:`docfragments_collections` describes how to incorporate documentation fragments in a collection.
346
346
347
-
.. _examples_block:
347
+
.. _plugins_examples_block:
348
348
349
349
EXAMPLES block
350
350
==============
@@ -355,7 +355,7 @@ Use a fully qualified collection name (FQCN) as a part of the plugin's name. For
355
355
356
356
If your examples use boolean options, favor yes/no values, this is not always possible as some plugins will force using Python or Jinja2 specific booleans.
357
357
358
-
.. _return_block:
358
+
.. _plugins_return_block:
359
359
360
360
RETURN block
361
361
============
@@ -401,7 +401,7 @@ Here are two example ``RETURN`` sections, one with three simple fields and one w
0 commit comments