#!/bin/sh # Generate build.ninja that builds the docs/stats/… layouts="ar-lulua ar-asmo663 ar-linux ar-malas ar-phonetic ar-osman ar-khorshid" layoutsXmodmap="ar-lulua" cat < \$out rule render-svg command = lulua-render -l \$layout svg \$out rule render-svg-heat command = lulua-render -l \$layout svg --heatmap=\$in \$out rule render-xmodmap command = lulua-render -l \$layout xmodmap \$out rule analyze-heat command = lulua-analyze -l \$layout keyheatmap < \$in > \$out rule write-bbcarabic command = find \$in -type f | lulua-write bbcarabic \$layout > \$out pool = write rule write-aljazeera command = find \$in -type f | lulua-write aljazeera \$layout > \$out pool = write rule write-tanzil command = echo \$in | lulua-write text \$layout | lulua-analyze combine > \$out pool = write rule write-arwiki command = \$wikiextractor -ns 0 --json -o - \$in 2>/dev/null | jq .text | lulua-write json \$layout | lulua-analyze combine > \$out pool = write rule combine command = cat \$in | lulua-analyze combine > \$out rule mkdir command = mkdir -p \$out rule letterfreq command = lulua-analyze -l ar-lulua letterfreq < \$in > \$out ### build targets ### build \$docdir/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle EOF for l in $layouts; do cat <