diff options
author | Felix Fontein <felix@fontein.de> | 2023-03-31 16:52:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 10:52:10 -0400 |
commit | 0e509ecf2572aab5f277a13284e29d6c68d596ab (patch) | |
tree | b0cedbb42279625d1a2e9bdd02bb230d898f814f /lib | |
parent | a81b787a0510098686cf0263dd8b90bd0189e951 (diff) | |
download | ansible-0e509ecf2572aab5f277a13284e29d6c68d596ab.tar.gz |
Support role extension for semantic markup. (#80305)
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/ansible/cli/doc.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 97e6766336..124eadc920 100755 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -411,10 +411,17 @@ class DocCLI(CLI, RoleMixin): plugin_fqcn = plugin_type = '' else: plugin_fqcn = plugin_type = '' + entrypoint = None + if ':' in text: + entrypoint, text = text.split(':', 1) if value is not None: text = f"{text}={value}" if plugin_fqcn and plugin_type: - return f"`{text}' (of {plugin_type} {plugin_fqcn})" + plugin_suffix = '' if plugin_type in ('role', 'module', 'playbook') else ' plugin' + plugin = f"{plugin_type}{plugin_suffix} {plugin_fqcn}" + if plugin_type == 'role' and entrypoint is not None: + plugin = f"{plugin}, {entrypoint} entrypoint" + return f"`{text}' (of {plugin})" return f"`{text}'" @classmethod |