# manServer - Unix man page to HTML converter
# Rolf Howarth, rolf@squarebox.co.uk
# Version 1.07 16 July 2001
+# Version 1.07+ma1 2006-03-31 Matthias Andree
+# add trailing slash of URLs
+# support https, too
-$version = "1.07";
-$manServerUrl = "<A HREF=\"http://www.squarebox.co.uk/download/manServer.shtml\">manServer $version</A>";
+$version = "1.07+ma1";
+$manServerUrl = "<A HREF=\"http://www.squarebox.co.uk/users/rolf/download/manServer.shtml\">manServer $version</A>";
use Socket;
# Insert links for http, ftp and mailto URLs
# Recognised URLs are sequence of alphanumerics and special chars like / and ~
# but must finish with an alphanumeric rather than punctuation like "."
- s,\b(http://[-\w/~:@.%#+$?=]+\w),<A HREF=\"\1\">\1</A>,g;
+ s,\b(https?://[-\w/~:@.%#+$?=]+[\w/]),<A HREF=\"\1\">\1</A>,g;
s,\b(ftp://[-\w/~:@.%#+$?=]+),<A HREF=\"\1\">\1</A>,g;
s,([-_A-Za-z0-9.]+@[A-Za-z][-_A-Za-z0-9]*\.[-_A-Za-z0-9.]+),<A HREF=\"mailto:\1\">\1</A>,g;
sub initialise
{
+ # Determine groff version if possible
+ my $groffver = `groff -v`;
+ $groffver =~ /^GNU groff version (\S+)/;
+ $groffver = $1;
+
# Parse the macro definition file for section names
if (open(MACRO, "/usr/lib/tmac/tmac.an") ||
open(MACRO, "/usr/lib/tmac/an") ||
open(MACRO, "/usr/lib/groff/tmac/tmac.an") ||
+ open(MACRO, "/usr/lib/groff/tmac/an.tmac") ||
open(MACRO, "/usr/share/tmac/tmac.an") ||
- open(MACRO, "/usr/share/groff/tmac/tmac.an") )
+ open(MACRO, "/usr/share/tmac/an.tmac") ||
+ open(MACRO, "/usr/share/groff/tmac/tmac.an") ||
+ open(MACRO, "/usr/share/groff/tmac/an.tmac") ||
+ open(MACRO, "/usr/share/groff/$groffver/tmac/an.tmac") )
{
while (<MACRO>)
{