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.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/compile.sh b/compile.sh index eb896b7..e6b3141 100644 --- a/compile.sh +++ b/compile.sh
@@ -1,9 +1,7 @@
1# for windows only right now
2
3num=0 1num=0
4for file in src/{.[!.]*,*}.txt; do 2for file in src/{.[!.]*,*}.txt; do
5 # TODO: change this to work with globs & args & stuff 3 # TODO: change this to work with globs & args & stuff
6 echo -n "Compiling $file ..." 4 echo -n "Compiling $file to HTML5"
7 pandoc -f markdown \ 5 pandoc -f markdown \
8 -t html5 \ 6 -t html5 \
9 --template=.template.html \ 7 --template=.template.html \
@@ -11,6 +9,11 @@ for file in src/{.[!.]*,*}.txt; do
11 --mathml \ 9 --mathml \
12 "$file" \ 10 "$file" \
13 -o "${file%.txt}.html" 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"
14 echo " Done." 17 echo " Done."
15 ((num += 1)) 18 ((num += 1))
16done 19done
@@ -18,6 +21,12 @@ done
18echo 21echo
19echo "Moving files to build directory ..." 22echo "Moving files to build directory ..."
20mv src/{.[!.]*,*}.html ./ 23mv src/{.[!.]*,*}.html ./
24echo "Moving RIVERs to river/ ..."
25mv src/{.[!.]*,*}.river river/
26echo "Concatenating and counting rivers ..."
27cat river/*.river | \
28 sed -e "s/^\s\+//" -e "s/\s\+$//" -e 's/--\+/\n/g' | \
29 sort | uniq -c | sort >river/COUNTS.txt
21echo "Finished compiling $num files." 30echo "Finished compiling $num files."
22############################################### 31###############################################
23echo 32echo