4 # Copyright Andrew M. Bishop 1996.97,98,2001,03.
6 # Usage: FAQ-html.pl < FAQ > FAQ.html
14 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
18 print "<TITLE>$first</TITLE>\n";
23 print "<h1>$first</h1>\n";
39 next if ($_ eq "--------------------");
40 $pre++,$blank=0,next if($pre==1 && $_ eq "");
41 $blank=1,next if($pre!=1 && $_ eq "");
44 if ($_ eq "--------------------------------------------------------------------------------")
46 $pre=0,print "</pre>\n" if($pre);
48 $answers++ if( $answers);
49 $questions=0,$answers=1 if( $questions);
50 $questions=1 if(!$questions && !$answers);
52 elsif (m/^(Section [0-9]+)/)
57 $pre=0,print "</pre>\n" if($pre);
58 print "<p><b><a href=\"#$section\">$_</a></b>\n" if($questions);
59 print "<h2><a name=\"$section\">$_</a></h2>\n" if($answers);
61 elsif (m/^(Q [0-9]+.[0-9]+[a-z]*)/)
66 $blank=0,$pre=0,print "</pre>\n" if($pre);
67 print "<p><a href=\"#$question\">$_</a>\n" if($questions);
68 print "<h3><a name=\"$question\">$_</a></h3>\n" if($answers);
69 $pre=1,print "<pre>\n" if($answers);
71 elsif (m/\((See Q [0-9]+.[0-9]+[a-z]*)\)/)
73 $question = substr($1,4);
77 s
%$1%<a href
="#$question">$href</a
>% if($answers);
80 elsif (m
%(^|[^\'\"])(http
://[A
-Za
-z0
-9-_
.]+/[/A
-Za
-z0
-9-_
.~]*)%)
84 s
%$2%<a href
="$href">$href</a
>%;
89 $blank=0,print "\n" if($blank);