ykeynote/example/gen

31 lines
563 B
Text
Raw Normal View History

2013-01-07 13:18:37 +00:00
#!/usr/bin/env zsh
# get script directory
if [[ ${0[0]} = '/' ]]; then
scriptdir="${0:h}"
else
scriptdir="$PWD/${0:h}"
fi
cd $scriptdir
# Convert all slides from markdown
for slide in **/*.md(.N); do
pandoc -f markdown -t html $slide > ${slide:r}.html
done
name=${PWD:t}
{
cat head.html
for slide in **/*.html(.N); do
case $slide in
head.html|tail.html) continue
esac
print -- '<section class="slide">'
cat $slide | sed 's#&amp;#<span class="and">&</span>#g'
print -- '</section>'
done
cat tail.html
} > ../$name.html