# Backend to convert something into ASCII text
# Send any comments to Eric Bischoff <eric@caldera.de>
# This program is under GPL license. See LICENSE file for details.

# Convert to HTML
$SGML_JADE -t sgml -V nochunks -o ${SGML_FILE_NAME}.html -d SGML_STYLESHEET $SGML_FILE
if [ $? -ne 0 ]
then exit 1
fi

# Convert from HTML to ASCII
lynx -force_html -dump ${SGML_FILE_NAME}.html > ${SGML_FILE_NAME}.txt
if [ $? -ne 0 ]
then
  rm ${SGML_FILE_NAME}.html
  exit 2
fi
rm ${SGML_FILE_NAME}.html

exit 0
