plan: publish todo text as html page
[sheet.git] / Makefile
index 2b1c53163067cac0d1e21d533e254144a3dc4d52..961f4727909bf76b2b6aef6c113e9f98fde4f956 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-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 word
+all: sitemap.xml light.css plan.plp 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 word
 more: all
 
 .PHONY: force # applied to download after 2 hours
@@ -17,7 +17,15 @@ sitemap.xml: tools/mksitemap
 light.css: tools/stripcss base.css
        $(call cmdsave,$^)
 
-word: data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json
+plan.plp: TODO
+       kramdown $< >$@
+
+word: word/put.min.js data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json
+
+word/put.js: $(download)
+       tools/wget-ifmodified https://github.com/kriszyp/put-selector/raw/master/put.js $@
+word/%.min.js: word/%.js
+       uglifyjs -m '' $< -o $@
 
 data/DerivedAge.txt: $(download)
        tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
@@ -70,9 +78,12 @@ data/wordlist.en.inc.pl: tools/mkwordlist data/wordlist.version.txt
        $(call cmdsave,$<)
 data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
        $(call cmdsave,$< $*)
-data/wordlist.%.json: data/wordlist.%.inc.pl
+data/word%.json: data/word%.inc.pl
        $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
 
+data/wordpairs.inc.pl: data/wordlist.version.txt
+       @perl -I. -MShiar_Sheet::DB -MData::Dump=pp -E 'say pp(Shiar_Sheet::DB->connect->select("word w JOIN word a ON w.id=a.ref" => "w.id, a.id", {"a.lang"=>undef})->map or exit 1)' >$@
+
 .SECONDARY: data/font/%.ttf
 data/font/%.ttf:
        find /usr/share/fonts/truetype/ ~/.fonts/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@