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.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/compile.sh b/compile.sh index c07f80c..908188b 100644 --- a/compile.sh +++ b/compile.sh
@@ -1,14 +1,15 @@
1# for windows only right now 1# for windows only right now
2 2
3num=0 3num=0
4for file in src/*.txt; do # TODO: change this to work with globs & args & stuff 4for file in src/{.[!.]*,*}.txt; do
5 # TODO: change this to work with globs & args & stuff
5 echo -n "Compiling $file ..." 6 echo -n "Compiling $file ..."
6 pandoc -f markdown \ 7 pandoc -f markdown \
7 -t html5 \ 8 -t html5 \
8 --template=_template.html \ 9 --template=.template.html \
9 --smart \ 10 --smart \
10 --mathml \ 11 --mathml \
11 $file \ 12 "$file" \
12 -o "${file%.txt}.html" 13 -o "${file%.txt}.html"
13 echo " Done." 14 echo " Done."
14 ((num += 1)) 15 ((num += 1))
@@ -22,10 +23,10 @@ echo "Finished compiling $num files."
22echo 23echo
23echo "Updating js/lozenge.js with file list ..." 24echo "Updating js/lozenge.js with file list ..."
24 25
25lozengeList=( $(ls *.html | grep -v '\(_template\|loremipsum\|ipsumlorem\)') ) 26lozengeList=( $(ls *.html) )
26 27
27list=$(sed -e 's/\S\+\.html/"&",/g' -e 's/,$//' -e 's/^.*$/var files=[&]/' <<< "${lozengeList[@]}") 28list=$(sed -e 's/\S\+\.html/"&",/g' -e 's/,$//' -e 's/^.*$/var files=[&]/' <<< "${lozengeList[@]}")
28 29
29sed -i "s/var files=.*/$list/" js/lozenge.js 30sed -i "s/var files=.*/$list/" js/lozenge.js
30 31
31echo "Finished." 32echo "Finished updating: ${#lozengeList[@]} files."