#!/bin/csh -f

# For each .html file in the argument list, create content that can be
# used for a <!-- incite --> construct based on bibliographic
# information for the key extracted from the file name.

set debug = 1

foreach fullfile ($*)
  set dir = $fullfile:h
  set fullfiletail = $fullfile:t
  if ($dir == $fullfiletail)  set dir = .
  set key = $fullfiletail:r
  if ($debug) echo htmlincite:  fullfile: $fullfile fullfiletail: $fullfiletail
  if ($debug) echo htmlincite:  dir: $dir key: $key
  del $dir $fullfiletail
  echo "Generating $fullfile ..."
  htmlcite $key > $fullfile
#  echo '<\!--#include virtual="/~rig/cgi-bin/avail/'"$file.{fulltext,abstract}"'" -->'\
#    >> $fullfile.html
end
