From b6d33e2019117dc29b4d46c53fc178f4b3c84e25 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jun 2018 13:44:27 +0530 Subject: [PATCH] More conf docs --- docs/conf.py | 3 ++- kitty/conf/definition.py | 6 ++++-- kitty/config_data.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b1c4f7570..1e81e6ed9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -308,7 +308,8 @@ def write_cli_docs(): def render_group(a, group): a(group.short_text) - a('^' * (len(group.short_text) + 20)) + heading_level = '+' if '.' in group.name else '^' + a(heading_level * (len(group.short_text) + 20)) a('') if group.start_text: a(group.start_text) diff --git a/kitty/conf/definition.py b/kitty/conf/definition.py index afa897310..60cd3683d 100644 --- a/kitty/conf/definition.py +++ b/kitty/conf/definition.py @@ -95,7 +95,8 @@ def render_block(text): def render_group(a, group): - a('# ' + group.short_text + ' {{''{') + if '.' not in group.name: + a('# ' + group.short_text + ' {{''{') a('') if group.start_text: a(render_block(group.start_text)) @@ -114,7 +115,8 @@ def as_conf_file(all_options): if current_group: if current_group.end_text: a(''), a(current_group.end_text) - a('# }}''}'), a('') + if '.' not in opt.group.name: + a('# }}''}'), a('') current_group = opt.group render_group(a, current_group) diff --git a/kitty/config_data.py b/kitty/config_data.py index 64f8c68f5..51734300a 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -129,6 +129,13 @@ o, g, all_groups = option_func(all_options, { 'window': [_('Window layout')], 'tabbar': [_('Tab bar')], 'colors': [_('Color scheme')], + 'colors.table': [ + _('The color table'), + _('''\ +The 16 terminal colors. There are 8 basic colors, each color has a dull and +bright version. You can also set the remaining colors from the 256 color table +as color16 to color256.''') + ], }) type_map = {o.name: o.option_type for o in all_options.values()} # }}} @@ -440,4 +447,30 @@ zero means fully dimmed (i.e. invisible).''')) o('selection_foreground', '#000000', option_type=to_color, long_text=_(''' The foreground and background for text selected with the mouse''')) o('selection_background', '#FFFACD', option_type=to_color) + +g('colors.table') +o('color0', '#000000', long_text=_('black'), option_type=to_color) +o('color8', '#767676', option_type=to_color) + +o('color1', '#cc0403', long_text=_('red'), option_type=to_color) +o('color9', '#f2201f', option_type=to_color) + +o('color2', '#19cb00', long_text=_('green'), option_type=to_color) +o('color10', '#23fd00', option_type=to_color) + +o('color3', '#cecb00', long_text=_('yellow'), option_type=to_color) +o('color11', '#fffd00', option_type=to_color) + +o('color4', '#0d73cc', long_text=_('blue'), option_type=to_color) +o('color12', '#1a8fff', option_type=to_color) + +o('color5', '#cb1ed1', long_text=_('magenta'), option_type=to_color) +o('color13', '#fd28ff', option_type=to_color) + +o('color6', '#0dcdcd', long_text=_('cyan'), option_type=to_color) +o('color14', '#14ffff', option_type=to_color) + +o('color7', '#dddddd', long_text=_('white'), option_type=to_color) +o('color15', '#ffffff', option_type=to_color) + # }}}