Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / local / FAQ2HTML
1 #!/usr/bin/perl -w
2
3 $TOCHEADER=" TABLE OF CONTENTS";
4
5 open(O, ">FAQ.html");
6 print O "<body bgcolor=\"#ffffff\" background=\"ucd-snmp-bg3.gif\">
7 <title>NET-SNMP FAQ</title>
8 <div align=center>
9 <h1>Frequently Asked Questions (FAQ) for the Net-SNMP package</h1>
10 FAQ Maintainer: Dave Shield<br>
11 Email: <a href=\"mailto:net-snmp-coders\@lists.sourceforge.net\">net-snmp-coders\@list.sourceforge.net</a><br>
12 </div>
13 <hr>
14 <h2>Table of Contents</h2>\n";
15
16 while(<>) {
17     last if (/$TOCHEADER/);
18 }
19
20 while(<>) {
21     last if (/^\s*$/);
22     chomp();
23     if (/^     */) {
24         # continuation of the question.
25         print O "<a href=\"#$x\">$_</a>\n";
26         next;
27     }
28     $_ =~ s/^ *//;
29     $x = $_;
30     $x =~ s/^ *//g;
31     $x =~ s/[^a-zA-Z]/_/g;
32     $xlate{$_} = $x;
33     if (/^[ A-Z]+$/) {
34         print O "</ul><li><b>$_</b><ul>\n";
35     } else {
36         print O "<li> <a href=\"#$x\">$_</a>\n";
37     }
38 }
39
40 print O "</ul><hr><pre>\n";
41
42 while(<>) {
43     $y = $_;
44     chomp($y);
45     if (defined($xlate{$y})) {
46         print O "<a name=\"$xlate{$y}\">\n";
47     }
48     print O $_;
49 }
50
51 $dt = localtime(time());
52 print O "</pre><hr>
53 Last modified: $dt\n";