From 6dfbbcf1e48147f4710583c23372986b9763d17c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 11 Jun 2017 02:45:35 +0200 Subject: [PATCH] tools: separate stripcss script to build css Expanded for readability but otherwise identical code. --- Makefile | 4 ++-- tools/stripcss | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 tools/stripcss diff --git a/Makefile b/Makefile index 349e34f..9746c96 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ gitsave = @if cd $@ 2>/dev/null; \ sitemap.xml: tools/mksitemap $(call cmdsave,$<) -light.css: base.css - $(call cmdsave,perl -pe '\''s!\s*/\*.*\*/\Z!!; s/^\s*//; s/\h+/ /g; s/:\K\h+//;'\'',$<) +light.css: tools/stripcss base.css + $(call cmdsave,$^) data/DerivedAge.txt: tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@ diff --git a/tools/stripcss b/tools/stripcss new file mode 100755 index 0000000..4b41f01 --- /dev/null +++ b/tools/stripcss @@ -0,0 +1,11 @@ +#!/usr/bin/env perl +use 5.014; +use warnings; + +while (<>) { + s!\s*/\*.*\*/\Z!!; # comments + s/^\s*//; # indentation and empty lines + s/\h+/ /g; # alignment + s/:\K\h//; # separators + print; +} -- 2.30.0