#!/bin/sh
#
# Produce GIFs and thumbnails for all .htm files (ploticus scripts)

echo "Running ploticus to produce GIFs and thumbnails for all gallery examples.."
echo "Checking to see if pl and pltab are in your command PATH.."
which pl
which pltab
echo "Continue? (y/n)  \c"
read ANS
if [ "$ANS" != "y" ]; then
  exit 1
fi

for i in *.htm
do
  echo "$i"
  BASENAME=`echo $i | sed "s/.htm$//"`
  pl -gif -tightcrop $i
  pl -gif -scale 0.3 $i -o ../thumbnails/$BASENAME.gif
  pl -png -scale 0.3 $i -o ../thumbpng/$BASENAME.png
done

echo "Done"
