10 chomp; # strip record separator
11 s/([^\\](\\\\)*)\\\".*/$1/g;# strip comments
16 print htmlify($_), "\n";
24 $a[3] = htmlify($a[3]);
25 print "<title>$a[2] : $a[3]</title><h1>$a[2] : $a[3]</h1>\n";
31 $a[2] = htmlify($a[2]);
32 print "<samp>[##:##] Command : </samp><KBD>$a[2]</KBD><p>\n";
37 my $str = htmlify(join(' ',@a[2..$#a]));
38 print "<br><samp>[##:##] Command : </samp><kbd>$str</kbd><p>\n";
42 if ($a[1] =~ /^LV?$/) {
44 $a[2] = htmlify($a[2]);
45 print "<h2>$a[2]</h2>\n";
49 if ($a[1] =~ "eo") { $esc = 0; next line; }
50 if ($a[1] =~ "ec") { $esc = $#a == 1 ? "\\" : $a[2]; next line; }
52 if (/^\.(NF|nf)/) { printf (("<p><pre>\n")); next line; }
53 if (/^\.(FI|fi)/) { printf (("</pre><p>\n")); next line; }
54 if (/^\.s3/) { printf (("<p>\n")); next line; }
55 if (/^\.s1/) { printf (("<hr> \n")); next line; }
56 if (/^\.br/) { printf "<br>\n"; next line; }
60 @a = split(/[\: \"\,\.]+/, $a[2]);
64 print "<p>See also : ", join("\n, ", @a), "\n";
67 # ignore unknown request
72 if (/^([\.\'])[ \t]*([^ ]+) *(.*)/) {
75 while (/(\"((\\.|[^\\\"])*)(\"|$))|(([^ ]|\\.)+) */g) {
85 warn "extra arguments for $a[1] ignored" if $#a > $n+1;
86 warn "missing arguments for $a[1] supplied" if $#a < $n+1;
95 # FIXME don't create dangling links here
96 return "<a href=\"$_.html\">$_</a>";
99 # Translate HTML special characters into escape sequences
102 die "funny escape character `$esc' not supported"
103 if $esc && $esc ne "\\";
104 # translate some troff escapes
105 s/\\&//g if $esc; # zero width space character
106 # escape HTML special characters
110 return $_ unless $esc;
111 # translate more troff escapes
112 s/\\e/&\#92;/g; # escape character
113 # turn quoted strings that look like info names into links
115 while (/(\\\*Q)([A-Za-z0-9\-\.]+)(\\\*U)/) {
116 $_ = $` . anchor($2) . "$'";
118 while (/(\"info )([A-Za-z0-9\-\.]+)/) {
119 $_ = "$`\"info " . anchor($2) . "$'";
121 # tranlate more troff escapes and strings
125 s/\\fR/<\/em><\/em>/g;
127 s/\\fP/<\/strong><\/em>/g;
128 s/\\\*\(bF/<strong>/g; # bold font
129 s/\\\*\(pF/<\/strong><\/em>/g; # pica font
130 s/\\\*\(nF/<\/strong><\/em>/g; # normal font
131 s/\\\*\(iF/<em>/g; # italic font
132 s/\\\(mu/x/g; # multiply symbol
133 s/\\ / /g; # non breaking space