#!/bin/sh

# Rebuild NoSQL html pages and PostScript manual
# from the SGML source file.

# Prevent gross mistakes.
which sgml2html || exit 1

echo 'Building the HTML pages from the SGML source file ...'
sgml2html --charset=latin NoSQL.sgml
echo 'Setting page background colors ...'
for i in *.html
do
   printf '1,$s/^<BODY>/<BODY BGCOLOR="#fff0e0">/\nw\nq\n' | ed -s $i
done

printf '1,$s/^<H1>NoSQL<\\/H1>/<IMG SRC="NoSQL.png" ALT="[NoSQL]"><\\/IMG><H1>NoSQL<\\/H1>/\nw\nq\n' | ed -s NoSQL.html

# Built the PostScript manual as well.

# Prevent gross mistakes.
which sgml2latex || exit 1

echo 'Building the PostScript manual from the SGML source file ...'
sgml2latex --charset=latin --papersize=a4 --output=ps NoSQL.sgml

# End of file.
