Strip whitespace and comments to reduce download size by 6kB (35%).
Silences site analysers such as Google PageSpeed about unminified CSS:
> Compacting CSS code can save many bytes of data and speed up download and
> parse times.
> Minifying http://sheet.shiar.nl/base.css could save 2KiB (41% reduction)
> after compression.
Tried a couple of existing tools [from Debian] but they mostly failed to
parse more complex rules, or tried to make unwanted "improvements".
Rather write some simple regexes to specifically and transparently replace
whitespace and comments.
# derived contents
/sitemap.xml
# derived contents
/sitemap.xml
# site owner tag for google webmaster tools
/google????????????????.html
# site owner tag for google webmaster tools
/google????????????????.html
-all: sitemap.xml data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.inc.pl
+all: sitemap.xml light.css data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.inc.pl
more: all
download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors data/unicode-sampler
.PHONY: download
# atomically create file by command
more: all
download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors data/unicode-sampler
.PHONY: download
# atomically create file by command
-cmdsave = @echo $1 $2 \>$@; mispipe '$1 $2' 'ifne sponge $@'
+cmdsave = @echo '$1' $2 \>$@; mispipe '$1 $2' 'ifne sponge $@'
# download git checkout
gitsave = @if cd $@ 2>/dev/null; \
then echo git pull $@; git pull -q --ff-only || true; \
# download git checkout
gitsave = @if cd $@ 2>/dev/null; \
then echo git pull $@; git pull -q --ff-only || true; \
sitemap.xml: tools/mksitemap
$(call cmdsave,$<)
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+//;'\'',$<)
+
data/DerivedAge.txt:
tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
data/DerivedAge.txt:
tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
+++ /dev/null
-base.css
\ No newline at end of file