10 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n";
11 print " \"http://www.w3.org/TR/html4/strict.dtd\">\n";
16 chomp; # strip record separator
17 s/([^\\](\\\\)*)\\\".*/$1/g; # strip comments
22 while ($_ =~ /[A-Za-z0-9\-\.]+/g) {
28 print htmlify($_), "\n";
36 $a[3] = htmlify($a[3]);
37 print "<title>$a[2] : $a[3]</title>\n";
40 print "<h1>$a[2] : $a[3]</h1>\n";
47 $a[2] = htmlify($a[2]);
48 print "<samp>[##:##] Command : </samp><KBD>$a[2]</KBD><p>\n";
53 my $str = htmlify(join(' ',@a[2..$#a]));
54 print "<br><samp>[##:##] Command : </samp><kbd>$str</kbd><p>\n";
60 print "<br>" . anchor("$`") . " $'\n";
64 if ($a[1] eq "eo") { $esc = 0; next line; }
65 if ($a[1] eq "ec") { $esc = $#a == 1 ? "\\" : $a[2]; next line; }
67 if ($a[1] =~ /NF|nf/i) { $dome = 1; printf (("<p><pre>\n")); next line; }
68 if ($a[1] =~ /FI|fi/i) { $dome = 0; printf (("</pre><p>\n")); next line; }
69 if ($a[1] eq "s1") { printf (("<hr><p>\n")); next line; }
70 if ($a[1] eq "br") { printf "<br>\n"; next line; }
74 @a = split(/[\: \"\,\.]+/, $a[2]);
78 print "<p>See also : ", join("\n, ", @a), "\n";
81 # ignore unknown request
89 if (/^([\.\'])[ \t]*([^ ]*) *(.*)/) {
92 while (/\G(\"((\\.|[^\\\"])*)(\"|\Z))|\G(([^ ]|\\.)+) */g) {
102 warn "extra arguments for $a[1] ignored" if $#a > $n+1;
103 warn "missing arguments for $a[1] supplied" if $#a < $n+1;
112 # FIXME don't create dangling links here
113 return "<a href=\"$_.html\">$_</a>";
116 # Translate HTML special characters into escape sequences
119 die "funny escape character `$esc' not supported"
120 if $esc && $esc ne "\\";
121 # translate some troff escapes
122 s/\\&//g if $esc; # zero width space character
123 # escape HTML special characters
129 return $_ unless $esc;
130 # translate more troff escapes
131 s/\\e/&\#92;/g; # escape character
132 # turn quoted strings that look like info names into links
134 while (/(\\\*Q)([A-Za-z0-9\-\.]+)(\\\*U)/) {
135 $_ = $` . anchor($2) . "$'";
137 while (/(\"info )([A-Za-z0-9\-\.]+)/) {
138 $_ = "$`\"info " . anchor($2) . "$'";
140 # tranlate more troff escapes and strings
144 s/\\fR/<\/em><\/em>/g;
146 s/\\fP/<\/strong><\/em>/g;
147 s/\\\*\(bF/<strong>/g; # bold font
148 s/\\\*\(pF/<\/strong><\/em>/g; # pica font
149 s/\\\*\(nF/<\/strong><\/em>/g; # normal font
150 s/\\\*\(iF/<em>/g; # italic font
151 s/\\\(mu/x/g; # multiply symbol
152 s/\\ / /g; # non breaking space