-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtmlbook.sh
executable file
·44 lines (37 loc) · 1.07 KB
/
htmlbook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Testfile
#cat trinket/test | python verbatim.py --trinket | pandoc -s -f markdown -t html --template=trinket/template --toc --default-image-extension=svg --css=../trinket/simplegrid.css -o html/test.html
# Clean directory
find html/. -type f -not -name 'figs2' | xargs rm
# Make a symlink to figs
#(cd html && ln -s ../figs2/)
# Pick your Python
MY_PYTHON=python
if which python3; then
MY_PYTHON=python3
fi
echo Using python command: $MY_PYTHON
# Convert all mkd into html
for fn in *.mkd; do
echo "the next file is $fn"
x=`basename $fn .mkd`
echo $x
cat $fn | \
$MY_PYTHON pre-html.py | \
tee tmp.html.pre.$x | \
$MY_PYTHON verbatim.py --files | \
pandoc -s \
--no-highlight \
-f markdown -t html \
--default-image-extension=svg \
--css=http://thisisdallas.github.io/Simple-Grid/simpleGrid.css \
-o html/$x.html
done
rm tmp.*
# Make the zip
rm zips/html.zip
zip -r9 zips/html.zip html && echo "Wrote zips/html.zip"
# Clean directory
echo
echo Cleaning up html folder
find html/. -type f -not -name 'figs2' | xargs rm