forked from cheng/wallet
39 lines
1.0 KiB
INI
39 lines
1.0 KiB
INI
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||
|
osoptions=""
|
||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||
|
osoptions=""
|
||
|
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
||
|
osoptions="--fail-if-warnings --eol=lf "
|
||
|
elif [[ "$OSTYPE" == "msys" ]]; then
|
||
|
osoptions="--fail-if-warnings --eol=lf "
|
||
|
fi
|
||
|
options=$osoptions"--toc --number-sections --toc-depth=5 --from markdown+smart+raw_html+native_divs+native_spans+fenced_divs+bracketed_spans --to html5 --wrap=preserve --metadata=lang:en --include-in-header=icon.pandoc --include-before-body=$templates/before.pandoc --css=$templates/style.css -o"
|
||
|
for f in *.md
|
||
|
do
|
||
|
len=${#f}
|
||
|
base=${f:0:($len-3)}
|
||
|
if [ $f -nt $destdir$base.html ];
|
||
|
then
|
||
|
katex=""
|
||
|
line=""
|
||
|
mine="--include-after-body=$templates/after.pandoc "
|
||
|
for i in 1 2 3 4 5 6
|
||
|
do
|
||
|
read line
|
||
|
if [[ $line =~ katex$ ]];
|
||
|
then
|
||
|
katex=" --katex=./"
|
||
|
fi
|
||
|
if [[ $line =~ notmine ]];
|
||
|
then
|
||
|
mine=" "
|
||
|
fi
|
||
|
done <$f
|
||
|
pandoc $katex $mine $options $destdir$base.html $base.md
|
||
|
echo "$base.html from $f"
|
||
|
|
||
|
#else
|
||
|
# echo " $base.html up to date"
|
||
|
fi
|
||
|
done
|