add info on creating doc fragments in a collection (#67171)

* add info on creating doc fragments in a collection
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
pull/67280/head
Sandra McCann 4 years ago committed by GitHub
parent fa8c07a33c
commit 4dd2513371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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:

Loading…
Cancel
Save