Also hyperlink :term:

This commit is contained in:
Kovid Goyal 2022-08-20 15:40:39 +05:30
parent 31f763282f
commit 3b77f3b4bc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 4 deletions

View File

@ -133,14 +133,13 @@ def code(x: str) -> str:
def text_and_target(x: str) -> Tuple[str, str]:
parts = x.split('<')
parts = x.split('<', 1)
return parts[0].strip(), parts[-1].rstrip('>')
@role
def term(x: str) -> str:
t, q = text_and_target(x)
return italic(t)
return ref_hyperlink(x, 'term-')
@role

View File

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

View File

@ -264,7 +264,7 @@ specified. See :opt:`window_logo_position`.
type=float
default=-1
The amount the window logo should be faded into the background. Only takes
effect if :option:`--logo` is specified. See :opt:`window_logo_position`.
effect if :option:`--logo` is specified. See :opt:`window_logo_alpha`.
--color