head     1.4;
branch   ;
access   ;
symbols  ;
locks    perlman:1.4; strict;
comment  @# @;


1.4
date     96.06.26.11.25.56;  author perlman;  state Exp;
branches ;
next     1.3;

1.3
date     96.06.19.13.53.42;  author perlman;  state Exp;
branches ;
next     1.2;

1.2
date     96.06.19.12.57.40;  author perlman;  state Exp;
branches ;
next     1.1;

1.1
date     96.06.16.22.51.00;  author perlman;  state Exp;
branches ;
next     ;


desc
@@


1.4
log
@*** empty log message ***
@
text
@#! /bin/ksh

. functions
PGM=$0

category=$1; shift
catrec=`sssearch "type=pub&category=$category" pubs.db`
pagename="`echo "$catrec" | ssformat -t %title`"
sortkeys=`echo "$catrec" | ssformat -t %sortkeys`
tabent=`echo "$catrec" | ssformat -t %tabent`   # summary in category page
summary=`echo "$catrec" | ssformat -t %summary` # summary inside pub page

#-----------------------------------------------------------------------------
function genitem # generate page for one item
{
	# read in record from $category.db and assign to shell variables
	record=`sssearch acmordernumber=$1 $category.db`
	tmp=`genfields $category.db`
	. $tmp
	rm $tmp

	genheader "$title" "$url" "$pagename"
	gencomment This page generated `date` by $0 in $PGM

	echo "<dl>"
	if test "$editor"
	then
		echo "<dt>Edited by:<dd>"
		echo "$editor" | genname 
	fi
	if test "$author"
	then
		echo "<dt>Written by:<dd>"
		echo "$author" | genname 
	fi
	echo "</dl>"

	echo "<table border=1>"
	echo "<tr>"

		if test "$imagesmall"
		then
			echo "<td rowspan=20 valign=top>"
			if test "$imagelarge"
			then
				echo "<a href=$imagelarge>"
			fi
			echo "<img src=$imagesmall><br>"
			if test "$imagelarge"
			then
				echo "</a>"
			fi
		fi

		echo "$summary" |
			while read line
			do
				gentabent $line
			done

	echo "</table>"

	if test "$desc"
	then
		echo "<p>"
		echo "$desc"
	fi

	if test "$contents"
	then
		echo "<p>"
		echo "<b>Contents</b><br>"
		firstchar=${contents%${contents#?}}
		if test "$firstchar" != "<" # not HTML tagged
		then
			echo "<pre>"
			echo "$contents" | expand -3
			echo "</pre>"
		else
			echo "$contents"
		fi
	fi
	genfooter $category

}


#-----------------------------------------------------------------------------
# Executable Section

if test "$*"
then
	items="$*"
	nitems=$#
else
	items=`sssort -f "$sortkeys" $category.db | ssformat -t %acmordernumber`
	nitems=`echo $items | wc -w`
fi

for item in $items
do
	echo $item > /dev/tty
	genitem $item > $item.html
done
@


1.3
log
@*** empty log message ***
@
text
@d4 1
d6 1
a6 2
category=$1
DB=$category.db
d16 3
a18 2
	record=`sssearch acmordernumber=$1 $DB`
	tmp=`genfields $DB`
d23 1
d83 1
a83 1
	genfooter
d91 8
a98 2
items=`sssort -f "$sortkeys" $DB | ssformat -t %acmordernumber`
nitems=`echo $items | wc -w`
@


1.2
log
@*** empty log message ***
@
text
@d21 1
a21 1
	genheader "$pagename: $title" "$url"
@


1.1
log
@Initial revision
@
text
@d8 1
a8 2
pagename="ACM SIGCHI `echo "$catrec" | ssformat -t %title`"
pagedesc=`echo "$catrec" | ssformat -t %desc`
d10 2
a11 2
tabent=`echo "$catrec" | ssformat -t %tabent`
summary=`echo "$catrec" | ssformat -t %summary`
a13 18
function genpage # generate page of items
{
genheader "$pagename"

echo "<h2>$pagename</h2>"

echo "$pagedesc"
echo "<p>"

echo "<table border=2>"
sssort -f "$sortkeys" $DB |
	genrecord |
		ssformat -t "$tabent"
echo "</table>"
genfooter
}

#-----------------------------------------------------------------------------
d21 1
a21 1
	genheader "$pagename: $title"
a22 12
	echo "<h2>"
	if test "$url"
	then
		echo "<a href=$url>"
	fi
	echo "$title"
	if test "$url"
	then
		echo "</a>"
	fi
	echo "</h2>"

d36 1
a36 1
	echo "<table>"
d39 1
a39 4
	if test "$imagesmall"
	then
		echo "<td valign=top>"
		if test "$imagelarge"
d41 10
a50 1
			echo "<a href=$imagelarge>"
a51 7
		echo "<img src=$imagesmall><br>"
		if test "$imagelarge"
		then
			echo "</a>"
		fi
	fi
	echo "<td valign=top>$desc"
d53 6
d61 5
a65 8
	echo "<p>"
	echo "<center>"
	echo "<table border=1>"
	echo "$summary" |
		while read line
		do
			gentabent $line
		done
a66 3
	echo "</table>"
	echo "</center>"

d71 9
a79 1
		echo "$contents"
a87 2

genpage > $category.html
@
