=== modified file 'render_files' --- render_files 2014-06-03 13:33:58 +0000 +++ render_files 2014-05-07 14:56:28 +0000 @@ -2,8 +2,8 @@ render() { mkdir -p head/${1%/*} || exit $? if test raw/"$1" -nt head.old/"$1".html; then - escaped="head/$(sed 's/[#%|\\]/\\&/' <<<"$1").html" - vim /dev/null 2>&1 raw/"$1" +'set modeline' +'e!' +'set nornu number fdm=' +TOhtml '+w! '"$escaped" '+qa!' + # TODO: escape filename!! + vim /dev/null 2>&1 raw/"$1" +'set modeline' +'e!' +'set nornu number fdm=' +TOhtml '+w! head/'"$1".html '+qa!' touch -r raw/"$1" head/"$1".html else mv head.old/"$1".html head/"$1".html @@ -14,10 +14,10 @@ test -d head.old && rm -rf head.old test -d head && mv head head.old while IFS='' read LINE; do - FILE=${LINE% *} - TYPE=${LINE##* } - MIME=${TYPE##; *} - case $MIME in + F=${LINE% *} + T=${LINE##* } + T=${T## } + case $T in (text/*) render "$F";; esac done