Hyperlink :envvar: as well

This commit is contained in:
Kovid Goyal 2022-08-20 16:24:46 +05:30
parent e1c45dc23f
commit 10fdde6647
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -149,7 +149,7 @@ def kbd(x: str) -> str:
@role @role
def env(x: str) -> str: def env(x: str) -> str:
return italic(x) return ref_hyperlink(x, 'envvar-')
role_map['envvar'] = role_map['env'] role_map['envvar'] = role_map['env']

View File

@ -70,8 +70,8 @@ def resolve_ref(ref: str, website_url: Callable[[str], str] = website_url) -> st
elif ref.startswith('action-'): elif ref.startswith('action-'):
frag = ref.partition('-')[-1].replace('_', '-') frag = ref.partition('-')[-1].replace('_', '-')
href = f'actions/#{frag}' href = f'actions/#{frag}'
elif ref.startswith('term-'): elif ref.startswith('term-') or ref.startswith('envvar-'):
href = 'glossary/#term-' + ref.partition('-')[-1] href = 'glossary/#' + ref
return website_url(href) return website_url(href)