about summary refs log tree commit diff stats
path: root/compile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'compile.sh')
-rw-r--r--compile.sh41
1 files changed, 0 insertions, 41 deletions
diff --git a/compile.sh b/compile.sh deleted file mode 100644 index 51a94f7..0000000 --- a/compile.sh +++ /dev/null
@@ -1,41 +0,0 @@
1num=0
2for file in src/{.[!.]*,*}.txt; do
3 # TODO: change this to work with globs & args & stuff
4 echo -n "Compiling $file to HTML5"
5 pandoc -f markdown \
6 -t html5 \
7 --template=.template.html \
8 --smart \
9 --mathml \
10 "$file" \
11 -o "${file%.txt}.html"
12 echo -n " & RIVER ..."
13 pandoc -f markdown \
14 -t lua/river.lua \
15 "$file" \
16 -o "${file%.txt}.river"
17 echo " Done."
18 ((num += 1))
19done
20
21echo
22echo "Moving files to build directory ..."
23mv src/{.[!.]*,*}.html ./
24echo "Moving RIVERs to river/ ..."
25mv src/*.river river/
26rm src/*.river
27echo "Concatenating and counting rivers ..."
28cat river/*.river | \
29 sort | uniq -c | sort >river/COUNTS.txt
30echo "Finished compiling $num files."
31###############################################
32echo
33echo "Updating js/lozenge.js with file list ..."
34
35lozengeList=( $(ls *.html) )
36
37list=$(sed -e 's/\S\+\.html/"&",/g' -e 's/,$//' -e 's/^.*$/var files=[&]/' <<< "${lozengeList[@]}")
38
39sed -i "s/var files=.*/$list/" js/lozenge.js
40
41echo "Finished updating: ${#lozengeList[@]} files."