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 print htmlify($_), "\n" unless $ignore;
28 if ($a[1] eq "ig") { $ignore = 1; next line; }
30 $ignore = 0 if $a[1] eq "..";
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";
58 if ($a[1] =~ /^LV?$/) {
60 $a[2] = htmlify($a[2]);
61 print "<h2>$a[2]</h2>\n";
66 if ($a[1] eq "eo") { $esc = 0; next line; }
67 if ($a[1] eq "ec") { $esc = $#a == 1 ? "\\" : $a[2]; next line; }
69 if ($a[1] =~ /NF|nf/i) { printf (("<p><pre>\n")); next line; }
70 if ($a[1] =~ /FI|fi/i) { printf (("</pre><p>\n")); next line; }
71 if ($a[1] eq "s1") { printf (("<hr><p>\n")); next line; }
72 if ($a[1] eq "br") { printf "<br>\n"; next line; }
76 @a = split(/[\: \"\,\.]+/, $a[2]);
80 print "<p>See also : ", join("\n, ", @a), "\n";
83 # ignore unknown request
91 if (/^([\.\'])[ \t]*([^ ]*) *(.*)/) {
94 while (/\G(\"((\\.|[^\\\"])*)(\"|\Z))|\G(([^ ]|\\.)+) */g) {
104 warn "extra arguments for $a[1] ignored" if $#a > $n+1;
105 warn "missing arguments for $a[1] supplied" if $#a < $n+1;
114 # FIXME don't create dangling links here
115 return "<a href=\"$_.html\">$_</a>";
118 # Translate HTML special characters into escape sequences
121 die "funny escape character `$esc' not supported"
122 if $esc && $esc ne "\\";
123 # translate some troff escapes
124 s/\\&//g if $esc; # zero width space character
125 # 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