From 624991b9b7227acf3afe37fe9496a11b08f27c8c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jul 2021 13:29:39 +0530 Subject: [PATCH] Use the builtin envvar role for env vars Also fix some broken links --- docs/conf.py | 2 +- docs/launch.rst | 2 +- kitty/cli.py | 2 +- kitty/conf/types.py | 7 ++++--- kitty/options/definition.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d2f957b12..d3bd6b50e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -103,9 +103,9 @@ rst_prolog = ''' .. role:: bold .. role:: cyan .. role:: title -.. role:: env '''.replace('VERSION', str_version) +nitpicky = True # -- Options for HTML output ------------------------------------------------- diff --git a/docs/launch.rst b/docs/launch.rst index 80b8c8bf3..2bb850021 100644 --- a/docs/launch.rst +++ b/docs/launch.rst @@ -42,7 +42,7 @@ The piping environment -------------------------- When using :option:`launch --stdin-source`, the program to which the data is -piped has a special environment variable declared, :env:`KITTY_PIPE_DATA` whose +piped has a special environment variable declared, :envvar:`KITTY_PIPE_DATA` whose contents are:: KITTY_PIPE_DATA={scrolled_by}:{cursor_x},{cursor_y}:{lines},{columns} diff --git a/kitty/cli.py b/kitty/cli.py index af565ed06..46428e255 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -39,7 +39,7 @@ If this option is not specified, config files are searched for in the order: :file:`$XDG_CONFIG_DIRS/{appname}/{conf_name}.conf`. The first one that exists is used as the config file. -If the environment variable :env:`KITTY_CONFIG_DIRECTORY` is specified, that +If the environment variable :envvar:`KITTY_CONFIG_DIRECTORY` is specified, that directory is always used and the above searching does not happen. If :file:`/etc/xdg/{appname}/{conf_name}.conf` exists it is merged before (i.e. with lower diff --git a/kitty/conf/types.py b/kitty/conf/types.py index 60ee7f3c6..508315a39 100644 --- a/kitty/conf/types.py +++ b/kitty/conf/types.py @@ -41,13 +41,14 @@ def expand_opt_references(conf_name: str, text: str) -> str: def remove_markup(text: str) -> str: + base = 'https://sw.kovidgoyal.net/kitty' def sub(m: Match) -> str: if m.group(1) == 'ref': return { - 'layouts': 'https://sw.kovidgoyal.net/kitty/index.html#layouts', - 'sessions': 'https://sw.kovidgoyal.net/kitty/index.html#sessions', - 'functional': 'https://sw.kovidgoyal.net/kitty/keyboard-protocol.html#functional-key-definitions', + 'layouts': f'{base}/overview.html#layouts', + 'sessions': f'{base}/overview.html#sessions', + 'functional': f'{base}/keyboard-protocol.html#functional-key-definitions', }[m.group(2)] return str(m.group(2)) diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 5a044e2e5..f8633017b 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -656,7 +656,7 @@ and the window is not the currently focused window opt('command_on_bell', 'none', option_type='to_cmdline', long_text='Program to run when a bell occurs.' - ' The environment variable :env:`KITTY_CHILD_CMDLINE` can be used to get the program running in' + ' The environment variable :envvar:`KITTY_CHILD_CMDLINE` can be used to get the program running in' ' the window in which the bell occurred.' ) egr() # }}}