about summary refs log tree commit diff stats
path: root/compile.sh
diff options
context:
space:
mode:
authorCase Duckworth2015-03-03 16:45:25 -0700
committerCase Duckworth2015-03-03 16:45:25 -0700
commit9ee7052f6b92dd9fd63e73c92c704aef90592826 (patch)
tree49c64c346fece089a60d3d44de8ee9bbc5720e0e /compile.sh
parentChange style of footnotes (diff)
downloadautocento-9ee7052f6b92dd9fd63e73c92c704aef90592826.tar.gz
autocento-9ee7052f6b92dd9fd63e73c92c704aef90592826.zip
Change compile method to utilize hidden files
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."