diff --git a/changelogs/fragments/269-refs.yml b/changelogs/fragments/269-refs.yml
new file mode 100644
index 00000000..0053fa38
--- /dev/null
+++ b/changelogs/fragments/269-refs.yml
@@ -0,0 +1,3 @@
+bugfixes:
+ - "Fix internal links to options and return values in simplified RST output (https://github.com/ansible-community/antsibull-docs/pull/269)."
+ - "Include role in role attribute references (https://github.com/ansible-community/antsibull-docs/pull/269)."
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/macros/attributes.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/macros/attributes.rst.j2
index 75adf483..1b7b8254 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/macros/attributes.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/macros/attributes.rst.j2
@@ -6,7 +6,7 @@
{% from 'macros/version_added.rst.j2' import version_added_rst %}
-{% macro in_rst(attributes, role_entrypoint=None) %}
+{% macro in_rst(attributes, attribute_html_prefix='', role_entrypoint=None) %}
.. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10}
.. list-table::
@@ -24,9 +24,9 @@
* - .. raw:: html
-
+
- .. _ansible_collections.@{plugin_name}@_@{plugin_type}@__attribute-@{ attribute }@:
+ .. _@{ rst_attribute_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, attribute=attribute) }@:
.. rst-class:: ansible-option-title
@@ -34,7 +34,7 @@
.. raw:: html
-
+
.. raw:: html
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/macros/parameters.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/macros/parameters.rst.j2
index 1f01edb4..f1d93058 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/macros/parameters.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/macros/parameters.rst.j2
@@ -10,7 +10,7 @@
{% from 'macros/deprecates.rst.j2' import in_html as deprecates_html with context %}
{% from 'macros/version_added.rst.j2' import version_added_rst, version_added_html %}
-{% macro in_rst(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
+{% macro in_rst(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
.. tabularcolumns:: \X{1}{3}\X{2}{3}
.. list-table::
@@ -38,7 +38,7 @@
{% endif %}
{% for full_key in value['full_keys_rst'] %}
- .. _ansible_collections.@{plugin_name}@_@{plugin_type}@__parameter-@{ parameter_rst_prefix }@{% for part in full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}:
+ .. _@{ rst_option_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, option=full_key) }@:
{% endfor %}
.. rst-class:: ansible-option-title
@@ -180,7 +180,7 @@
{##################################################################################################################}
-{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
+{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
.. raw:: html
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/macros/returnvalues.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/macros/returnvalues.rst.j2
index dbf5ba9f..c94a34ff 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/macros/returnvalues.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/macros/returnvalues.rst.j2
@@ -36,7 +36,7 @@
{% endif %}
{% for full_key in value['full_keys_rst'] %}
- .. _ansible_collections.@{plugin_name}@_@{plugin_type}@__return-{% for part in full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}:
+ .. _@{ rst_return_value_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, return_value=full_key) }@:
{% endfor %}
.. rst-class:: ansible-option-title
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-error.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-error.rst.j2
index 37576fcf..bcd7e511 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-error.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-error.rst.j2
@@ -18,7 +18,7 @@
.. Anchors
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@:
+.. _@{ rst_plugin_ref(plugin_name, plugin_type) }@:
.. Title
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-redirect.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-redirect.rst.j2
index dab4af4d..23322986 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-redirect.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-redirect.rst.j2
@@ -13,7 +13,7 @@
.. Anchors
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@:
+.. _@{ rst_plugin_ref(plugin_name, plugin_type) }@:
.. Title
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-tombstone.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-tombstone.rst.j2
index 517c68d5..9a3192ab 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/plugin-tombstone.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/plugin-tombstone.rst.j2
@@ -13,7 +13,7 @@
.. Anchors
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@:
+.. _@{ rst_plugin_ref(plugin_name, plugin_type) }@:
.. Title
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/plugin.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/plugin.rst.j2
index f6f068c2..086618c4 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/plugin.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/plugin.rst.j2
@@ -30,7 +30,7 @@
.. Anchors
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@:
+.. _@{ rst_plugin_ref(plugin_name, plugin_type) }@:
.. Anchors: short name for ansible.builtin
@@ -76,7 +76,7 @@
To install it, use: @{ collection | collection_install | rst_code }@.
{% if doc['requirements'] %}
You need further requirements to be able to use this {% if plugin_type == 'module' %}module{% else %}@{ plugin_type }@ plugin{% endif %},
- see :ref:`Requirements ` for details.
+ see :ref:`Requirements <@{ rst_requirements_ref(plugin_name, plugin_type) }@>` for details.
{% endif %}
To use it in a playbook, specify: :code:`@{plugin_name}@`.
@@ -150,7 +150,7 @@ Aliases: @{ ', '.join(doc['aliases'] | sort) }@
.. Requirements
{% if doc['requirements'] -%}
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@_requirements:
+.. _@{ rst_requirements_ref(plugin_name, plugin_type) }@:
Requirements
------------
diff --git a/src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2 b/src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2
index 9188c3f7..6761b028 100644
--- a/src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2
+++ b/src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2
@@ -25,7 +25,7 @@
.. Anchors
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@:
+.. _@{ rst_plugin_ref(plugin_name, plugin_type) }@:
.. Title
@@ -130,9 +130,9 @@ Parameters
^^^^^^^^^^
{% if use_html_blobs %}
-@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
+@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
{% else %}
-@{ parameters_rst(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
+@{ parameters_rst(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
{% endif %}
{% endif %}
@@ -143,7 +143,7 @@ Parameters
Attributes
----------
-@{ attributes_rst(ep_doc['attributes'], role_entrypoint=entry_point) }@
+@{ attributes_rst(ep_doc['attributes'], attribute_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
{% endif %}
.. Notes
diff --git a/src/antsibull_docs/data/docsite/simplified-rst/macros/attributes.rst.j2 b/src/antsibull_docs/data/docsite/simplified-rst/macros/attributes.rst.j2
index 596729fe..1565ac6e 100644
--- a/src/antsibull_docs/data/docsite/simplified-rst/macros/attributes.rst.j2
+++ b/src/antsibull_docs/data/docsite/simplified-rst/macros/attributes.rst.j2
@@ -17,7 +17,7 @@
{% for attribute, data in attributes | dictsort %}
{# attribute name #}
- * - .. _ansible_collections.@{plugin_name}@_@{plugin_type}@__attribute-@{ attribute }@:
+ * - .. _@{ rst_attribute_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, attribute=attribute) }@:
**@{ attribute }@**
diff --git a/src/antsibull_docs/data/docsite/simplified-rst/macros/parameters.rst.j2 b/src/antsibull_docs/data/docsite/simplified-rst/macros/parameters.rst.j2
index 5994bc5a..e830bab6 100644
--- a/src/antsibull_docs/data/docsite/simplified-rst/macros/parameters.rst.j2
+++ b/src/antsibull_docs/data/docsite/simplified-rst/macros/parameters.rst.j2
@@ -8,7 +8,7 @@
{% from 'macros/deprecates.rst.j2' import in_html as deprecates_html with context %}
{% from 'macros/version_added.rst.j2' import version_added_html %}
-{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
+{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
.. raw:: html
diff --git a/src/antsibull_docs/data/docsite/simplified-rst/plugin.rst.j2 b/src/antsibull_docs/data/docsite/simplified-rst/plugin.rst.j2
index a404fb92..d600203c 100644
--- a/src/antsibull_docs/data/docsite/simplified-rst/plugin.rst.j2
+++ b/src/antsibull_docs/data/docsite/simplified-rst/plugin.rst.j2
@@ -48,7 +48,7 @@ To check whether it is installed, run ``ansible-galaxy collection list``.
To install it, use: @{ collection | collection_install | rst_code }@.
{% if doc['requirements'] %}
You need further requirements to be able to use this {% if plugin_type == 'module' %}module{% else %}@{ plugin_type }@ plugin{% endif %},
-see `Requirements `_ for details.
+see `Requirements <@{ rst_requirements_ref(plugin_name, plugin_type) }@_>`_ for details.
{% endif %}
To use it in a playbook, specify: ``@{plugin_name}@``.
@@ -108,7 +108,7 @@ Aliases: @{ ', '.join(doc['aliases'] | sort) }@
{% endif %}
{% if doc['requirements'] -%}
-.. _ansible_collections.@{plugin_name}@_@{plugin_type}@_requirements:
+.. _@{ rst_requirements_ref(plugin_name, plugin_type) }@:
Requirements
------------
diff --git a/src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2 b/src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2
index 5fcd836b..8f83fc36 100644
--- a/src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2
+++ b/src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2
@@ -93,7 +93,7 @@ The below requirements are needed on the remote host and/or the local controller
Parameters
^^^^^^^^^^
-@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
+@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
{% endif %}
{% if ep_doc['attributes'] %}
diff --git a/src/antsibull_docs/jinja2/environment.py b/src/antsibull_docs/jinja2/environment.py
index c01f2c51..eb007a3b 100644
--- a/src/antsibull_docs/jinja2/environment.py
+++ b/src/antsibull_docs/jinja2/environment.py
@@ -13,6 +13,13 @@
from jinja2 import BaseLoader, Environment, FileSystemLoader, PackageLoader
from ..markup.rstify import rst_code, rst_escape
+from ..rst_labels import (
+ get_attribute_ref,
+ get_option_ref,
+ get_plugin_ref,
+ get_requirements_ref,
+ get_return_value_ref,
+)
from ..utils.collection_name_transformer import CollectionNameTransformer
from . import FilenameGenerator, OutputFormat
from .filters import (
@@ -38,7 +45,7 @@
def reference_plugin_rst(plugin_name: str, plugin_type: str) -> str:
fqcn = f"{plugin_name}"
- return f"\\ :ref:`{rst_escape(fqcn)} `\\ "
+ return f"\\ :ref:`{rst_escape(fqcn)} <{get_plugin_ref(fqcn, plugin_type)}>`\\ "
def reference_plugin_rst_simplified(plugin_name: str, plugin_type: str) -> str:
@@ -139,6 +146,11 @@ def doc_environment(
env.globals["reference_plugin_rst"] = make_reference_plugin_rst(output_format)
env.globals["referable_envvars"] = referable_envvars
+ env.globals["rst_plugin_ref"] = get_plugin_ref
+ env.globals["rst_requirements_ref"] = get_requirements_ref
+ env.globals["rst_attribute_ref"] = get_attribute_ref
+ env.globals["rst_option_ref"] = get_option_ref
+ env.globals["rst_return_value_ref"] = get_return_value_ref
env.filters["rst_ify"] = make_rst_ify(output_format)
env.filters["html_ify"] = html_ify
env.filters["fmt"] = rst_fmt
diff --git a/src/antsibull_docs/markup/rstify.py b/src/antsibull_docs/markup/rstify.py
index 5f29077f..deceb429 100644
--- a/src/antsibull_docs/markup/rstify.py
+++ b/src/antsibull_docs/markup/rstify.py
@@ -69,7 +69,7 @@ def plugin_option_like_link(
) -> t.Optional[str]:
if current_plugin:
ref = massage_rst_label("/".join(name))
- ep = f"{entrypoint}__" if entrypoint is not None else ""
+ ep = f"{entrypoint}--" if entrypoint is not None else ""
prefix = "return" if what == "retval" else "parameter"
return f"{prefix}-{ep}{ref}_"
return self.plugin_link(plugin)
@@ -83,7 +83,7 @@ def _custom_format_option_like(
) -> str:
plugin = part.plugin
if url and url.endswith("_"):
- plugin_text = f" (`link <{url}>`_)"
+ plugin_text = f" (`link <#{url[:-1]}>`_)"
elif plugin:
plugin_result = [plugin.type]
if plugin.type not in ("module", "role", "playbook"):
diff --git a/src/antsibull_docs/rst_labels.py b/src/antsibull_docs/rst_labels.py
new file mode 100644
index 00000000..6a703e7e
--- /dev/null
+++ b/src/antsibull_docs/rst_labels.py
@@ -0,0 +1,74 @@
+# Author: Felix Fontein
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or
+# https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: 2023, Ansible Project
+"""
+Label helpers.
+"""
+
+from __future__ import annotations
+
+from antsibull_docs.utils.rst import massage_rst_label
+
+
+def get_plugin_ref(plugin_fqcn: str, plugin_type: str) -> str:
+ return f"ansible_collections.{plugin_fqcn}_{plugin_type}"
+
+
+def get_attribute_ref(
+ plugin_fqcn: str,
+ plugin_type: str,
+ role_entrypoint: str | None,
+ attribute: str,
+) -> str:
+ ref = massage_rst_label(attribute)
+ ep = (
+ f"{role_entrypoint}__"
+ if role_entrypoint is not None and plugin_type == "role"
+ else ""
+ )
+ return f"{get_plugin_ref(plugin_fqcn, plugin_type)}__attribute-{ep}{ref}"
+
+
+def get_option_ref(
+ plugin_fqcn: str,
+ plugin_type: str,
+ role_entrypoint: str | None,
+ option: list[str],
+) -> str:
+ ref = "/".join(massage_rst_label(part) for part in option)
+ ep = (
+ f"{role_entrypoint}__"
+ if role_entrypoint is not None and plugin_type == "role"
+ else ""
+ )
+ return f"{get_plugin_ref(plugin_fqcn, plugin_type)}__parameter-{ep}{ref}"
+
+
+def get_return_value_ref(
+ plugin_fqcn: str,
+ plugin_type: str,
+ role_entrypoint: str | None,
+ return_value: list[str],
+) -> str:
+ ref = "/".join(massage_rst_label(part) for part in return_value)
+ ep = (
+ f"{role_entrypoint}__"
+ if role_entrypoint is not None and plugin_type == "role"
+ else ""
+ )
+ return f"{get_plugin_ref(plugin_fqcn, plugin_type)}__return-{ep}{ref}"
+
+
+def get_requirements_ref(
+ plugin_fqcn: str,
+ plugin_type: str,
+ role_entrypoint: str | None = None,
+) -> str:
+ ep = (
+ f"-{role_entrypoint}"
+ if role_entrypoint is not None and plugin_type == "role"
+ else ""
+ )
+ return f"{get_plugin_ref(plugin_fqcn, plugin_type)}_requirements{ep}"
diff --git a/src/sphinx_antsibull_ext/roles.py b/src/sphinx_antsibull_ext/roles.py
index 755dcce6..292db6e1 100644
--- a/src/sphinx_antsibull_ext/roles.py
+++ b/src/sphinx_antsibull_ext/roles.py
@@ -21,17 +21,17 @@
parse_plugin_name,
parse_return_value,
)
-from antsibull_docs.utils.rst import massage_rst_label
+from antsibull_docs.rst_labels import (
+ get_option_ref,
+ get_plugin_ref,
+ get_return_value_ref,
+)
from .sphinx_helper import extract_explicit_title
logger = logging.getLogger(__name__)
-def _plugin_ref(plugin_fqcn: str, plugin_type: str) -> str:
- return f"ansible_collections.{plugin_fqcn}_{plugin_type}"
-
-
def _create_option_reference(
plugin_fqcn: str | None,
plugin_type: str | None,
@@ -40,9 +40,7 @@ def _create_option_reference(
) -> str | None:
if not plugin_fqcn or not plugin_type:
return None
- ref = massage_rst_label(option.replace(".", "/"))
- ep = f"{entrypoint}__" if entrypoint is not None else ""
- return f"{_plugin_ref(plugin_fqcn, plugin_type)}__parameter-{ep}{ref}"
+ return get_option_ref(plugin_fqcn, plugin_type, entrypoint, option.split("."))
def _create_return_value_reference(
@@ -53,9 +51,9 @@ def _create_return_value_reference(
) -> str | None:
if not plugin_fqcn or not plugin_type:
return None
- ref = massage_rst_label(return_value.replace(".", "/"))
- ep = f"{entrypoint}__" if entrypoint is not None else ""
- return f"{_plugin_ref(plugin_fqcn, plugin_type)}__return-{ep}{ref}"
+ return get_return_value_ref(
+ plugin_fqcn, plugin_type, entrypoint, return_value.split(".")
+ )
def _create_ref_or_not(
@@ -277,7 +275,7 @@ def plugin_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
refnode = addnodes.pending_xref(
plugin_fqcn, nodes.inline(rawtext, title), **options
)
- refnode["reftarget"] = _plugin_ref(plugin_fqcn, plugin_type)
+ refnode["reftarget"] = get_plugin_ref(plugin_fqcn, plugin_type)
return [refnode], []
diff --git a/tests/functional/baseline-default/collections/ns2/col/foo_role.rst b/tests/functional/baseline-default/collections/ns2/col/foo_role.rst
index 5d7e3901..dd66290c 100644
--- a/tests/functional/baseline-default/collections/ns2/col/foo_role.rst
+++ b/tests/functional/baseline-default/collections/ns2/col/foo_role.rst
@@ -192,7 +192,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
.. rst-class:: ansible-option-title
@@ -234,7 +234,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
.. rst-class:: ansible-option-title
diff --git a/tests/functional/baseline-no-breadcrumbs/collections/ns2/col/foo_role.rst b/tests/functional/baseline-no-breadcrumbs/collections/ns2/col/foo_role.rst
index 5d7e3901..dd66290c 100644
--- a/tests/functional/baseline-no-breadcrumbs/collections/ns2/col/foo_role.rst
+++ b/tests/functional/baseline-no-breadcrumbs/collections/ns2/col/foo_role.rst
@@ -192,7 +192,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
.. rst-class:: ansible-option-title
@@ -234,7 +234,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
.. rst-class:: ansible-option-title
diff --git a/tests/functional/baseline-no-indexes/collections/ns2/col/foo_role.rst b/tests/functional/baseline-no-indexes/collections/ns2/col/foo_role.rst
index 5d7e3901..dd66290c 100644
--- a/tests/functional/baseline-no-indexes/collections/ns2/col/foo_role.rst
+++ b/tests/functional/baseline-no-indexes/collections/ns2/col/foo_role.rst
@@ -192,7 +192,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
.. rst-class:: ansible-option-title
@@ -234,7 +234,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
.. rst-class:: ansible-option-title
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_become.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_become.rst
index 3ec2c2fb..17def721 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_become.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_become.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo become -- Use foo \ :literal:`bar` (`link `_)\
+ns2.col.foo become -- Use foo \ :literal:`bar` (`link <#parameter-bar>`_)\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This become plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_cache.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_cache.rst
index b84d6271..8f368d98 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_cache.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_cache.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo cache -- Foo files \ :literal:`bar` (`link `_)\
+ns2.col.foo cache -- Foo files \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This cache plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_callback.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_callback.rst
index 020c9fe7..ce705a4d 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_callback.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_callback.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo callback -- Foo output \ :literal:`bar` (`link `_)\
+ns2.col.foo callback -- Foo output \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This callback plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_connection.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_connection.rst
index 184b8957..565feede 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_connection.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_connection.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link `_)\
+ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This connection plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_filter.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_filter.rst
index 5d656079..f104e0fc 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_filter.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_filter.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link `_)\
+ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This filter plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_inventory.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_inventory.rst
index 9157d3c6..81e828fa 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_inventory.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_inventory.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link `_)\
+ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This inventory plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_lookup.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_lookup.rst
index 89052014..45dc0d82 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_lookup.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_lookup.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link `_)\
+ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This lookup plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_module.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_module.rst
index 6cc64cd2..353aad99 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_module.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_module.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo module -- Do some foo \ :literal:`bar` (`link `_)\
+ns2.col.foo module -- Do some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This module is part of the `ns2.col collection `_ (version 2.1.0).
@@ -199,7 +199,7 @@ See Also
Another foo.
* \ `ns2.col.foo `__\ lookup plugin
- Look up some foo \ :literal:`bar` (`link `_)\ .
+ Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\ .
* \ `ansible.builtin.service `__\
The service module.
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_role.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_role.rst
index 36dafbf8..a509eeb9 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_role.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_role.rst
@@ -39,7 +39,7 @@ Synopsis
^^^^^^^^
- This is the foo role.
-- If you set \ :literal:`foo\_param\_1` (`link `_)\ while \ :literal:`foo\_param\_2=3` (`link `_)\ , this might behave funny.
+- If you set \ :literal:`foo\_param\_1` (`link <#parameter-main--foo_param_1>`_)\ while \ :literal:`foo\_param\_2=3` (`link <#parameter-main--foo_param_2>`_)\ , this might behave funny.
Parameters
@@ -102,7 +102,7 @@ Attributes
- Support
- Description
- * - .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ * - .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
**check_mode**
@@ -115,7 +115,7 @@ Attributes
- * - .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ * - .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
**platform**
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_shell.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_shell.rst
index e59f59e9..6990cc5b 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_shell.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_shell.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo shell -- Foo shell \ :literal:`bar` (`link `_)\
+ns2.col.foo shell -- Foo shell \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This shell plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_test.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_test.rst
index 4946b1bd..3034dc89 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_test.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_test.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo test -- Is something a foo \ :literal:`bar` (`link `_)\
+ns2.col.foo test -- Is something a foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This test plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_vars.rst b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_vars.rst
index d6041115..8ceb2ed9 100644
--- a/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_vars.rst
+++ b/tests/functional/baseline-simplified-rst-squash-hierarchy/foo_vars.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo vars -- Load foo \ :literal:`bar` (`link `_)\
+ns2.col.foo vars -- Load foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This vars plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns/col2/foo2_module.rst b/tests/functional/baseline-simplified-rst/collections/ns/col2/foo2_module.rst
index fb20fac0..5566b4d9 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns/col2/foo2_module.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns/col2/foo2_module.rst
@@ -26,8 +26,8 @@ Synopsis
- Does some foo on the remote host.
- A broken reference \ :ref:`asdfasdfoobarTHISDOESNOTEXIST `\ .
-- The option \ :literal:`foo` (`link `_)\ exists, but \ :literal:`foobar` (`link `_)\ does not.
-- The return value \ :literal:`bar` (`link `_)\ exists, but \ :literal:`barbaz` (`link `_)\ does not.
+- The option \ :literal:`foo` (`link <#parameter-foo>`_)\ exists, but \ :literal:`foobar` (`link <#parameter-foobar>`_)\ does not.
+- The return value \ :literal:`bar` (`link <#return-bar>`_)\ exists, but \ :literal:`barbaz` (`link <#return-barbaz>`_)\ does not.
- Again existing: \ :literal:`foo=1` (of module `ns.col2.foo `__)\ , \ :literal:`bar=2` (of module `ns.col2.foo `__)\
- Again not existing: \ :literal:`foobar=1` (of module `ns.col2.foo `__)\ , \ :literal:`barbaz=2` (of module `ns.col2.foo `__)\
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_become.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_become.rst
index 3ec2c2fb..17def721 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_become.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_become.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo become -- Use foo \ :literal:`bar` (`link `_)\
+ns2.col.foo become -- Use foo \ :literal:`bar` (`link <#parameter-bar>`_)\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This become plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_cache.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_cache.rst
index b84d6271..8f368d98 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_cache.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_cache.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo cache -- Foo files \ :literal:`bar` (`link `_)\
+ns2.col.foo cache -- Foo files \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This cache plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_callback.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_callback.rst
index 020c9fe7..ce705a4d 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_callback.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_callback.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo callback -- Foo output \ :literal:`bar` (`link `_)\
+ns2.col.foo callback -- Foo output \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This callback plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_connection.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_connection.rst
index 184b8957..565feede 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_connection.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_connection.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link `_)\
+ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This connection plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_filter.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_filter.rst
index 5d656079..f104e0fc 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_filter.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_filter.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link `_)\
+ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This filter plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_inventory.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_inventory.rst
index 9157d3c6..81e828fa 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_inventory.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_inventory.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link `_)\
+ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This inventory plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_lookup.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_lookup.rst
index 89052014..45dc0d82 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_lookup.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_lookup.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link `_)\
+ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This lookup plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_module.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_module.rst
index 6cc64cd2..353aad99 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_module.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_module.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo module -- Do some foo \ :literal:`bar` (`link `_)\
+ns2.col.foo module -- Do some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This module is part of the `ns2.col collection `_ (version 2.1.0).
@@ -199,7 +199,7 @@ See Also
Another foo.
* \ `ns2.col.foo `__\ lookup plugin
- Look up some foo \ :literal:`bar` (`link `_)\ .
+ Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\ .
* \ `ansible.builtin.service `__\
The service module.
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_role.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_role.rst
index 36dafbf8..a509eeb9 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_role.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_role.rst
@@ -39,7 +39,7 @@ Synopsis
^^^^^^^^
- This is the foo role.
-- If you set \ :literal:`foo\_param\_1` (`link `_)\ while \ :literal:`foo\_param\_2=3` (`link `_)\ , this might behave funny.
+- If you set \ :literal:`foo\_param\_1` (`link <#parameter-main--foo_param_1>`_)\ while \ :literal:`foo\_param\_2=3` (`link <#parameter-main--foo_param_2>`_)\ , this might behave funny.
Parameters
@@ -102,7 +102,7 @@ Attributes
- Support
- Description
- * - .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ * - .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
**check_mode**
@@ -115,7 +115,7 @@ Attributes
- * - .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ * - .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
**platform**
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_shell.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_shell.rst
index e59f59e9..6990cc5b 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_shell.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_shell.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo shell -- Foo shell \ :literal:`bar` (`link `_)\
+ns2.col.foo shell -- Foo shell \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This shell plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_test.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_test.rst
index 4946b1bd..3034dc89 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_test.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_test.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo test -- Is something a foo \ :literal:`bar` (`link `_)\
+ns2.col.foo test -- Is something a foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This test plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_vars.rst b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_vars.rst
index d6041115..8ceb2ed9 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_vars.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/col/foo_vars.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.col.foo vars -- Load foo \ :literal:`bar` (`link `_)\
+ns2.col.foo vars -- Load foo \ :literal:`bar` (`link <#parameter-bar>`_)\
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This vars plugin is part of the `ns2.col collection `_ (version 2.1.0).
diff --git a/tests/functional/baseline-simplified-rst/collections/ns2/flatcol/foo_module.rst b/tests/functional/baseline-simplified-rst/collections/ns2/flatcol/foo_module.rst
index d3884d68..5280dbdf 100644
--- a/tests/functional/baseline-simplified-rst/collections/ns2/flatcol/foo_module.rst
+++ b/tests/functional/baseline-simplified-rst/collections/ns2/flatcol/foo_module.rst
@@ -1,7 +1,7 @@
.. Created with antsibull-docs
-ns2.flatcol.foo module -- Do some foo \ :literal:`bar` (`link `_)\
+ns2.flatcol.foo module -- Do some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This module is part of the `ns2.flatcol collection `_.
diff --git a/tests/functional/baseline-squash-hierarchy/foo_role.rst b/tests/functional/baseline-squash-hierarchy/foo_role.rst
index 5d7e3901..dd66290c 100644
--- a/tests/functional/baseline-squash-hierarchy/foo_role.rst
+++ b/tests/functional/baseline-squash-hierarchy/foo_role.rst
@@ -192,7 +192,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
.. rst-class:: ansible-option-title
@@ -234,7 +234,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
.. rst-class:: ansible-option-title
diff --git a/tests/functional/baseline-use-html-blobs/collections/ns2/col/foo_role.rst b/tests/functional/baseline-use-html-blobs/collections/ns2/col/foo_role.rst
index 000cb1ac..6ce3601c 100644
--- a/tests/functional/baseline-use-html-blobs/collections/ns2/col/foo_role.rst
+++ b/tests/functional/baseline-use-html-blobs/collections/ns2/col/foo_role.rst
@@ -145,7 +145,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-check_mode:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__check_mode:
.. rst-class:: ansible-option-title
@@ -187,7 +187,7 @@ Attributes
- .. _ansible_collections.ns2.col.foo_role__attribute-platform:
+ .. _ansible_collections.ns2.col.foo_role__attribute-main__platform:
.. rst-class:: ansible-option-title