#!/bin/sh
#
#	html2txt - convert an HTML document to text
#	AYM 2005-08-28
#

if [ "$#" != 1 ]
then
  echo "Usage: html2txt file" >&2
  exit 1
fi

set -e
echo 'THIS IS A GENERATED FILE -- DO NOT EDIT !'
printf 'Edit %s instead.\n\n' "$1"
# First time is to catch errors
links -dump-width 87 -dump "$1" >/dev/null
links -dump-width 87 -dump "$1" | sed 's/^   //; s/^         //'
