Skip to content

Commit 499189a

Browse files
committed
Address other labels. Fix wrong/ambiguous labels used.
1 parent 531ff93 commit 499189a

File tree

18 files changed

+40
-28
lines changed

18 files changed

+40
-28
lines changed

changelogs/fragments/269-refs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bugfixes:
2+
- "Fix links to requirements in simplified RST output (https://github.com/ansible-community/antsibull-docs/pull/269)."
3+
- "Include role in role attribute references (https://github.com/ansible-community/antsibull-docs/pull/269)."

src/antsibull_docs/data/docsite/ansible-docsite/macros/attributes.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="ansible-option-cell">
2727
<div class="ansibleOptionAnchor" id="attribute-@{ attribute | e }@"></div>
2828

29-
.. _ansible_collections.@{plugin_name}@_@{plugin_type}@__attribute-@{ attribute }@:
29+
.. _@{ rst_attribute_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, attribute=attribute) }@:
3030

3131
.. rst-class:: ansible-option-title
3232

src/antsibull_docs/data/docsite/ansible-docsite/macros/parameters.rst.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{% from 'macros/deprecates.rst.j2' import in_html as deprecates_html with context %}
1111
{% from 'macros/version_added.rst.j2' import version_added_rst, version_added_html %}
1212

13-
{% macro in_rst(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
13+
{% macro in_rst(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
1414
.. tabularcolumns:: \X{1}{3}\X{2}{3}
1515

1616
.. list-table::
@@ -38,7 +38,7 @@
3838
{% endif %}
3939

4040
{% for full_key in value['full_keys_rst'] %}
41-
.. _ansible_collections.@{plugin_name}@_@{plugin_type}@__parameter-@{ parameter_rst_prefix }@{% for part in full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}:
41+
.. _@{ rst_option_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, option=full_key) }@:
4242
{% endfor %}
4343

4444
.. rst-class:: ansible-option-title
@@ -180,7 +180,7 @@
180180

181181
{##################################################################################################################}
182182

183-
{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
183+
{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
184184
.. raw:: html
185185

186186
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">

src/antsibull_docs/data/docsite/ansible-docsite/macros/returnvalues.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{% endif %}
3737

3838
{% for full_key in value['full_keys_rst'] %}
39-
.. _ansible_collections.@{plugin_name}@_@{plugin_type}@__return-{% for part in full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}:
39+
.. _@{ rst_return_value_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, return_value=full_key) }@:
4040
{% endfor %}
4141

4242
.. rst-class:: ansible-option-title

src/antsibull_docs/data/docsite/ansible-docsite/plugin.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Aliases: @{ ', '.join(doc['aliases'] | sort) }@
150150
.. Requirements
151151

152152
{% if doc['requirements'] -%}
153-
.. _ansible_collections.@{plugin_name}@_@{plugin_type}@_requirements:
153+
.. _@{ rst_requirements_ref(plugin_name, plugin_type) }@:
154154

155155
Requirements
156156
------------

src/antsibull_docs/data/docsite/ansible-docsite/role.rst.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ Parameters
130130
^^^^^^^^^^
131131

132132
{% if use_html_blobs %}
133-
@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
133+
@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
134134
{% else %}
135-
@{ parameters_rst(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
135+
@{ parameters_rst(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
136136
{% endif %}
137137
{% endif %}
138138

src/antsibull_docs/data/docsite/simplified-rst/macros/attributes.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% for attribute, data in attributes | dictsort %}
1818
{# attribute name #}
1919

20-
* - .. _ansible_collections.@{plugin_name}@_@{plugin_type}@__attribute-@{ attribute }@:
20+
* - .. _@{ rst_attribute_ref(plugin_name, plugin_type, role_entrypoint=role_entrypoint, attribute=attribute) }@:
2121

2222
**@{ attribute }@**
2323

src/antsibull_docs/data/docsite/simplified-rst/macros/parameters.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{% from 'macros/deprecates.rst.j2' import in_html as deprecates_html with context %}
99
{% from 'macros/version_added.rst.j2' import version_added_html %}
1010

11-
{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', parameter_rst_prefix='', role_entrypoint=None) %}
11+
{% macro in_html(elements, suboption_key='suboptions', parameter_html_prefix='', role_entrypoint=None) %}
1212
.. raw:: html
1313

1414
<table style="width: 100%;">

src/antsibull_docs/data/docsite/simplified-rst/plugin.rst.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To check whether it is installed, run ``ansible-galaxy collection list``.
4848
To install it, use: @{ collection | collection_install | rst_code }@.
4949
{% if doc['requirements'] %}
5050
You need further requirements to be able to use this {% if plugin_type == 'module' %}module{% else %}@{ plugin_type }@ plugin{% endif %},
51-
see `Requirements <ansible_collections.@{plugin_name}@_@{plugin_type}@_requirements_>`_ for details.
51+
see `Requirements <@{ rst_requirements_ref(plugin_name, plugin_type) }@_>`_ for details.
5252
{% endif %}
5353

5454
To use it in a playbook, specify: ``@{plugin_name}@``.
@@ -108,7 +108,7 @@ Aliases: @{ ', '.join(doc['aliases'] | sort) }@
108108
{% endif %}
109109

110110
{% if doc['requirements'] -%}
111-
.. _ansible_collections.@{plugin_name}@_@{plugin_type}@_requirements:
111+
.. _@{ rst_requirements_ref(plugin_name, plugin_type) }@:
112112

113113
Requirements
114114
------------

src/antsibull_docs/data/docsite/simplified-rst/role.rst.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The below requirements are needed on the remote host and/or the local controller
9393
Parameters
9494
^^^^^^^^^^
9595

96-
@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', parameter_rst_prefix=entry_point ~ '__', role_entrypoint=entry_point) }@
96+
@{ parameters_html(ep_doc['options'] | dictsort, suboption_key='options', parameter_html_prefix=entry_point ~ '--', role_entrypoint=entry_point) }@
9797
{% endif %}
9898

9999
{% if ep_doc['attributes'] %}

0 commit comments

Comments
 (0)