aboutsummaryrefslogtreecommitdiffstats
path: root/html2txt.sh
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2004-06-19 02:39:07 +0000
committerMatthias Andree <matthias.andree@gmx.de>2004-06-19 02:39:07 +0000
commitf4f4b5ff37b19df733987670a5689e3f49de55ca (patch)
treeef8a15db67d348907cc4abc0e1701046d04fa313 /html2txt.sh
parent7127ff22e388f29f217f125ac9ef11dd4f5a84b4 (diff)
downloadfetchmail-f4f4b5ff37b19df733987670a5689e3f49de55ca.tar.gz
fetchmail-f4f4b5ff37b19df733987670a5689e3f49de55ca.tar.bz2
fetchmail-f4f4b5ff37b19df733987670a5689e3f49de55ca.zip
This is the large automake/gettext commit.
It cleans up the whole build system and drops generated files such as intl/ and some from po/. The package version is moved to configure.in. HTML -> txt conversion is now done in html2txt.sh To bootstrap the package, read README.svn, make sure you have all prerequisite packages installed, then run ./bootstrap.sh. svn path=/trunk/; revision=3907
Diffstat (limited to 'html2txt.sh')
-rwxr-xr-xhtml2txt.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/html2txt.sh b/html2txt.sh
new file mode 100755
index 00000000..c0543f17
--- /dev/null
+++ b/html2txt.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+# html2txt.sh - A program to convert fetchmail's HTML documentation to text
+# Copyright (C) 2004 Matthias Andree
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# --------------------------------------------------------------------------
+
+# Usage: html2txt.sh INPUT.html
+
+# --------------------------------------------------------------------------
+
+# Abort on error
+set -e
+
+# Parse arguments
+if [ $# -ne 1 ] ; then
+ echo >&2 "Usage: `basename $0 || echo $0` input.html"
+ exit 1
+fi
+
+# Pull in variables
+inp="$1"
+tmp="html2txt.$$.html"
+
+# now preprocess
+trap "rm -f \"$tmp\"" 0 1 2 3 15
+${AWK:=awk} '/<table .*summary="Canned/ { i=1; }
+ /<\/table>/ { i=0; }
+ { if (i == 0) print $0; }' "$inp" >"$tmp" <&-
+
+# and go!
+echo " (This file was generated from $inp)"
+lynx -dump -nolist "$tmp"
+rm -f "$tmp"
+trap "" 0 1 2 3 15