Re: HTMLize a FAQ

---------

John Relph (relph@presto.ig.com)
Thu, 17 Nov 94 8:12:02 PST


Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de writes:
>
>What I do is that I maintain my FAQs in HTML, and use "lynx -dump" to
>run off an ASCII copy of them automatically, driven by a GNU Makefile
>called each night by cron.

>Makefile:
>
>%.faq: %.html %.head
> cp $*.head $*.faq
> /usr/local/bin/lynx -dump $*.html | sed -e 's/ *$$//' >> $*.faq
> chmod a+r $*.faq

My strategy is fairly similar, but I've also done a few things
differently because I want some text-specific indications. For
example, I deal a lot with album titles, so I use underscores "_" to
indicate underlined titles. Also, another person whose FAQ I
transform was using *word* to indicate emphasis, so I changed those to
<STRONG> HTML constructs in the base file, then transform them back
when the final text version is generated. Lastly, to make the final
text file RFC1153-compliant (perhaps someday I shall make it RFC1521-
compliant) I do a few simple transformations on dividing lines and
such. (Maybe I should re-do this whole thing in Perl someday.)

-- John

Makefile:

.SUFFIXES: .html

%:%.html
sed -e 's=</*I>=_=g' -e 's=</*STRONG>=\*=g' \
-e 's=<HR>=-------=' $< > temp.html
lynx -dump temp.html | tail +5 | \
sed \
-e 's/^ -------/----------------------------------------------------------------------/' \
-e 's/^ -------/------------------------------/' \
-e 's/ *$$//' -e 's/ //' | uniq > $@
$(RM) temp.html



[ Usenet Hypertext FAQ Archive | Search Mail Archive | Authors | Usenet ]
[ 1993 | 1994 | 1995 | 1996 | 1997 ]

---------

faq-admin@landfield.com

© Copyright The Landfield Group, 1997
All rights reserved