diff options
Diffstat (limited to 'compile.sh')
-rw-r--r-- | compile.sh | 11 |
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 | ||
3 | num=0 | 3 | num=0 |
4 | for file in src/*.txt; do # TODO: change this to work with globs & args & stuff | 4 | for 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." | |||
22 | echo | 23 | echo |
23 | echo "Updating js/lozenge.js with file list ..." | 24 | echo "Updating js/lozenge.js with file list ..." |
24 | 25 | ||
25 | lozengeList=( $(ls *.html | grep -v '\(_template\|loremipsum\|ipsumlorem\)') ) | 26 | lozengeList=( $(ls *.html) ) |
26 | 27 | ||
27 | list=$(sed -e 's/\S\+\.html/"&",/g' -e 's/,$//' -e 's/^.*$/var files=[&]/' <<< "${lozengeList[@]}") | 28 | list=$(sed -e 's/\S\+\.html/"&",/g' -e 's/,$//' -e 's/^.*$/var files=[&]/' <<< "${lozengeList[@]}") |
28 | 29 | ||
29 | sed -i "s/var files=.*/$list/" js/lozenge.js | 30 | sed -i "s/var files=.*/$list/" js/lozenge.js |
30 | 31 | ||
31 | echo "Finished." | 32 | echo "Finished updating: ${#lozengeList[@]} files." |