From 41764d7b7d6a2efe5ae261bc551d8fc2ed06e0da Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 11 Nov 2024 07:44:02 +0100 Subject: [PATCH] Rename theme 'highlight' to 'dark' Leave space for future 'light' theme. --- README.rst | 15 +++++++-------- ...-side-highlight.png => side-by-side-dark.png} | Bin img/{unified-highlight.png => unified-dark.png} | Bin ydiff.py | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) rename img/{side-by-side-highlight.png => side-by-side-dark.png} (100%) rename img/{unified-highlight.png => unified-dark.png} (100%) diff --git a/README.rst b/README.rst index a1450fb..ec6181c 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ python >= 3.3 and ``less`` as a pager. See screenshots below. -Theme ``default``: +Theme ``default`` (works well for both dark and light terminal background): .. image:: https://github.com/ymattw/ydiff/blob/master/img/side-by-side-default.png :alt: side by side, theme 'default' @@ -24,15 +24,15 @@ Theme ``default``: :align: center :height: 300 px -Theme ``highlight``: +Theme ``dark``: (for dark terminal background): -.. image:: https://github.com/ymattw/ydiff/blob/master/img/side-by-side-highlight.png - :alt: side by side, theme 'highlight' +.. image:: https://github.com/ymattw/ydiff/blob/master/img/side-by-side-dark.png + :alt: side by side, theme 'dark' :align: center :height: 300 px -.. image:: https://github.com/ymattw/ydiff/blob/master/img/unified-highlight.png - :alt: unified, theme 'highlight' +.. image:: https://github.com/ymattw/ydiff/blob/master/img/unified-dark.png + :alt: unified, theme 'dark' :align: center :height: 300 px @@ -157,8 +157,7 @@ Type ``ydiff -h`` to show usage:: pager application to feed output to, default is 'less' -o OPT, --pager-options=OPT options to supply to pager application - --theme=THEME option to pick a color theme (one of default, - highlight) + --theme=THEME option to pick a color theme (one of default, dark) Note: Option parser will stop on first unknown option and pass them down to diff --git a/img/side-by-side-highlight.png b/img/side-by-side-dark.png similarity index 100% rename from img/side-by-side-highlight.png rename to img/side-by-side-dark.png diff --git a/img/unified-highlight.png b/img/unified-dark.png similarity index 100% rename from img/unified-highlight.png rename to img/unified-dark.png diff --git a/ydiff.py b/ydiff.py index f43491f..0237505 100755 --- a/ydiff.py +++ b/ydiff.py @@ -70,7 +70,7 @@ class Color(object): 'file_separator': (Color.FG_BRIGHT_CYAN,), 'wrap_marker': (Color.FG_BRIGHT_MAGENTA,), }, - 'highlight': { + 'dark': { # kind: (effects,) 'header': (Color.FG_CYAN,), 'old_path': (Color.BG8_DARK_RED,), @@ -789,7 +789,7 @@ def _process_args(self, largs, rargs, values): parser.add_option( '-o', '--pager-options', metavar='OPT', help="""options to supply to pager application""") - themes = ', '.join(sorted(THEMES.keys())) + themes = ', '.join(['default', *sorted(THEMES.keys() - {'default'})]) parser.add_option( '', '--theme', metavar='THEME', default='default', help="""option to pick a color theme (one of %s)""" % themes)