#!/bin/bash
# generate: make a code+pic document from a list of go files
monofont="Go-Mono" # "FiraMono-Regular"
sansfont="Go-Regular" # FiraSans-Regular"
gofiles=`cat list`
for i in $gofiles
do
	f=`basename $i .go`
	if test -a $f.png
	then
		if test $i -nt  $f.png
		then
			go run $i > $f.svg && svg2png $f.svg
		fi
	else
		go run $i > $f.svg && svg2png $f.svg
	fi
done
codepicdeck -title 'SVGo Examples' $gofiles | 
pdfdeck -pagesize 1200,900 -sans $sansfont -mono $monofont -stdout /dev/stdin > svgplay.pdf 
