2023-08-25 17:45:47 -04:00
|
|
|
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
|
2023-10-26 03:12:35 -04:00
|
|
|
if [[ -z $targetDocroot ]]; then
|
|
|
|
targetDocroot=$docroot
|
|
|
|
fi
|
2023-10-26 20:12:00 -04:00
|
|
|
echo "${PWD##*/}"
|
2023-10-26 03:12:35 -04:00
|
|
|
options=$osoptions"--toc --number-sections --toc-depth=5 --from markdown+smart+raw_html+fenced_divs+bracketed_spans --to html5 --wrap=preserve --metadata=lang:en --css=$targetDocroot"pandoc_templates/style.css" -Bnavbar -o"
|
|
|
|
for f in *
|
2023-08-25 17:45:47 -04:00
|
|
|
do
|
2023-10-26 03:12:35 -04:00
|
|
|
if [[ -d $f && -x $f/mkdocs.sh ]]; then
|
|
|
|
echo "recursing into" $f
|
|
|
|
$f/mkdocs.sh
|
2023-10-26 20:12:00 -04:00
|
|
|
dirx=`dirname $0`
|
|
|
|
dirx="${dirx%/}" # strip trailing slash (if any)
|
|
|
|
subdirx="${dirx##*/}"
|
|
|
|
echo "resuming "$subdirx
|
2023-10-26 03:12:35 -04:00
|
|
|
fi
|
|
|
|
if [[ $f =~ (.*)".md"$ ]];then
|
|
|
|
base=${BASH_REMATCH[1]}
|
|
|
|
if [[ $f -nt $destdir$base.html ]]; then
|
|
|
|
katex=""
|
|
|
|
line=""
|
|
|
|
for i in 1 2 3 4 5
|
|
|
|
do
|
|
|
|
read line
|
2023-08-25 17:45:47 -04:00
|
|
|
|
2023-10-26 03:12:35 -04:00
|
|
|
if [[ $line =~ katex ]];then
|
|
|
|
katex=" --katex="$docroot
|
|
|
|
fi
|
|
|
|
done <$f
|
|
|
|
pandoc --variable $banner_height --variable targetDocroot:$targetDocroot --template $docroot"pandoc_templates/pandoc.template" $katex $options $destdir$base.html $base.md
|
|
|
|
echo "$destdir$base.html from $f"
|
|
|
|
#else
|
|
|
|
# echo " $base.html up to date"
|
|
|
|
fi
|
|
|
|
fi
|
2023-08-25 17:45:47 -04:00
|
|
|
done
|
2023-10-26 20:12:00 -04:00
|
|
|
echo done with "${PWD##*/}"
|