Skip to content

Commit d608d53

Browse files
committed
rewrote resf
1 parent e604d72 commit d608d53

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/docsite/rst/dev_guide/plugins_documenting.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Every Ansible plugin must be written in Python, with modules being the main exce
2323
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.
2424

2525

26-
.. _shebang:
26+
.. _plugins_shebang_and_encoding:
2727

2828
Python shebang & UTF-8 coding
2929
===============================
@@ -33,7 +33,7 @@ So your first line will normally be the encoding::
3333

3434
# -*- coding: utf-8 -*-
3535

36-
.. _copyright:
36+
.. _plugins_copyright:
3737

3838
Copyright and license
3939
=====================
@@ -52,7 +52,7 @@ Additions to the module (for example, rewrites) are not permitted to add additio
5252
Any legal review will include the source control history, so an exhaustive copyright header is not necessary.
5353
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.
5454

55-
.. _documentation_block:
55+
.. _plugins_documentation_block:
5656

5757
DOCUMENTATION block
5858
===================
@@ -217,7 +217,7 @@ All fields in the ``DOCUMENTATION`` block are lower-case. All fields are require
217217

218218
* Details of any important information that doesn't fit in one of the above sections.
219219

220-
.. _module_documents_linking:
220+
.. _plugins_documents_linking:
221221

222222
Linking within plugin documentation
223223
-----------------------------------
@@ -284,7 +284,7 @@ Possible macros include the following:
284284

285285
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.
286286

287-
.. _plugin_docs_fragments:
287+
.. _plugins_docs_fragments:
288288

289289
Documentation fragments
290290
-----------------------
@@ -344,7 +344,7 @@ For example, all AWS modules should include:
344344

345345
:ref:`docfragments_collections` describes how to incorporate documentation fragments in a collection.
346346

347-
.. _examples_block:
347+
.. _plugins_examples_block:
348348

349349
EXAMPLES block
350350
==============
@@ -355,7 +355,7 @@ Use a fully qualified collection name (FQCN) as a part of the plugin's name. For
355355

356356
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.
357357

358-
.. _return_block:
358+
.. _plugins_return_block:
359359

360360
RETURN block
361361
============
@@ -401,7 +401,7 @@ Here are two example ``RETURN`` sections, one with three simple fields and one w
401401
type: bool
402402
'''
403403
404-
.. _python_imports:
404+
.. _plugins_python_imports:
405405

406406
Python imports
407407
==============

0 commit comments

Comments
 (0)