static-pandoc-template/spt
Yann Esposito (Yogsototh) 2843c77720 initial commit
2013-04-15 16:58:52 +02:00

22 lines
565 B
Bash
Executable file

#!/usr/bin/env zsh
(($#<1)) && print -- "usage: ${0:t} fic [fic ...]"
curdir=$HOME/Sites/static-pandoc-template
[[ ! -d static-pandoc ]] && mkdir static-pandoc
[[ -w static-pandoc ]] && cp -r $curdir/*(/) static-pandoc
for fic in $*; do
dst="static-pandoc/${fic:r}.html"
tmp=${fic:r}.$$.${fic:e}
{
echo "% ${fic:r}"
echo "% Yann Esposito"
echo "% $(date +'%d %h %Y')"
cat $fic
} > $tmp
pandoc -s -S --template $curdir/boilerplate.html $tmp > $dst
\rm -f $tmp
done
print -- "results are in static-pandoc/"