How to use rst :ref: for modules in collections (#70567)

pull/70962/head
Sandra McCann 4 years ago committed by GitHub
parent 3a8ac62596
commit 748ba96610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -171,13 +171,33 @@ The second example adds custom text for the link.
Adding links to modules and plugins Adding links to modules and plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* Module links use the module name followed by ``_module`` for the anchor. Ansible 2.10 and later require the extended Fully Qualified Collection Name (FQCN) as part of the links:
* Plugin links use the plugin name followed by the plugin type. For example, :ref:`enable become plugin <enable_become>`).
.. code-block:: text
ansible_collections. + FQCN + _module
For example:
.. code-block:: rst
:ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`
displays as :ref:`ansible.builtin.first_found lookup plugin <ansible_collections.ansible.builtin.first_found_lookup>`.
Modules require different suffixes from other plugins:
* Module links use this extended FQCN module name with ``_module`` for the anchor.
* Plugin links use this extended FQCN plugin name with the plugin type (``_connection`` for example).
.. code-block:: rst .. code-block:: rst
:ref:`this module <this_module>`` :ref:`arista.eos.eos_config <ansible_collections.arista.eos.eos_config_module>`
:ref:`that connection plugin <that_connection>` :ref:`community.kubernetes.kubectl connection plugin <ansible_collections.community.kubernetes.kubectl_connection>`
.. note::
``ansible.builtin`` is the FQCN for modules included in ``ansible.base``. Documentation links are the only place you prepend ``ansible_collections`` to the FQCN. This is used by the documentation build scripts to correctly fetch documentation from collections on Ansible Galaxy.
.. _local_toc: .. _local_toc:

Loading…
Cancel
Save