Also hyperlink the :ac: role in CLI help output
This commit is contained in:
parent
5350eb29c1
commit
a59e1adee1
@ -178,6 +178,15 @@ def ref(x: str) -> str:
|
||||
return t
|
||||
|
||||
|
||||
@role
|
||||
def ac(x: str) -> str:
|
||||
t, q = text_and_target(x)
|
||||
url = resolve_ref(q)
|
||||
if url:
|
||||
return hyperlink_for_url(url, t)
|
||||
return t
|
||||
|
||||
|
||||
OptionSpecSeq = List[Union[str, OptionDict]]
|
||||
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ def resolve_ref(ref: str, website_url: Callable[[str], str] = website_url) -> st
|
||||
elif ref.startswith('action-group-'):
|
||||
href = f'{website_url("generated/actions")}#{ref}'
|
||||
elif ref.startswith('action-'):
|
||||
frag = ref.partition('-')[-1]
|
||||
frag = ref.partition('-')[-1].replace('_', '-')
|
||||
href = f'{website_url("generated/actions")}#{frag}'
|
||||
return href
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user