Expand links to kitty docs in sample kitty.conf

This commit is contained in:
Kovid Goyal 2018-07-20 21:21:52 +05:30
parent 810f149501
commit 1695f6800c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -119,7 +119,16 @@ def merged_opts(all_options, opt, i):
def remove_markup(text):
return re.sub(r':([a-zA-Z0-9]+):`(.+?)`', r'\2', text, flags=re.DOTALL)
def sub(m):
if m.group(1) == 'ref':
return {
'layouts': 'https://sw.kovidgoyal.net/kitty/index.html#layouts',
'sessions': 'https://sw.kovidgoyal.net/kitty/index.html#sessions',
}[m.group(2)]
return m.group(2)
return re.sub(r':([a-zA-Z0-9]+):`(.+?)`', sub, text, flags=re.DOTALL)
def iter_blocks(lines):