#! /bin/sh
# **************************************************************************
# assemble.sh -- assemble a GNU Autoconf Web Page from its templates
#

me=assemble.sh

target=$1
case $1 in
--help | -h )
  ;;
index )
  subtitle="Overview"
  ;;
docs )
  subtitle="Documentation"
  ;;
download | devel | faq )
  ;;
"" | *)
  echo >&2 "$me: error: no such target"
  exit 1
  ;;
esac

date=`date "+%d %b %Y"`
user=`id -un`

# this is substituted so you can't read it in the template
warning="This file is autogenerated - edit the sources instead."

m4 -Dhtmltarget=$target -Dsubtitle="$subtitle" src/basics.m4 src/template.in | sed "\
s/@date@/$date/g;
s/@user@/$user/g;
s/@warning@/$warning/g;
" >$target.html

