From 318070abc9cd7799f9e1da26dae6e1e1f51c33e6 Mon Sep 17 00:00:00 2001 From: Matthew Brush Date: Sat, 22 Jun 2019 15:34:55 -0700 Subject: [PATCH] Add a script to generate screenshots/README.md --- Makefile | 5 +- screenshots/README.md | 126 ++++++++++++++++++---------------- scripts/screenshots-readme.py | 59 ++++++++++++++++ 3 files changed, 129 insertions(+), 61 deletions(-) create mode 100644 scripts/screenshots-readme.py diff --git a/Makefile b/Makefile index b35cae8..e74d5bd 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ MISMATCH_MESSAGE = Warning: Possible wrong version of Geany installed ARCHIVE_NAME = geany-themes-$(THEMES_VERSION).tar.bz2 ARCHIVE_TEMP_DIR = geany-themes-$(THEMES_VERSION) -all: autobump index +all: autobump index screenshots/README.md install: mkdir -p $(COLORSCHEME_DIR) @@ -27,6 +27,9 @@ index: scripts/versions.log autobump: $(THEMES) python scripts/autobump.py +screenshots/README.md: $(THEMES) + python scripts/screenshots-readme.py > $@ + clean: make -C index clean diff --git a/screenshots/README.md b/screenshots/README.md index bf720c9..c36e394 100644 --- a/screenshots/README.md +++ b/screenshots/README.md @@ -1,3 +1,9 @@ +### [The Monokai Theme](../colorschemes/monokai.conf) + +[![monokai.png](monokai.png)](monokai.png "The Monokai Theme") + +[The Monokai Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/monokai.conf) + ### [The Bespin Theme](../colorschemes/bespin.conf) @@ -6,11 +12,11 @@ [The Bespin Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/bespin.conf) -### [The Black Theme](../colorschemes/black.conf) +### [The Black Scheme Theme](../colorschemes/black.conf) -[![black.png](black.png)](black.png "The Black Theme") +[![black.png](black.png)](black.png "The Black Scheme Theme") -[The Black Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/black.conf) +[The Black Scheme Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/black.conf) ### [The Darcula Theme](../colorschemes/darcula.conf) @@ -20,18 +26,18 @@ [The Darcula Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/darcula.conf) -### [The DarkColors Theme](../colorschemes/dark-colors.conf) +### [The Dark Colors Theme](../colorschemes/dark-colors.conf) -[![dark-colors.png](dark-colors.png)](dark-colors.png "The DarkColors Theme") +[![dark-colors.png](dark-colors.png)](dark-colors.png "The Dark Colors Theme") -[The DarkColors Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/dark-colors.conf) +[The Dark Colors Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/dark-colors.conf) -### [The DarkFruitSalad Theme](../colorschemes/dark-fruit-salad.conf) +### [The Dark Fruit Salad Theme](../colorschemes/dark-fruit-salad.conf) -[![dark-fruit-salad.png](dark-fruit-salad.png)](dark-fruit-salad.png "The DarkFruitSalad Theme") +[![dark-fruit-salad.png](dark-fruit-salad.png)](dark-fruit-salad.png "The Dark Fruit Salad Theme") -[The DarkFruitSalad Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/dark-fruit-salad.conf) +[The Dark Fruit Salad Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/dark-fruit-salad.conf) ### [The Dark Theme](../colorschemes/dark.conf) @@ -41,11 +47,11 @@ [The Dark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/dark.conf) -### [The DeltDark Theme](../colorschemes/delt-dark.conf) +### [The Delt Dark Theme](../colorschemes/delt-dark.conf) -[![delt-dark.png](delt-dark.png)](delt-dark.png "The DeltDark Theme") +[![delt-dark.png](delt-dark.png)](delt-dark.png "The Delt Dark Theme") -[The DeltDark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/delt-dark.conf) +[The Delt Dark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/delt-dark.conf) ### [The Epsilon Theme](../colorschemes/epsilon.conf) @@ -69,11 +75,11 @@ [The Gedit Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/gedit.conf) -### [The Github Theme](../colorschemes/github.conf) +### [The GitHub Theme](../colorschemes/github.conf) -[![github.png](github.png)](github.png "The Github Theme") +[![github.png](github.png)](github.png "The GitHub Theme") -[The Github Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/github.conf) +[The GitHub Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/github.conf) ### [The Himbeere Theme](../colorschemes/himbeere.conf) @@ -83,46 +89,46 @@ [The Himbeere Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/himbeere.conf) -### [The Inkpot Theme](../colorschemes/inkpot.conf) +### [The InkPot Theme](../colorschemes/inkpot.conf) -[![inkpot.png](inkpot.png)](inkpot.png "The Inkpot Theme") +[![inkpot.png](inkpot.png)](inkpot.png "The InkPot Theme") -[The Inkpot Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/inkpot.conf) +[The InkPot Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/inkpot.conf) -### [The Mc Theme](../colorschemes/mc.conf) +### [The Kugel Theme](../colorschemes/kugel.conf) -[![mc.png](mc.png)](mc.png "The Mc Theme") +[![kugel.png](kugel.png)](kugel.png "The Kugel Theme") -[The Mc Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/mc.conf) +[The Kugel Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/kugel.conf) -### [The MetallicBottle Theme](../colorschemes/metallic-bottle.conf) +### [The Ralesk's MC Theme](../colorschemes/mc.conf) -[![metallic-bottle.png](metallic-bottle.png)](metallic-bottle.png "The MetallicBottle Theme") +[![mc.png](mc.png)](mc.png "The Ralesk's MC Theme") -[The MetallicBottle Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/metallic-bottle.conf) +[The Ralesk's MC Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/mc.conf) -### [The Monokai Theme](../colorschemes/monokai.conf) +### [The Metallic Bottle Theme](../colorschemes/metallic-bottle.conf) -[![monokai.png](monokai.png)](monokai.png "The Monokai Theme") +[![metallic-bottle.png](metallic-bottle.png)](metallic-bottle.png "The Metallic Bottle Theme") -[The Monokai Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/monokai.conf) +[The Metallic Bottle Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/metallic-bottle.conf) -### [The NotepadPlusPlus Theme](../colorschemes/notepad-plus-plus.conf) +### [The Notepad-plus-plus Theme](../colorschemes/notepad-plus-plus.conf) -[![notepad-plus-plus.png](notepad-plus-plus.png)](notepad-plus-plus.png "The NotepadPlusPlus Theme") +[![notepad-plus-plus.png](notepad-plus-plus.png)](notepad-plus-plus.png "The Notepad-plus-plus Theme") -[The NotepadPlusPlus Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/notepad-plus-plus.conf) +[The Notepad-plus-plus Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/notepad-plus-plus.conf) -### [The Oblivion2 Theme](../colorschemes/oblivion2.conf) +### [The Oblivion 2 Theme](../colorschemes/oblivion2.conf) -[![oblivion2.png](oblivion2.png)](oblivion2.png "The Oblivion2 Theme") +[![oblivion2.png](oblivion2.png)](oblivion2.png "The Oblivion 2 Theme") -[The Oblivion2 Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/oblivion2.conf) +[The Oblivion 2 Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/oblivion2.conf) ### [The Pygments Theme](../colorschemes/pygments.conf) @@ -132,11 +138,11 @@ [The Pygments Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/pygments.conf) -### [The Railcasts2 Theme](../colorschemes/railcasts2.conf) +### [The Railcasts 2 Theme](../colorschemes/railcasts2.conf) -[![railcasts2.png](railcasts2.png)](railcasts2.png "The Railcasts2 Theme") +[![railcasts2.png](railcasts2.png)](railcasts2.png "The Railcasts 2 Theme") -[The Railcasts2 Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/railcasts2.conf) +[The Railcasts 2 Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/railcasts2.conf) ### [The Retro Theme](../colorschemes/retro.conf) @@ -146,39 +152,39 @@ [The Retro Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/retro.conf) -### [The SleepyPastel Theme](../colorschemes/sleepy-pastel.conf) +### [The Sleepy Pastel Theme](../colorschemes/sleepy-pastel.conf) -[![sleepy-pastel.png](sleepy-pastel.png)](sleepy-pastel.png "The SleepyPastel Theme") +[![sleepy-pastel.png](sleepy-pastel.png)](sleepy-pastel.png "The Sleepy Pastel Theme") -[The SleepyPastel Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/sleepy-pastel.conf) +[The Sleepy Pastel Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/sleepy-pastel.conf) -### [The Slushpoppies Theme](../colorschemes/slushpoppies.conf) +### [The Slush and Poppies Theme](../colorschemes/slushpoppies.conf) -[![slushpoppies.png](slushpoppies.png)](slushpoppies.png "The Slushpoppies Theme") +[![slushpoppies.png](slushpoppies.png)](slushpoppies.png "The Slush and Poppies Theme") -[The Slushpoppies Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/slushpoppies.conf) +[The Slush and Poppies Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/slushpoppies.conf) -### [The SolarizedDark Theme](../colorschemes/solarized-dark.conf) +### [The Solarized (dark) Theme](../colorschemes/solarized-dark.conf) -[![solarized-dark.png](solarized-dark.png)](solarized-dark.png "The SolarizedDark Theme") +[![solarized-dark.png](solarized-dark.png)](solarized-dark.png "The Solarized (dark) Theme") -[The SolarizedDark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/solarized-dark.conf) +[The Solarized (dark) Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/solarized-dark.conf) -### [The SolarizedLight Theme](../colorschemes/solarized-light.conf) +### [The Solarized (light) Theme](../colorschemes/solarized-light.conf) -[![solarized-light.png](solarized-light.png)](solarized-light.png "The SolarizedLight Theme") +[![solarized-light.png](solarized-light.png)](solarized-light.png "The Solarized (light) Theme") -[The SolarizedLight Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/solarized-light.conf) +[The Solarized (light) Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/solarized-light.conf) -### [The SpyderDark Theme](../colorschemes/spyder-dark.conf) +### [The Spyder Dark Theme](../colorschemes/spyder-dark.conf) -[![spyder-dark.png](spyder-dark.png)](spyder-dark.png "The SpyderDark Theme") +[![spyder-dark.png](spyder-dark.png)](spyder-dark.png "The Spyder Dark Theme") -[The SpyderDark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/spyder-dark.conf) +[The Spyder Dark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/spyder-dark.conf) ### [The Steampunk Theme](../colorschemes/steampunk.conf) @@ -188,18 +194,18 @@ [The Steampunk Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/steampunk.conf) -### [The TangoDark Theme](../colorschemes/tango-dark.conf) +### [The Tango Theme](../colorschemes/tango-dark.conf) -[![tango-dark.png](tango-dark.png)](tango-dark.png "The TangoDark Theme") +[![tango-dark.png](tango-dark.png)](tango-dark.png "The Tango Theme") -[The TangoDark Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/tango-dark.conf) +[The Tango Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/tango-dark.conf) -### [The TangoLight Theme](../colorschemes/tango-light.conf) +### [The Tango Light Theme](../colorschemes/tango-light.conf) -[![tango-light.png](tango-light.png)](tango-light.png "The TangoLight Theme") +[![tango-light.png](tango-light.png)](tango-light.png "The Tango Light Theme") -[The TangoLight Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/tango-light.conf) +[The Tango Light Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/tango-light.conf) ### [The Tinge Theme](../colorschemes/tinge.conf) @@ -216,11 +222,11 @@ [The Ubuntu Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/ubuntu.conf) -### [The VibrantInk Theme](../colorschemes/vibrant-ink.conf) +### [The Vibrant Theme](../colorschemes/vibrant-ink.conf) -[![vibrant-ink.png](vibrant-ink.png)](vibrant-ink.png "The VibrantInk Theme") +[![vibrant-ink.png](vibrant-ink.png)](vibrant-ink.png "The Vibrant Theme") -[The VibrantInk Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/vibrant-ink.conf) +[The Vibrant Theme Direct Download](https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/vibrant-ink.conf) ### [The Zenburn Theme](../colorschemes/zenburn.conf) diff --git a/scripts/screenshots-readme.py b/scripts/screenshots-readme.py new file mode 100644 index 0000000..534fdf6 --- /dev/null +++ b/scripts/screenshots-readme.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +""" +Generates the screenshots/README.md file. +""" + +import os +import sys +from geanyscheme.confparse import ConfParse + +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +THEME_DIR = os.path.join(BASE_DIR, "colorschemes") +SCREENSHOT_DIR = os.path.join(BASE_DIR, "screenshots") +RAW_URL = 'https://raw.githubusercontent.com/geany/geany-themes/master/colorschemes/' + +class ColorScheme: + def __init__(self, name, theme, screenshot): + self.name = name + self.theme = theme + self.screenshot = screenshot + + @property + def title(self): + return "The %s Theme" % self.name + + @property + def theme_url(self): + return RAW_URL + os.path.basename(self.theme) + + @property + def markdown(self): + code = '### [%s](%s)\n' % (self.title, self.theme) + code += '\n' + code += '[![%s](%s)](%s "%s")\n' % ( + self.screenshot, self.screenshot, self.screenshot, self.title) + code += '\n' + code += '[%s Direct Download](%s)\n' % (self.title, self.theme_url) + code += '\n\n' + return code + +def list_colorschemes(): + schemes = [] + for fn in os.listdir(THEME_DIR): + path = os.path.join(THEME_DIR, fn) + conf = ConfParse(path) + scheme = ColorScheme( + conf.get("theme_info", "name"), + os.path.join("..", "colorschemes", fn), + os.path.splitext(fn)[0] + ".png") + schemes.append(scheme) + return schemes + +def main(args): + for scheme in list_colorschemes(): + sys.stdout.write(scheme.markdown) + return 0 + +if __name__ == "__main__": + sys.exit(main(sys.argv))