#!/usr/local/bin/perl # Time-stamp: "2005-08-19 01:25:00 ADT" sburke@cpan.org # desc{ browse ircII docs as HTML } # ------------------------------------------------------------ # This package is Copyright 1996- by Sean M. Burke, sburke@cpan.org # # irc2html # # Synopsis: # irc2html is a CGI script which makes ircII documentation files # readable thru a hypertext interface, thru the Web. # # Author: # Sean M. Burke, sburke@cpan.org # # Requirements, Bugs, and Caveats: # You have to have the ircII docs on the same filesystem as the httpd. # You have to configure the following variables, marked "Config" # # Availability & Copying: # # irc2html is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # irc2html is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # To see a copy of the GNU General Public License, see # http://www.ling.nwu.edu/~sburke/gnu_release.html, or write to the # Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # ------------------------------------------------------------ ############################## CONFIG ############################## $my_url_path= $ENV{'SCRIPT_NAME'} . '/'; #path to this cgi-bin script, plus a slash $about_path='http://www.ling.nwu.edu/~sburke/irc2html.html'; #path to more info on these docs $irc_help_path='/home/babel/sburke/.bin/IRC/help/'; #path to the IRC docs. Must be slash-terminated $up_button = "[Up to Main]
"; #what to print as a button to go to the root of the help tree $tag = "[More] about these docs
sburke\@cpan.org"; #### End of config ######################################################### # #don't mess with these @rfc882_months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); @rfc882_days = ( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ); $file2get = $ENV{'PATH_INFO'}; # PATH_INFO is what's after the script name in a URL in the form # http://machine/aliaspath/thisscript/foo/bar/baz # There, for example, it'd be /foo/bar/baz $file2get =~ s/^\///; #pull slash off the front $file2get =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; #unpack any %-quoting $literal_file2get = $irc_help_path . $file2get; if (-d $literal_file2get) { $file2get .= '/' if ($file2get ne '' && $file2get =~ /[^\/]$/); # add a slash if it's not already there $top = $file2get eq '/' || $file2get eq '' ? 1 : 0; if (opendir(DIR,$literal_file2get)) { print "Content-type: text/html\nLast-Modified: " . &last_revised($literal_file2get) . "\n\n"; if ($top) { print <<"EOF"; Documentation for ircII

Documentation for ircII

Choose from these subsections: