From c5af9613fd45c5ea954e50d461ecda25af1f78b5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Nov 2021 20:02:18 +0530 Subject: [PATCH] Fix building of docs --- docs/changelog.rst | 2 +- kitty/conf/types.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 48f738663..a2fe63b74 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -56,7 +56,7 @@ To update |kitty|, :doc:`follow the instructions `. - broadcast kitten: Show a "fake" cursor in all windows being broadcast too (:iss:`4225`) -- Allow defining aliases for more general actions, not just kittens +- Allow defining :opt:`aliases ` for more general actions, not just kittens (:pull:`4260`) - Fix a regression that caused :option:`kitty --title` to not work when diff --git a/kitty/conf/types.py b/kitty/conf/types.py index 66f444e9b..81bbac0da 100644 --- a/kitty/conf/types.py +++ b/kitty/conf/types.py @@ -49,14 +49,15 @@ def remove_markup(text: str) -> str: 'watchers': f'{website_url("launch")}#watchers', 'sessions': f'{website_url("overview")}#startup-sessions', 'functional': f'{website_url("keyboard-protocol")}#functional-key-definitions', - 'action-select_tab': f'{website_url("actions")}#select-tab', - 'action-close_window_with_confirmation': f'{website_url("actions")}#close-window-with-confirmation', 'shell_integration': website_url("shell-integration"), } + for ac in ('launch', 'select_tab', 'shell_integration', 'close_window_with_confirmation', 'kitten', 'remote_control'): + ref_map[f'action-{ac}'] = f'{website_url("actions")}#' + ac.replace('_', '-') def sub(m: 'Match[str]') -> str: if m.group(1) == 'ref': - return ref_map[m.group(2)] + q = m.group(2).split('<')[-1].rstrip('>') + return ref_map[q] return str(m.group(2)) return re.sub(r':([a-zA-Z0-9]+):`(.+?)`', sub, text, flags=re.DOTALL)