Skip to content

Commit 93cd4b1

Browse files
committed
Fix internal option/return value links for simplified RST output.
1 parent 09f2ba7 commit 93cd4b1

28 files changed

+31
-30
lines changed

changelogs/fragments/269-refs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bugfixes:
22
- "Fix links to requirements in simplified RST output (https://github.com/ansible-community/antsibull-docs/pull/269)."
3+
- "Fix internal links to options and return values in simplified RST output (https://github.com/ansible-community/antsibull-docs/pull/269)."
34
- "Include role in role attribute references (https://github.com/ansible-community/antsibull-docs/pull/269)."

src/antsibull_docs/markup/rstify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _custom_format_option_like(
8383
) -> str:
8484
plugin = part.plugin
8585
if url and url.endswith("_"):
86-
plugin_text = f" (`link <{url}>`_)"
86+
plugin_text = f" (`link <#{url[:-1]}>`_)"
8787
elif plugin:
8888
plugin_result = [plugin.type]
8989
if plugin.type not in ("module", "role", "playbook"):

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_become.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo become -- Use foo \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo become -- Use foo \ :literal:`bar` (`link <#parameter-bar>`_)\
55
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This become plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo cache -- Foo files \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo cache -- Foo files \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This cache plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_callback.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo callback -- Foo output \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo callback -- Foo output \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This callback plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_connection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo connection -- Foo connection \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This connection plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_filter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo filter -- The foo filter \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This filter plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_inventory.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo inventory -- The foo inventory \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This inventory plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_lookup.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo lookup -- Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This lookup plugin is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).

tests/functional/baseline-simplified-rst-squash-hierarchy/foo_module.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. Created with antsibull-docs <ANTSIBULL_DOCS_VERSION>
33
4-
ns2.col.foo module -- Do some foo \ :literal:`bar` (`link <parameter-bar_>`_)\
4+
ns2.col.foo module -- Do some foo \ :literal:`bar` (`link <#parameter-bar>`_)\
55
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66

77
This module is part of the `ns2.col collection <https://galaxy.ansible.com/ui/repo/published/ns2/col/>`_ (version 2.1.0).
@@ -199,7 +199,7 @@ See Also
199199
Another foo.
200200
* \ `ns2.col.foo <foo_lookup.rst>`__\ lookup plugin
201201

202-
Look up some foo \ :literal:`bar` (`link <parameter-bar_>`_)\ .
202+
Look up some foo \ :literal:`bar` (`link <#parameter-bar>`_)\ .
203203
* \ `ansible.builtin.service <service_module.rst>`__\
204204

205205
The service module.

0 commit comments

Comments
 (0)