From b6fbf357b9e6a65b37a88792ddc198b947ce0eea Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Tue, 17 Jul 2007 17:54:01 +0000 Subject: [PATCH] print XHTML for help page print XHTML for apropos search minor bugfixes in XHTML output --- en/cgi/man.cgi | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/en/cgi/man.cgi b/en/cgi/man.cgi index 6a3c392ded..09a3eb18fb 100755 --- a/en/cgi/man.cgi +++ b/en/cgi/man.cgi @@ -33,7 +33,7 @@ # BSDI Id: bsdi-man,v 1.2 1995/01/11 02:30:01 polk Exp # Dual CGI/Plexus mode and new interface by sanders@bsdi.com 9/22/1995 # -# $Id: man.cgi,v 1.179 2007-07-16 17:48:29 wosch Exp $ +# $Id: man.cgi,v 1.180 2007-07-17 17:54:01 wosch Exp $ ############################################################################ # !!! man.cgi is stale perl4 code !!! @@ -43,7 +43,7 @@ $www{'title'} = 'FreeBSD Hypertext Man Pages'; $www{'home'} = 'http://www.FreeBSD.org'; $www{'head'} = $www{'title'}; -$command{'man'} = '/usr/bin/man'; # 8Bit clean man +$command{'man'} = '/usr/bin/man'; # 8Bit clean man # Config Options # map sections to their man command argument(s) @@ -620,6 +620,7 @@ sub apropos { $q =~ s/(\W)/\\W/g; local ($acounter) = 0; + print qq{
\n}; while () { next if !/$q/oi; $acounter++; @@ -632,9 +633,10 @@ sub apropos { ( $names, $msg ) = m/^(.*\))\s+-\s+(.*)/; print "
", &encode_data("$names"), "\n
", - &encode_data($msg), "\n"; + &encode_url($manpath), "\">", &encode_data("$names"), + "\n\n
", &encode_data($msg), "
\n"; } + print qq{
\n}; close(APROPOS); if ( !$acounter ) { @@ -642,7 +644,7 @@ sub apropos { print qq{You may look for other } . qq{FreeBSD Search Services.\n}; } - print "\n\n\n"; + print "\n\n\n"; } sub man { @@ -869,7 +871,7 @@ s/([a-z0-9_\-\.]+\@[a-z0-9\-\.]+\.[a-z]+)/$1<\/A>/gi; $i = $_; $j = &encode_url($i); $j =~ s/\+/_/g; - $_ = qq{$i}; + $_ = qq{$i\n}; push( @sect, $i ); } print; @@ -919,7 +921,7 @@ sub mlnk { local ($matched) = @_; local ( $link, $section ); ( $link = $matched ) =~ s/[\s]+//g; - $link =~ s/<\/?[IB]>//g; + $link =~ s/<\/?[IB]>//ig; ( $link, $section ) = ( $link =~ m/^([^\(]*)\((.*)\)/ ); $link = &encode_url($link); $section = &encode_url($section); @@ -1161,7 +1163,7 @@ ETX } sub copyright { - $id = '$Id: man.cgi,v 1.179 2007-07-16 17:48:29 wosch Exp $'; + $id = '$Id: man.cgi,v 1.180 2007-07-17 17:54:01 wosch Exp $'; return qq{\
@@ -1204,7 +1206,8 @@ sub faq {
         $url = &encode_url($_);
         push( @list,
                 qq{
  • [download]} - . qq{ "$_" -> $BASE?manpath=$url} ); + . qq{ "$_" -> $BASE?manpath=$url} + . qq{
  • \n} ); } foreach ( sort keys %manPathAliases ) { @@ -1212,11 +1215,11 @@ sub faq { qq[
  • "$_" -> "$manPathAliases{$_}" -> ] . "$BASE?manpath=" . &encode_url($_) - . "\n" ) + . "
  • \n" ) if $manPathAliases{$_}; } - local $id = '$Id: man.cgi,v 1.179 2007-07-16 17:48:29 wosch Exp $'; + local $id = '$Id: man.cgi,v 1.180 2007-07-17 17:54:01 wosch Exp $'; return qq{\
     Copyright (c) 1996-2007 Wolfram Schneider
    @@ -1250,19 +1253,19 @@ Copyright (c) for man pages by OS vendors.
     
     

    FAQ

      -
    • Get the source of the man.cgi script +
    • Get the source of the man.cgi script
    • Troff macros works only if defined in FreeBSD/groff. OS specific -macros like `appeared in NetBSD version 1.2' are not supported. -
    • Netscape is buggy, you may press twice the link 'Index Page and Help' +macros like `appeared in NetBSD version 1.2' are not supported.
    • +
    • Netscape is buggy, you may press twice the link 'Index Page and Help'
    • Some OSs provide only formated manual pages (catpages), e.g. NetBSD and OpenBSD. In this case it is not possible to create Postscript -and troff output. +and troff output.
    • The -Unix family tree, BSD part. +Unix family tree, BSD part.
    • The -FreeBSD Ports Changes script. +FreeBSD Ports Changes script.
    • Copyright (c) and download for man pages by -OS vendors +OS vendors

    Releases