cvsuser 01/11/24 10:52:23
Modified: P5EEx/Blue Makefile.PL
Added: P5EEx/Blue/htdocs style.css
P5EEx/Blue/htdocs/images logo.gif
P5EEx/Blue/sbin perldoc
Log:
added working version of 'perldoc'
Revision Changes Path
1.3 +20 -8 p5ee/P5EEx/Blue/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/Makefile.PL,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- Makefile.PL 2001/11/22 05:16:58 1.2
+++ Makefile.PL 2001/11/24 18:52:23 1.3
@@ -1,6 +1,6 @@
######################################################################
-## File: $Id: Makefile.PL,v 1.2 2001/11/22 05:16:58 spadkins Exp $
+## File: $Id: Makefile.PL,v 1.3 2001/11/24 18:52:23 spadkins Exp $
######################################################################
use ExtUtils::MakeMaker;
@@ -81,15 +81,27 @@
WriteMakefile(%opts);
sub MY::postamble {
- return <<'EOF';
+ my ($pmlibdirs);
+ $pmlibdirs = $opts->{PMLIBDIRS};
+ $pmlibdirs = $opts->{DISTNAME} if (!defined $pmlibdirs); # a good guess?
+ $pmlibdirs = "" if (!defined $pmlibdirs);
+ $pmlibdirs = join(",", @$pmlibdirs) if (ref($pmlibdirs) eq "ARRAY");
+
+ return <<EOF;
+
all ::
- bin/modify_pod_html dir=htdocs/P5EEx docroot=/pub/p5ee/software/htdocs
- @#rm -f $(INSTALLHTMLSCRIPTDIR)/cgi.conf
- @#mkdir -p $(INSTALLHTMLSCRIPTDIR)
- @#echo "perlinc = $(INSTALLPRIVLIB)" > $(INSTALLHTMLSCRIPTDIR)/cgi.conf
- @#echo "templatedir = $(INSTALLSCRIPT)" >> $(INSTALLHTMLSCRIPTDIR)/cgi.conf
- @#[ -f $(PREFIX)/.prefixvars ] && cat $(PREFIX)/.prefixvars >>
$(INSTALLHTMLSCRIPTDIR)/cgi.conf
+ \@sbin/perldoc \\
+ dir=htdocs/P5EEx \\
+ docroot=/pub/p5ee/software/htdocs \\
+ distname=\$(DISTNAME) \\
+ version=\$(VERSION) \\
+ pmlibdirs=$pmlibdirs
+ \@#rm -f \$(INSTALLHTMLSCRIPTDIR)/cgi.conf
+ \@#mkdir -p \$(INSTALLHTMLSCRIPTDIR)
+ \@#echo "perlinc = \$(INSTALLPRIVLIB)" > \$(INSTALLHTMLSCRIPTDIR)/cgi.conf
+ \@#echo "templatedir = \$(INSTALLSCRIPT)" >> \$(INSTALLHTMLSCRIPTDIR)/cgi.conf
+ \@#[ -f \$(PREFIX)/.prefixvars ] && cat \$(PREFIX)/.prefixvars >>
\$(INSTALLHTMLSCRIPTDIR)/cgi.conf
EOF
}
1.1 p5ee/P5EEx/Blue/htdocs/style.css
Index: style.css
===================================================================
/* this seems to be the standard style for perl.org - SPA 2001-11-15 */
/* because netscape 4 doesn't inherit from the body class we need to specify
everything?!, gaah ... */
body, table, td, p, span, h1, h2, h3, ul {
background-color: white;
color: black;
font-size: 10pt;
font-family: Verdana, Helvetica, Arial, Univers, sans-serif
}
span.comments { font-size: 80% }
h1 { font-size: 155%; font-weight: bold; }
h2 { font-size: 125%; font-weight: bold;}
h3 { font-weight: bold; }
/* table { color: red; } */
a:link { color: #690020 }
a:active { color: #003600 }
a:hover { color: #696040 }
a:vlink { color: #900000 }
.tt { color: black; font-family: Courier }
/* this ought to remove the link color */
.invisible { color: #ffffff; font-size: 10% }
1.1 p5ee/P5EEx/Blue/htdocs/images/logo.gif
<<Binary file>>
1.1 p5ee/P5EEx/Blue/sbin/perldoc
Index: perldoc
===================================================================
#!/usr/local/bin/perl
# bin/modify_pod_html dir=htdocs/P5EEx docroot=/pub/p5ee/software/htdocs
%opt_descriptions = (
'dir' => "Directory to correct outputted HTML POD documentation",
'docroot' => "Base of URL tree (corresponding to 'dir' in the directory tree)",
'distname' => "Distribution name",
'version' => "Distribution version",
'pmlibdirs' => "Directories to scan for .pod and .pm source files",
);
%opts = (
'dir' => "htdocs",
'docroot' => "/",
);
if ($#ARGV == -1) {
print STDERR "Usage: $0 [options]\n";
foreach $option (sort keys %opt_descriptions) {
printf STDERR " %-12s %s\n", "$option:", $opt_descriptions{$option};
}
exit (1);
}
foreach $arg (@ARGV) {
if ($arg =~ /^([^=]+)=(.*)/) {
$var = $1;
$value = $2;
}
else {
$var = $arg;
$value = 1;
}
$opts{$var} = $value;
}
$docroot = $opts{docroot};
$dir = $opts{dir};
# replace this with the Perl version of "find" someday
open (FIND, "find $dir -name '*.html' -print |") || die "Unable to get file list:
$!\n";
@htmlfiles = <FIND>;
close(FIND);
chomp(@htmlfiles);
foreach $htmlfile (@htmlfiles) {
$modified = 0;
$html = &read_file($htmlfile);
if ($html !~ m!HREF="$docroot/! &&
$html =~ s!HREF="/!HREF="$docroot/!g) {
$modified = 1;
}
$unmodified_head = <<EOF;
<HTML>
<HEAD>
<TITLE>([^<>]*)</TITLE>
<.*>
</HEAD>
<BODY>
EOF
if ($html =~ m/^$unmodified_head/) {
$title = $1;
$modified_head = <<EOF;
<HTML>
<HEAD>
<TITLE>$title</TITLE>
<link rel="stylesheet" type="text/css" href="$docroot/style.css">
</HEAD>
<BODY bgcolor="white" link="#690020" alink="#003600" vlink="#900000">
<table border="0" cellspacing="0">
<tr>
<td><img src=$docroot/images/logo.gif></td>
<td><h1>$title</h1></td>
</tr>
</table>
EOF
$html =~ s!^$unmodified_head!$modified_head!s;
$modified = 1;
}
if ($modified) {
print "Modified $htmlfile...\n";
&write_file($htmlfile,$html);
}
}
sub read_file {
my ($file) = @_;
local(*FILE);
my ($data, @data);
$data = "";
if (open(FILE, "< $file")) {
@data = <FILE>;
$data = join("", @data);
close(FILE);
}
$data;
}
sub write_file {
my ($file, $data) = @_;
local(*FILE);
if (open(FILE, "> $file")) {
print FILE $data;
close(FILE);
}
}