3 @longmonth = ( "January", "February", "March", "April", "May", "June", "July",
4 "August", "September", "October", "November", "December" );
19 my ($match, $reset) = @_;
22 while (!(/$match/i)) {
23 chomp($_ .= " " . <>);
37 ($mday, $mon, $year) = (localtime(time))[3 .. 5];
38 $date = sprintf "%s %02d, %d", $longmonth[$mon], $mday, $year + 1900;
43 ($name, $descr) = split(' ', $_, 2);
44 $descr =~ s/^\s*-\s*//;
45 ($NAME = $name) =~ tr/a-z/A-Z/;
49 .\\" Converted from HTML to mandoc by ntp-html2mdoc.pl
66 while ($_ = shift @args) {
70 if (defined($args[0]) && $args[0] ne "]") {
71 print " Ar ", shift @args;
74 shift @args; # remove the "]"
94 print ".Sh AUTHOR\n$_\n";
98 print ".Bl -tag -width indent\n";
115 # command line option
117 s
#<TT>-([^<]*)#\n.Fl $1\n#ig;
119 s
#<I>([^<]+)</I>#\n.Ar $1\n#ig;
122 # html reference to another ntp page
124 chomp($_ .= " " . <>) if (/<A$/); # another reference on the next line
125 s
#<TT><A HREF="(.*).htm">\1</A></TT>#\n.Xr \1 $sec\n#ig;
126 s
#<A HREF="([^"]*)">(.*?) +</A> *page#\n.%T "$2"\npage in\n.Pa /usr/share/doc/html/ntp/$1\n#ig;
128 s
#<A HREF="([^"]*)">(.*?)</A>#For\n.%T "$2"\n, refer to\n.Pa /usr/share/doc/html/ntp/$1 .\n.Pp\n#ig;
131 s
#<TT>$name</TT>#\n.Nm\n#ig;
132 s
#<TT>([^<]*)</TT>#\n.Pa $1\n#ig;
133 s
#<TT><A HREF=[^>]*>([^<]*)</A></TT>#\n.Pa $1\n#ig;
134 s
#<PRE>#.Pp\n.nf\n#ig;
135 s
#</PRE>#\n.fi\n.Pp\n#ig;
138 s
#</(BODY|HTML|DD)>##ig;
139 s
#<I>([^<]+)</I>#\n.Ar $1\n#ig;
143 s/\n\.(Pa|%T) (.*)\n([,\.:]) /\n.$1 $2 $3\n/g;
146 print $_, "\n" if length > 0;