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
|
#!/bin/sh
source=README.md
target=README.html
title="backup2l: README"
if test ! -e ${source}
then
echo "Please add file ${source} into the current directory!"
exit 1
fi
if test -x /usr/bin/pandoc
then
echo "Converting ..."
pandoc --quiet \
-r markdown -w html \
--title-prefix="XXTITELXX" \
--email-obfuscation=references \
--standalone ${source} |\
sed "s#XXTITELXX...#${title}#" |\
sed "s#line-height: 1.5#line-height: 1.35#" |\
sed "s#font-size: 20px#font-size: 18px#" |\
sed "s#max-width: 36em#max-width: 42em#" |\
sed "s#max-width: 600px#max-width: 720px#" |\
sed "s#font-size: 85%#font-size: 75%#" |\
sed "s#overflow: auto#overflow: auto;\n line-height: 1.15#" >${target}
sleep 0.4
echo "${source} converted to ${target}."
else
echo "Please install the tool pandoc - Abort!"
exit 1
fi
|