diff options
-rw-r--r-- | docs/docsite/rst/dev_guide/developing_collections.rst | 23 | ||||
-rw-r--r-- | docs/docsite/rst/dev_guide/developing_modules_documenting.rst | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/docsite/rst/dev_guide/developing_collections.rst b/docs/docsite/rst/dev_guide/developing_collections.rst index 9088e7b587..35ae7aa980 100644 --- a/docs/docsite/rst/dev_guide/developing_collections.rst +++ b/docs/docsite/rst/dev_guide/developing_collections.rst @@ -212,6 +212,29 @@ Then you can populate the directories with the content you want inside the colle https://github.com/bcoca/collection to get a better idea of what you can place inside a collection. +.. _docfragments_collections: + +Using documentation fragments in collections +-------------------------------------------- + +To include documentation fragments in your collection: + +#. Create the documentation fragment: ``plugins/doc_fragments/fragment_name``. + +#. Refer to the documentation fragment with its FQCN. + +.. code-block:: yaml + + extends_documentation_fragment: + - community.kubernetes.k8s_name_options + - community.kubernetes.k8s_auth_options + - community.kubernetes.k8s_resource_options + - community.kubernetes.k8s_scale_options + +:ref:`module_docs_fragments` covers the basics for documentation fragments. The `kubernetes <https://github.com/ansible-collections/kubernetes>`_ collection includes a complete example. + +You can also share documentation fragments across collections with the FQCN. + .. _building_collections: Building collections diff --git a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst index 0421b4cd1c..134695f2b7 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst @@ -346,6 +346,7 @@ For example, all AWS modules should include: - aws - ec2 +:ref:`docfragments_collections` describes how to incorporate documentation fragments in a collection. .. _examples_block: |