Also hyperlink :term:
This commit is contained in:
parent
31f763282f
commit
3b77f3b4bc
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user