Front page | perl.cvs.p5ee |
Postings from April 2013
[svn:p5ee] r15616 - in p5ee/trunk/Devel-Perldocs: . bin lib/Devel
From:
spadkins
Date:
April 1, 2013 21:55
Subject:
[svn:p5ee] r15616 - in p5ee/trunk/Devel-Perldocs: . bin lib/Devel
Message ID:
20130401215511.7D53113FC9A@xx12.develooper.com
Author: spadkins
Date: Mon Apr 1 14:55:11 2013
New Revision: 15616
Modified:
p5ee/trunk/Devel-Perldocs/Makefile.PL
p5ee/trunk/Devel-Perldocs/bin/perldocs
p5ee/trunk/Devel-Perldocs/lib/Devel/Perldocs.pm
Log:
latest
Modified: p5ee/trunk/Devel-Perldocs/Makefile.PL
==============================================================================
--- p5ee/trunk/Devel-Perldocs/Makefile.PL (original)
+++ p5ee/trunk/Devel-Perldocs/Makefile.PL Mon Apr 1 14:55:11 2013
@@ -8,48 +8,28 @@
# the contents of the Makefile that is written.
my @bin_programs = qw(perldocs);
-my @cgibin_programs = qw();
+#my @cgibin_programs = qw();
%opts = (
- #'INSTALLDIRS' => 'perl',
'NAME' => 'Devel-Perldocs',
'DISTNAME' => 'Devel-Perldocs',
'VERSION' => '0.50',
- 'PL_FILES' => { (map {("cgi-bin/$_.PL" => "cgi-bin/$_")} @cgibin_programs) },
+ #'PL_FILES' => { (map {("cgi-bin/$_.PL" => "cgi-bin/$_")} @cgibin_programs) },
'EXE_FILES' => [ (map {"bin/$_"} @bin_programs) ],
- 'PREREQ_PM' => { # I haven't yet determined what the minimum versions should be
- #'Aspect' => 0, # used for debugging
- #'Class::MethodMaker' => 0, # [prereq for Aspect] auto-generate methods
- #'Compress::Zlib' => 0, # for compressed serialization and browser responses
- #'Data::Dumper' => 0, # used for debugging
- #'Date::Parse' => 0, # date support
- #'Date::Format' => 0, # date support
- #'Storable' => 0, # used for serialization everywhere
+ 'PREREQ_PM' => {
+ "App::Options" => 0, # used for configuration
+ "Date::Format" => 0,
+ "File::Basename" => 0,
+ "File::Path" => 0,
+ #"File::Spec" => 0,
+ #"FindBin" => 0,
+ "Devel::Metadata" => 0,
},
- 'clean' => { FILES => '$(EXE_FILES)' },
- #'linkext' => { LINKTYPE=>'' }, # no link needed
'dist' => {'COMPRESS'=>'gzip -9f', 'SUFFIX' => 'gz',
'ZIP'=>'/usr/bin/zip','ZIPFLAGS'=>'-rl'},
);
######################################################################
-# PREFIX
-######################################################################
-
-# I like setting the PREFIX variable in the environment,
-# so I write my Makefile.PL to use it as a valid alternative
-# to specifying it on the command line with
-# "perl Makefile.PL PREFIX=/usr/foo".
-
-if ($ENV{PREFIX}) {
- $PREFIX = $ENV{PREFIX};
- $opts{PREFIX} = $PREFIX;
-}
-else {
- $PREFIX = "/usr/local";
-}
-
-######################################################################
# MAKE THE MAKEFILE
######################################################################
Modified: p5ee/trunk/Devel-Perldocs/bin/perldocs
==============================================================================
--- p5ee/trunk/Devel-Perldocs/bin/perldocs (original)
+++ p5ee/trunk/Devel-Perldocs/bin/perldocs Mon Apr 1 14:55:11 2013
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl -w
=head1 NAME
@@ -7,8 +7,8 @@
=head1 SYNOPSIS
perldocs
- perldocs -lib=lib
- perldocs -lib=lib -targeturl=http://www.mycompany.com/doc/perl -targetdir=/var/apache/htdocs/doc/perl
+ perldocs --lib=lib
+ perldocs --lib=lib --targeturl=http://www.mycompany.com/doc/perl --targetdir=/var/apache/htdocs/doc/perl
=head1 DESCRIPTION
@@ -36,109 +36,56 @@
The program is run as
- perldocs [-opt=value]
+ perldocs [--opt=value]
where any number of options may be given, and the available options are
"dir", "docroot", "pmlibdirs", "distname", and "version".
- perldocs -dir=htdocs -docroot=/pub/p5ee/software/htdocs -pmlibdirs=P5EEx -distname=P5EEx-Blue -version=0.01
+ perldocs --dir=htdocs --docroot=/pub/p5ee/software/htdocs --pmlibdirs=P5EEx --distname=P5EEx-Blue --version=0.01
=cut
use strict;
-use Getopt::Long;
-use Devel::Perldocs;
+use App::Options (
+ options => [qw(distributions lib targetdir targeturl extsrcdir metadatadir verbose)],
+ option => {
+ distributions => {
+ default => "",
+ description => "List of distributions to document",
+ },
+ lib => {
+ default => "",
+ description => "Directory(ies) in which to search for Perl files (add to \@INC and PERL5LIB)",
+ },
+ targetdir => {
+ default => "$ENV{HOME}/public_html/perldocs",
+ description => "Directory in which to create the HTML documentation",
+ },
+ targeturl => {
+ default => "http://localhost/~user/perldocs",
+ description => "URL corresponding to 'targetdir'",
+ },
+ extsrcdir => {
+ default => "$ENV{HOME}/.perldocs/src",
+ description => "Directory in which to create extended sources",
+ },
+ metadatadir => {
+ default => "$ENV{HOME}/.perldocs/meta",
+ description => "Directory in which to cache Perl metadata",
+ },
+ verbose => {
+ default => 0,
+ description => "Generate more verbosely",
+ },
+ },
+);
-my $distributions = "";
-my $lib = "";
-my $targetdir = "$ENV{HOME}/public_html/perldocs";
-my $targeturl = "http://localhost/~user/perldocs";
-my $extsrcdir = "$ENV{HOME}/.perldocs/src";
-my $metadatadir = "$ENV{HOME}/.perldocs/meta";
-my $verbose = 0;
+use Devel::Perldocs;
{
- my %options = (
- 'distributions=s' => \$distributions,
- 'lib=s' => \$lib,
- 'targetdir=s' => \$targetdir,
- 'targeturl=s' => \$targeturl,
- 'extsrcdir=s' => \$extsrcdir,
- 'metadatadir=s' => \$metadatadir,
- 'verbose' => \$verbose,
- );
-
- my ($success, $option);
- $success = GetOptions (%options);
-
- my @options_sorted = (
- 'distributions',
- 'lib',
- 'targetdir',
- 'targeturl',
- 'extsrcdir',
- 'metadatadir',
- 'verbose',
- );
-
- my %opt_description = (
- 'distributions' => "List of distributions to document",
- 'lib' => "Directory(ies) in which to search for Perl files (add to \@INC and PERL5LIB)",
- 'targetdir' => "Directory in which to create the HTML documentation",
- 'targeturl' => "URL corresponding to 'targetdir'",
- 'extsrcdir' => "Directory in which to create extended sources",
- 'metadatadir' => "Directory in which to cache Perl metadata",
- 'verbose' => "Generate more verbosely",
- );
-
- if (!$success) {
- print STDERR "Usage: $0 [-option=value] [-verbose]\n";
- foreach $option (@options_sorted) {
- printf STDERR " -%-12s %s\n", "$option", $opt_description{$option};
- }
- exit (1);
- }
-
- &read_defaults(\%options);
- my %conf = (
- 'distributions' => $distributions,
- 'lib' => $lib,
- 'targetdir' => $targetdir,
- 'targeturl' => $targeturl,
- 'extsrcdir' => $extsrcdir,
- 'metadatadir' => $metadatadir,
- 'verbose' => $verbose,
- );
-
- my $pd = Devel::Perldocs->new(\%conf);
+ my $pd = Devel::Perldocs->new(\%App::options);
$pd->generate();
exit(0);
}
-sub read_defaults {
- my ($options) = @_;
- local(*FILE);
- my ($file, $data, @data, %vars, $key, $var);
- foreach $key (keys %$options) {
- $var = $key;
- $var =~ s/=.*//;
- $vars{$var} = $options->{$key};
- }
- $file = "$ENV{HOME}/.perldocs.conf";
- if (open(FILE, "< $file")) {
- while (<FILE>) {
- chomp;
- s/#.*$//;
- s/ +$//;
- s/^ +//;
- s/ *= */=/;
- next if (/^$/);
- if (/^([a-zA-Z0-9_]+)=?(.*)/) {
- ${$vars{$1}} = $2 if (defined $vars{$1});
- }
- }
- close(FILE);
- }
-}
-
Modified: p5ee/trunk/Devel-Perldocs/lib/Devel/Perldocs.pm
==============================================================================
--- p5ee/trunk/Devel-Perldocs/lib/Devel/Perldocs.pm (original)
+++ p5ee/trunk/Devel-Perldocs/lib/Devel/Perldocs.pm Mon Apr 1 14:55:11 2013
@@ -3,7 +3,7 @@
#############################################################################
## $Id$
#############################################################################
-## (c) 2002 Stephen Adkins <stephen.adkins@officevision.com>
+## (c) 2002 Stephen Adkins <spadkins@gmail.com>
## This is free software, available under the same terms as Perl itself.
#############################################################################
@@ -101,7 +101,9 @@
=head2 Frames and Navigation
-The "perldocs" output is inspired by (and similar to) the output of "javadoc".
+The "perldocs" output is inspired by (and similar to) the output of "javadoc",
+but its capabilities are customized particularly to the needs of Perl and of
+CPAN.
The standard view is from a web browser using HTML frames.
Two frames on the left assist in navigation, while the main frame on the right
@@ -335,13 +337,13 @@
package Devel::Perldocs;
use strict;
+use warnings;
use Date::Format;
use File::Basename;
use File::Path qw(mkpath);
-
-use FindBin qw($Bin);
use Devel::Metadata;
+use Pod::Html;
# a token constructor.
# they're all static/module methods anyway.
@@ -355,13 +357,16 @@
$self->{conf} = $conf;
$self->set_defaults();
+ my $verbose = $conf->{verbose};
+
if ($conf->{lib}) {
unshift(@INC, split(/[, ]+/, $conf->{lib}));
}
- open(STDERR, "> perldocs.log");
- my $dmd = Devel::Metadata->new();
+ #open(STDERR, "> perldocs.log");
+ my $dmd = Devel::Metadata->new($conf);
$self->{metadata} = $dmd;
+ print "Metadata read...\n" if ($verbose);
my ($distributions, $distribution, @distributions, @modules);
@@ -376,6 +381,14 @@
push(@distributions, "unknown");
$self->{distributions} = \@distributions;
}
+ if ($verbose) {
+ my $num_distributions = $#distributions + 1;
+ my $dist_list = join(" ", @distributions);
+ if (length($dist_list) > 80) {
+ $dist_list = substr($dist_list, 0, 80) . "...";
+ }
+ print "$num_distributions Distributions Found: [$dist_list]\n";
+ }
if ($#distributions > -1 && $distributions[0] eq "site") {
@modules = $dmd->modules();
@@ -396,7 +409,7 @@
$conf = $self->{conf} if (!$conf && ref($self));
return if (!$conf);
my $username = getpwuid($<);
- $conf->{config} ||= "$ENV{HOME}/.perldocs.conf";
+ #$conf->{config} ||= "$ENV{HOME}/.perldocs.conf";
$conf->{lib} ||= "";
$conf->{installed} ||= 1;
$conf->{method} ||= "standard";
@@ -406,8 +419,8 @@
$conf->{targeturl} ||= "http://localhost/~$username/perl";
$conf->{resourcedir} ||= "/usr/local/share/perldocs";
$conf->{templatedir} ||= "/usr/local/share/perldocs/template"; # from_templates() and docset() only
- $conf->{verbose} ||= 0;
- $conf->{sitetitle} ||= "localhost";
+ $conf->{verbose} ||= 1;
+ $conf->{sitetitle} ||= "Perl Installed";
$conf->{colorscheme} ||= "red";
$conf->{bgcolor} ||= "";
$conf->{menubgcolor} ||= "";
@@ -427,12 +440,13 @@
elsif ($conf->{method} eq "template") {
$self->generate_from_templates($conf);
}
- elsif ($conf->{method} eq "docset") {
- $self->generate_docset($conf);
- }
+ #elsif ($conf->{method} eq "docset") {
+ # $self->generate_docset($conf);
+ #}
else {
$self->generate_standard($conf);
}
+ print "Errors and Warnings written to perldocs.log\n" if ($conf->{verbose});
}
sub generate_standard {
@@ -447,23 +461,93 @@
##########################################################
# initialize directories
##########################################################
- my $metadir = $conf->{metadir};
- my $extsrcdir = $conf->{extsrcdir};
- my $targetdir = $conf->{targetdir};
+ my $resourcedir = $conf->{resourcedir};
+ my $metadir = $conf->{metadir};
+ my $extsrcdir = $conf->{extsrcdir};
+ my $targetdir = $conf->{targetdir};
+ my $targeturl = $conf->{targeturl};
+ my $verbose = $conf->{verbose};
+
+ mkpath($metadir) if (! -d $metadir);
+ mkpath($extsrcdir) if (! -d $extsrcdir);
+ mkpath($targetdir) if (! -d $targetdir);
- mkpath("$metadir");
- mkpath("$extsrcdir");
- mkpath("$targetdir");
+ ##########################################################
+ # vars
+ ##########################################################
+ my $dmd = $self->{metadata};
+ my @distributions = @{$self->{distributions}};
+ my @modules = @{$self->{modules}};
##########################################################
- # initialize files in docset directory
+ # initialize files in html directory
##########################################################
- $self->write_style_sheet($conf);
- $self->copy_resources($conf);
- $self->write_docs();
- $self->write_pods($conf);
- $self->run_pod2html($conf);
- $self->fix_html($conf);
+ $self->write_style_sheet($conf); # write the CSS file
+
+ if (-d $resourcedir) {
+ system("cp -r $resourcedir/* $targetdir");
+ print "Resources copied from [$resourcedir] to [$targetdir]\n" if ($conf->{verbose});
+ }
+
+ ##########################################################
+ # write_docs()
+ ##########################################################
+ $self->write_frameset("site");
+ $self->write_contents("site");
+ $self->write_list("site", "all");
+
+ #$self->write_list_any(\@distributions);
+ $self->write_view_a("site", "all", "All Distributions");
+ $self->write_view_tree(); # writes all trees
+ $self->write_view_use(); # writes all uses
+
+ my ($distribution);
+ foreach $distribution (@distributions) {
+ $self->write_list("distribution", $distribution);
+ print "Write Distribution List [$distribution]\n" if ($verbose);
+ }
+
+ #$self->write_view_metrics(); # writes all metrics
+
+ ##########################################################
+ # write_pods()
+ ##########################################################
+ my ($module, $pod_file, $pod_dir, $html_file, $html_dir);
+ my ($relative_root);
+ foreach $module (@modules) {
+
+ $pod_file = "$extsrcdir/lib/$module.pm";
+ $pod_file =~ s!::!/!g;
+ $pod_dir = dirname($pod_file);
+ mkpath($pod_dir) if (! -d $pod_dir);
+
+ $html_file = "$targetdir/module/$module.html";
+ $html_file =~ s!::!/!g;
+ $html_dir = dirname($html_file);
+ mkpath($html_dir) if (! -d $html_dir);
+
+ $dmd->write_module_ext_pod($module, $pod_file);
+ printf("Wrote Module Extended Pod: %-32s => [$pod_file]\n","[$module]") if ($verbose);
+
+ $relative_root = $module;
+ $relative_root =~ s/[^:]+/../g;
+ $relative_root =~ s!:+!/!g;
+ if (-f $pod_file) {
+ pod2html(
+ "--podroot=$extsrcdir/lib",
+ "--htmlroot=$targeturl/module",
+ "--htmldir=$targeturl/module",
+ "--podpath=.",
+ "--recurse",
+ "--title=Module - $module",
+ "--css=$relative_root/style.css",
+ "--infile=$pod_file",
+ "--outfile=$html_file");
+
+ $self->fix_module_html($conf, $module, $html_file, $relative_root);
+ printf("Wrote Module %-32s => [$html_file]\n","[$module]") if ($verbose);
+ }
+ }
}
sub generate_from_templates {
@@ -497,7 +581,7 @@
sub generate_docset {
my ($self, $conf) = @_;
- use DocSet;
+ #use DocSet;
##########################################################
# initialize variables
@@ -533,112 +617,47 @@
##############################################################
# use Devel::Metadata
##############################################################
-use Devel::Metadata;
-sub write_pods {
- my ($self, $conf) = @_;
- my ($extsrcdir, $dmd, $module, $dstfile, $dstdir, @modules);
- $extsrcdir = $conf->{extsrcdir};
- $dmd = $self->{metadata};
- @modules = @{$self->{modules}};
- foreach $module (@modules) {
- $dstfile = "$extsrcdir/lib/$module.pm";
- $dstfile =~ s!::!/!g;
- $dstdir = dirname($dstfile);
- mkpath($dstdir) if (! -d $dstdir);
- $dmd->write_module_ext_pod($module, $dstfile);
- }
-}
+sub fix_module_html {
+ my ($self, $conf, $module, $html_file, $relative_root, $dist_name, $dist_version) = @_;
-sub run_pod2html {
- my ($self, $conf) = @_;
-
- my ($extsrcdir, $targetdir, $targeturl);
- $extsrcdir = $conf->{extsrcdir};
- $targetdir = $conf->{targetdir};
- $targeturl = $conf->{targeturl};
-
- use Pod::Html;
- my ($dmd, $module, $infile, $outfile, $outdir, $relroot);
- $dmd = $self->{metadata};
- chdir($extsrcdir);
- foreach $module (@{$self->{modules}}) {
- $infile = "$extsrcdir/lib/$module.pm";
- $infile =~ s!::!/!g;
- $outfile = "$targetdir/module/$module.html";
- $outfile =~ s!::!/!g;
- $outdir = dirname($outfile);
- mkpath($outdir) if (! -d $outdir);
- $relroot = $module;
- $relroot =~ s/[^:]+/../g;
- $relroot =~ s!:+!/!g;
- pod2html(
- "--podroot=$extsrcdir/lib",
- "--htmlroot=$targeturl/module",
- "--htmldir=$targeturl/module",
- "--podpath=.",
- "--recurse",
- "--title=Module - $module",
- "--css=$relroot/style.css",
- "--infile=$infile",
- "--outfile=$outfile");
- }
-}
-
-sub fix_html {
- my ($self, $conf) = @_;
-
- my ($targetdir, $targeturl, $linkcolor, $activecolor);
- $targetdir = $conf->{targetdir};
- $targeturl = $conf->{targeturl};
- $linkcolor = $conf->{linkcolor};
- $activecolor = $conf->{activecolor};
-
- my ($dmd, $htmlfile, $relroot, $modified, $html);
- my ($unmodified_head, $modified_head, $title, $module, $top_navbar);
- my ($distname, $distver);
- $dmd = $self->{metadata};
- foreach $module (@{$self->{modules}}) {
- $htmlfile = "$targetdir/module/$module.html";
- $htmlfile =~ s!::!/!g;
- $relroot = $module;
- $relroot =~ s/[^:]+/../g;
- $relroot =~ s!:+!/!g;
-
- $modified = 0;
- $html = $self->read_file($htmlfile);
-
- if ($html !~ m!HREF="$targeturl/! &&
- $html =~ s!HREF="/!HREF="$targeturl/!g) {
- $modified = 1;
- }
-
- $unmodified_head = <<EOF;
-<HTML>
+ my $targetdir = $conf->{targetdir};
+ my $targeturl = $conf->{targeturl};
+ my $linkcolor = $conf->{linkcolor};
+ my $activecolor = $conf->{activecolor};
+
+ my $modified = 0;
+ my $html = $self->read_file($html_file);
+
+ if ($html !~ m!HREF="$targeturl/! &&
+ $html =~ s!HREF="/!HREF="$targeturl/!g) {
+ $modified = 1;
+ }
+
+ my $unmodified_head = <<EOF;
+<HTML[^<>]*>
<HEAD>
-<TITLE>.*</TITLE>
-<LINK.*>
-<LINK.*>
+<TITLE>[^<>]*</TITLE>.*
</HEAD>
<BODY>
EOF
- if ($html =~ m/^$unmodified_head/) {
+ if ($html =~ m/$unmodified_head/is) {
- $title = "Module - $module";
- $distname = "unknown-dist";
- $distver = "0.01";
- $top_navbar = $self->navbar("module", $distname, $distver, "unknown", "module", "main", "top", $relroot);
+ my $title = "Module - $module";
+ $dist_name ||= "unknown-dist";
+ $dist_version ||= "0.00";
+ my $top_navbar = $self->navbar("module", $dist_name, $dist_version, "unknown", "module", "main", "top", $relative_root);
- $modified_head = <<EOF;
+ my $modified_head = <<EOF;
<HTML>
<HEAD>
<TITLE>$title</TITLE>
- <LINK REL="stylesheet" HREF="$relroot/style.css" TYPE="text/css">
+ <LINK REL="stylesheet" HREF="$relative_root/style.css" TYPE="text/css">
<SCRIPT>
function asd() {
- parent.document.title="$module ($distname-$distver)";
+ parent.document.title="$module ($dist_name-$dist_version)";
}
</SCRIPT>
</HEAD>
@@ -648,18 +667,17 @@
<hr>
<table border="0" cellspacing="0">
<tr>
- <td valign=middle><img src="$relroot/images/logo.gif" border="0"></td>
+ <td valign=middle><img src="$relative_root/images/logo.gif" border="0"></td>
<td valign=middle><h1>$module</h1></td>
</tr>
</table>
EOF
- $html =~ s!^$unmodified_head!$modified_head!s;
- $modified = 1;
- }
+ my $chg = $html =~ s!$unmodified_head!$modified_head!is;
+ $modified = 1;
+ }
- if ($modified) {
- $self->write_file($htmlfile,$html);
- }
+ if ($modified) {
+ $self->write_file($html_file,$html);
}
}
@@ -667,7 +685,8 @@
my ($self, $conf) = @_;
$conf = $self->{conf} if (!$conf && ref($self));
my $perl5lib = $ENV{PERL5LIB} || $ENV{PERLLIB};
- my $lib = join ":", grep defined($_), "$Bin/../lib", $perl5lib;
+ #my $lib = join ":", grep defined($_), "$Bin/../lib", $perl5lib;
+ my $lib;
my $extsrcdir = $conf->{extsrcdir};
my $command = "env PERL5LIB=$lib docset_build -vd $extsrcdir lib/config.cfg";
@@ -692,6 +711,7 @@
$conf->{washedbgcolor} = "#".($red?"FF":"EE").($green?"FF":"EE").($blue?"FF":"EE") if (!$conf->{washedbgcolor});
$conf->{linkcolor} = "#".($red?"66":"00").($green?"66":"00").($blue?"66":"00") if (!$conf->{linkcolor});
$conf->{activecolor} = "#".($red?"99":"00").($green?"99":"00").($blue?"99":"00") if (!$conf->{activecolor});
+ print "Colorscheme initialized [$colorscheme]\n" if ($conf->{verbose});
}
sub write_style_sheet {
@@ -763,22 +783,12 @@
EOF
$self->write_file("$targetdir/style.css", $css);
-}
-
-sub copy_resources {
- my ($self, $conf) = @_;
- $conf = $self->{conf} if (!$conf && ref($self));
-
- my $resourcedir = $conf->{resourcedir};
- my $targetdir = $conf->{targetdir};
-
- mkpath("$targetdir") if (! -d "$targetdir");
- system("cp -r $resourcedir/* $targetdir");
+ print "Style sheet written [$targetdir/style.css]\n" if ($conf->{verbose});
}
sub navbar {
- my ($self, $type, $distribution, $version, $modulegroup, $module, $pagetype, $fileposition, $relroot) = @_;
- #print "navbar($type, $distribution, $version, $modulegroup, $module, $pagetype, $fileposition, $relroot)\n";
+ my ($self, $type, $distribution, $version, $modulegroup, $module, $pagetype, $fileposition, $relative_root) = @_;
+ #print "navbar($type, $distribution, $version, $modulegroup, $module, $pagetype, $fileposition, $relative_root)\n";
my ($html, $plain_bgcolor, $highlight_bgcolor);
my ($plain_cellstyle, $highlight_cellstyle);
@@ -854,10 +864,10 @@
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" CLASS="$plain_cellstyle">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="$site_bgcolor" CLASS="$site_cellstyle">
- <A HREF="$relroot/distribution/all/view.html"><FONT CLASS="$site_fontstyle"><B>Site</B></FONT></A>
+ <A HREF="$relative_root/distribution/all/view.html"><FONT CLASS="$site_fontstyle"><B>Site</B></FONT></A>
</TD>
<TD BGCOLOR="$dist_bgcolor" CLASS="$dist_cellstyle">
- <A HREF="$relroot/distribution/$distribution/view.html"><FONT CLASS="$dist_fontstyle"><B>Distribution</B></FONT></A>
+ <A HREF="$relative_root/distribution/$distribution/view.html"><FONT CLASS="$dist_fontstyle"><B>Distribution</B></FONT></A>
</TD>
<TD BGCOLOR="$modulegroup_bgcolor" CLASS="$modulegroup_cellstyle">
<FONT CLASS="$modulegroup_fontstyle">Module-Group</FONT>
@@ -869,7 +879,7 @@
<FONT CLASS="$use_fontstyle">Use</FONT>
</TD>
<TD BGCOLOR="$tree_bgcolor" CLASS="$tree_cellstyle">
- <A HREF="$relroot/view-tree-all.html"><FONT CLASS="$tree_fontstyle"><B>ISA</B></FONT></A>
+ <A HREF="$relative_root/view-tree-all.html"><FONT CLASS="$tree_fontstyle"><B>ISA</B></FONT></A>
</TD>
</TR>
</TABLE>
@@ -885,17 +895,17 @@
</TD>
<TD BGCOLOR="white" CLASS="NavBarCell2">
<FONT SIZE="-2">
- <A HREF="$relroot/index.html" TARGET="_top"><B>FRAMES</B></A>
- <A HREF="$relroot/view-a-all.html" TARGET="_top"><B>NO FRAMES</B></A>
+ <A HREF="$relative_root/index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="$relative_root/view-a-all.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT>
<!--
if(window==top) {
- document.writeln('<A HREF="$relroot/view-a-all.html" TARGET=""><B>All Modules</B></A>');
+ document.writeln('<A HREF="$relative_root/view-a-all.html" TARGET=""><B>All Modules</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
- <A HREF="$relroot/view-a-all.html" TARGET=""><B>All Modules</B></A>
+ <A HREF="$relative_root/view-a-all.html" TARGET=""><B>All Modules</B></A>
</NOSCRIPT>
</FONT>
</TD>
@@ -907,26 +917,38 @@
$html;
}
-sub write_docs {
- my ($self) = @_;
- my ($dmd, $distribution);
- $dmd = $self->{metadata};
- $self->write_frameset("site");
- $self->write_contents("site");
-
- foreach $distribution (@{$self->{distributions}}) {
- $self->write_list("distribution", $distribution);
+sub html_file {
+ my ($self, $type, $item, $frame, $values) = @_;
+ my ($html_file);
+ $type ||= "site"; # site, distribution, module_group, module
+ $item ||= "all";
+ $frame ||= "view"; # contents, list, view
+ $values ||= {};
+ if ($type eq "site") {
+ $html_file = "site/$frame.html";
+ $values->{distribution} = "";
}
-
- #$self->write_view(); # writes all views
- #foreach $distribution (sort keys %{$metadata->{distribution}}) {
- # $self->write_list_any($distribution);
- #}
- #$self->write_view_a("all", "all", "All Distributions");
-
- #$self->write_view_tree(); # writes all trees
- #$self->write_view_use(); # writes all uses
- #$self->write_view_metrics(); # writes all metrics
+ elsif ($type eq "distribution") {
+ $html_file = "${type}/${item}/$frame.html";
+ $values->{distribution} = $item;
+ }
+ elsif ($type eq "module") { # should never happen (!)
+ my $modulepath = $item;
+ $modulepath =~ s!::!/!g;
+ $html_file = "module/${modulepath}-$frame.html";
+ }
+ else {
+ # should never happen
+ warn "Warning: writing [$item] (type $type) contents\n";
+ $html_file = "${type}/${item}/$frame.html";
+ }
+ my $relative_root = $html_file;
+ $relative_root =~ s![^/]+!..!g;
+ $relative_root =~ s!^\.\./?!!g;
+ $relative_root .= "/" if ($relative_root);
+ $values->{relative_root} = $relative_root;
+ $values->{html_file} = $html_file;
+ return($html_file);
}
sub write_frameset {
@@ -936,7 +958,8 @@
my $targetdir = $self->{conf}{targetdir};
my $datetime = $self->{conf}{datetime};
my $sitetitle = $self->{conf}{sitetitle};
- my ($html, $file, $relfile, $relroot, @files, $modulepath);
+ my $verbose = $self->{conf}{verbose};
+ my ($html, $file, $relfile, $relative_root, @files, $modulepath);
if ($type eq "site") {
@files = ("index.html", "site/frameset.html");
@@ -956,10 +979,10 @@
}
foreach $file (@files) {
- $relroot = $file;
- $relroot =~ s![^/]+!..!g;
- $relroot =~ s!^\.\./?!!g;
- $relroot .= "/" if ($relroot);
+ $relative_root = $file;
+ $relative_root =~ s![^/]+!..!g;
+ $relative_root =~ s!^\.\./?!!g;
+ $relative_root .= "/" if ($relative_root);
$html = <<EOF;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
@@ -970,10 +993,10 @@
<FRAMESET cols="20%,80%">
<FRAMESET rows="40%,60%">
- <FRAME src="${relroot}site/contents.html" name="contentsFrame">
- <FRAME src="${relroot}site/list.html" name="listFrame">
+ <FRAME src="${relative_root}site/contents.html" name="contentsFrame">
+ <FRAME src="${relative_root}site/list.html" name="listFrame">
</FRAMESET>
- <FRAME src="${relroot}site/view.html" name="viewFrame">
+ <FRAME src="${relative_root}site/view.html" name="viewFrame">
</FRAMESET>
<NOFRAMES>
@@ -987,6 +1010,8 @@
EOF
$self->write_file("$targetdir/$file", $html);
}
+ my $numfiles = $#files + 1;
+ print "$numfiles Framesets written.\n" if ($verbose);
}
sub write_contents {
@@ -998,7 +1023,7 @@
my $linkcolor = $self->{conf}{linkcolor};
my $activecolor = $self->{conf}{activecolor};
- my ($file, $modulepath, $relroot);
+ my ($file, $modulepath, $relative_root);
if ($type eq "site") {
$file = "site/contents.html";
}
@@ -1015,10 +1040,10 @@
warn "Warning: writing [$item] (type $type) contents\n";
$file = "${type}/${item}-frameset.html";
}
- $relroot = $file;
- $relroot =~ s![^/]+!..!g;
- $relroot =~ s!^\.\./?!!g;
- $relroot .= "/" if ($relroot);
+ $relative_root = $file;
+ $relative_root =~ s![^/]+!..!g;
+ $relative_root =~ s!^\.\./?!!g;
+ $relative_root .= "/" if ($relative_root);
my $html = <<EOF;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
@@ -1026,7 +1051,7 @@
<HEAD>
<!-- Generated by perldocs on $datetime -->
<TITLE>Overview ($sitetitle)</TITLE>
- <LINK REL="stylesheet" TYPE="text/css" HREF="${relroot}style.css" TITLE="Style">
+ <LINK REL="stylesheet" TYPE="text/css" HREF="${relative_root}style.css" TITLE="Style">
<SCRIPT>
function asd() {
parent.document.title="Overview ($sitetitle)";
@@ -1044,14 +1069,14 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD NOWRAP>
- <FONT CLASS="FrameItemFont"><A HREF="${relroot}site/list.html" TARGET="listFrame">All Classes</A></FONT><P>
+ <FONT CLASS="FrameItemFont"><A HREF="${relative_root}site/list.html" TARGET="listFrame">All Classes</A></FONT><P>
<FONT size="+1" CLASS="FrameHeadingFont">Distributions</FONT><BR>
EOF
my ($distribution);
foreach $distribution (@{$self->{distributions}}) {
$html .= <<EOF;
- <FONT CLASS="FrameItemFont"><A HREF="${relroot}distribution/${distribution}/list.html" TARGET="listFrame">$distribution</A></FONT><BR>
+ <FONT CLASS="FrameItemFont"><A HREF="${relative_root}distribution/${distribution}/list.html" TARGET="listFrame">$distribution</A></FONT><BR>
EOF
}
@@ -1076,7 +1101,7 @@
my $linkcolor = $self->{conf}{linkcolor};
my $activecolor = $self->{conf}{activecolor};
- my ($distribution, $outfile, $modulepath, $relroot, $short_title);
+ my ($distribution, $html_file, $modulepath, $relative_root, $short_title);
if (!$title) {
$title = ucfirst($type);
$title .= " - $item" if ($item);
@@ -1085,27 +1110,27 @@
$short_title = "Site" if (!$short_title);
if ($type eq "site") {
- $outfile = "site/list.html";
+ $html_file = "site/list.html";
$distribution = undef;
}
elsif ($type eq "distribution") {
- $outfile = "${type}/${item}/list.html";
+ $html_file = "${type}/${item}/list.html";
$distribution = $item;
}
elsif ($type eq "module") { # should never happen (!)
$modulepath = $item;
$modulepath =~ s!::!/!g;
- $outfile = "module/${modulepath}-list.html";
+ $html_file = "module/${modulepath}-list.html";
}
else {
# should never happen
warn "Warning: writing [$item] (type $type) contents\n";
- $outfile = "${type}/${item}/list.html";
+ $html_file = "${type}/${item}/list.html";
}
- $relroot = $outfile;
- $relroot =~ s![^/]+!..!g;
- $relroot =~ s!^\.\./?!!g;
- $relroot .= "/" if ($relroot);
+ $relative_root = $html_file;
+ $relative_root =~ s![^/]+!..!g;
+ $relative_root =~ s!^\.\./?!!g;
+ $relative_root .= "/" if ($relative_root);
my $html = <<EOF;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
@@ -1113,7 +1138,7 @@
<HEAD>
<!-- Generated by perldocs on $datetime -->
<TITLE>$title</TITLE>
- <LINK REL="stylesheet" HREF="${relroot}style.css" TYPE="text/css">
+ <LINK REL="stylesheet" HREF="${relative_root}style.css" TYPE="text/css">
<SCRIPT>
function asd() {
parent.document.title="$title";
@@ -1136,7 +1161,7 @@
$module_nonimp_html = "";
foreach $module (sort $dmd->modules($item)) {
- $htmlfile = "${relroot}module/$module.html";
+ $htmlfile = "${relative_root}module/$module.html";
$htmlfile =~ s!::!/!g;
$is_doc = 0;
@@ -1170,20 +1195,20 @@
#EOF
# }
$module_html .= <<EOF;
- <A HREF="$htmlfile" TARGET="viewFrame">$module</A><BR>
+ <A HREF="$htmlfile" TARGET="viewFrame">$module</A><BR>
EOF
}
}
-# $files = $metadata->{$type}{$item}{files};
-# if (ref($files) eq "ARRAY") {
-# foreach $file (sort @$files) {
-# $shortfile = &file2shortfile($file);
-# $files_html .= <<EOF;
-# <A HREF="file$file.html" TARGET="viewFrame">$shortfile</A><BR>
-#EOF
-# }
-# }
+ $files = $dmd->{$type}{$item}{files};
+ if (ref($files) eq "ARRAY") {
+ foreach $file (sort @$files) {
+ $shortfile = &file2shortfile($file);
+ $files_html .= <<EOF;
+ <A HREF="file$file.html" TARGET="viewFrame">$shortfile</A><BR>
+EOF
+ }
+ }
if ($doc_html) {
$html .= <<EOF;
@@ -1234,354 +1259,386 @@
</HTML>
EOF
- $self->write_file("$targetdir/$outfile", $html);
+ $self->write_file("$targetdir/$html_file", $html);
+}
+
+sub file2shortfile {
+ my ($file) = @_;
+ my $shortfile = $file;
+ $shortfile =~ s!.*/!!;
+ return($shortfile);
+}
+
+sub write_view_a {
+ my ($self, $type, $item, $title) = @_;
+ my $dmd = $self->{metadata};
+ my $bgcolor = $self->{conf}{bgcolor};
+ my $menubgcolor = $self->{conf}{menubgcolor};
+ my $washedbgcolor = $self->{conf}{washedbgcolor};
+ my $linkcolor = $self->{conf}{linkcolor};
+ my $activecolor = $self->{conf}{activecolor};
+ my $targetdir = $self->{conf}{targetdir};
+ my $relative_root = ".";
+ my ($html);
+ $title = $item if (!$title);
+ my $ctype = substr($type,0,1);
+ $html = <<EOF;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+ <!-- Generated by javadoc on Wed Oct 10 20:02:45 PDT 2001 -->
+ <TITLE>Overview ($title)</TITLE>
+ <LINK REL="stylesheet" HREF="${relative_root}/style.css" TYPE="text/css">
+ <SCRIPT>
+ function asd() {
+ parent.document.title="Overview ($title)";
+ }
+ </SCRIPT>
+</HEAD>
+<BODY bgcolor="white" link="$linkcolor" alink="$activecolor" vlink="$activecolor" onload="asd();">
+
+<!-- ========== START OF NAVBAR ========== -->
+<A NAME="navbar_top"><!-- --></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+ <TR>
+ <TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+ <A NAME="navbar_top_firstrow"><!-- --></A>
+ <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev">
+ <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>
+ </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+ <FONT CLASS="NavBarFont1">Class-Group</FONT>
+ </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+ <FONT CLASS="NavBarFont1">Class</FONT>
+ </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+ <FONT CLASS="NavBarFont1">Use</FONT>
+ </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+ <A HREF="view-tree-$item.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="right" VALIGN="top" ROWSPAN=3>
+ <EM><b>$title</b></EM>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD BGCOLOR="white" CLASS="NavBarCell2">
+ <FONT SIZE="-2"> PREV NEXT</FONT>
+ </TD>
+ <TD BGCOLOR="white" CLASS="NavBarCell2">
+ <FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="view-$item.html" TARGET="_top"><B>NO FRAMES</B></A>
+ <SCRIPT>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+ </SCRIPT>
+ <NOSCRIPT>
+ <A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
+ </NOSCRIPT>
+ </FONT>
+ </TD>
+ </TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<HR>
+<CENTER>
+<H2>$title</H2>
+</CENTER>
+This is the Perl documentation for $title.
+<P>
+
+<!--
+<B>See:</B>
+<BR>
+ <A HREF="#overview_description"><B>Description</B></A>
+<P>
+-->
+
+<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
+<TR BGCOLOR="$menubgcolor" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Distributions</B></FONT></TD>
+</TR>
+EOF
+
+ my ($distribution, $description, $url);
+ foreach $distribution (sort keys %{$dmd->{distribution}}) {
+ $description = $dmd->{distribution}{$distribution}{description};
+ $description = "The $distribution distribution." if (!$description);
+ $url = "view-d-$distribution.html";
+ $html .= <<EOF;
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><B><A HREF="$url">$distribution</A></B></TD>
+<TD>$description</TD>
+</TR>
+EOF
+ }
+
+ $html .= <<EOF;
+</TABLE>
+
+<P>
+ <A NAME="overview_description"><!-- --></A>
+<P>
+This is the Perl documentation for $title.
+<p>
+<P>
+
+<P>
+<HR>
+
+<!-- ========== START OF NAVBAR ========== -->
+<A NAME="navbar_bottom"><!-- --></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+<TR>
+<TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+<A NAME="navbar_bottom_firstrow"><!-- --></A>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-tree-$item.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+<b>$title</b></EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ PREV
+ NEXT</FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="view-$item.html" TARGET="_top"><B>NO FRAMES</B></A>
+
+<SCRIPT>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+</SCRIPT>
+<NOSCRIPT>
+<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
+</NOSCRIPT>
+</FONT></TD>
+</TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+</BODY>
+</HTML>
+EOF
+ $self->write_file("$targetdir/view-$ctype-$item.html", $html);
+}
+
+sub write_view_use {
+ my ($self) = @_;
+ my $dmd = $self->{metadata};
+}
+
+sub class_group_tree {
+ my ($dmd, $class_group) = @_;
+ my $html = "";
+ return($html);
+}
+
+sub write_view_tree {
+ my ($self) = @_;
+ my $dmd = $self->{metadata};
+ $self->write_view_tree_any("all");
+ my ($class_group);
+ foreach $class_group (sort keys %{$dmd->{classgroup}}) {
+ $self->write_view_tree_any($class_group);
+ }
}
-# sub write_view_a {
-# my ($self) = @_;
-# my $dmd = $self->{metadata};
-# my ($html, $ctype);
-# $title = $item if (!$title);
-# $ctype = substr($type,0,1);
-# $html = <<EOF;
-# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
-# <!--NewPage-->
-# <HTML>
-# <HEAD>
-# <!-- Generated by javadoc on Wed Oct 10 20:02:45 PDT 2001 -->
-# <TITLE>Overview ($title)</TITLE>
-# <LINK REL="stylesheet" HREF="${relroot}style.css" TYPE="text/css">
-# <SCRIPT>
-# function asd() {
-# parent.document.title="Overview ($title)";
-# }
-# </SCRIPT>
-# </HEAD>
-# <BODY bgcolor="white" link="$linkcolor" alink="$activecolor" vlink="$activecolor" onload="asd();">
-#
-# <!-- ========== START OF NAVBAR ========== -->
-# <A NAME="navbar_top"><!-- --></A>
-# <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
-# <TR>
-# <TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <A NAME="navbar_top_firstrow"><!-- --></A>
-# <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
-# <TR ALIGN="center" VALIGN="top">
-# <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev">
-# <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT>
-# </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <FONT CLASS="NavBarFont1">Class-Group</FONT>
-# </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <FONT CLASS="NavBarFont1">Class</FONT>
-# </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <FONT CLASS="NavBarFont1">Use</FONT>
-# </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <A HREF="view-tree-$item.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>
-# </TD>
-# </TR>
-# </TABLE>
-# </TD>
-# <TD ALIGN="right" VALIGN="top" ROWSPAN=3>
-# <EM><b>$title</b></EM>
-# </TD>
-# </TR>
-#
-# <TR>
-# <TD BGCOLOR="white" CLASS="NavBarCell2">
-# <FONT SIZE="-2"> PREV NEXT</FONT>
-# </TD>
-# <TD BGCOLOR="white" CLASS="NavBarCell2">
-# <FONT SIZE="-2">
-# <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
-# <A HREF="view-$item.html" TARGET="_top"><B>NO FRAMES</B></A>
-# <SCRIPT>
-# <!--
-# if(window==top) {
-# document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
-# }
-# //-->
-# </SCRIPT>
-# <NOSCRIPT>
-# <A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
-# </NOSCRIPT>
-# </FONT>
-# </TD>
-# </TR>
-# </TABLE>
-# <!-- =========== END OF NAVBAR =========== -->
-#
-# <HR>
-# <CENTER>
-# <H2>$title</H2>
-# </CENTER>
-# This is the Perl documentation for $title.
-# <P>
-#
-# <!--
-# <B>See:</B>
-# <BR>
-# <A HREF="#overview_description"><B>Description</B></A>
-# <P>
-# -->
-#
-# <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
-# <TR BGCOLOR="$menubgcolor" CLASS="TableHeadingColor">
-# <TD COLSPAN=2><FONT SIZE="+2">
-# <B>Distributions</B></FONT></TD>
-# </TR>
-# EOF
-#
-# my ($distribution, $description, $url);
-# foreach $distribution (sort keys %{$metadata->{distribution}}) {
-# $description = $metadata->{distribution}{$distribution}{description};
-# $description = "The $distribution distribution." if (!$description);
-# $url = "view-d-$distribution.html";
-# $html .= <<EOF;
-# <TR BGCOLOR="white" CLASS="TableRowColor">
-# <TD><B><A HREF="$url">$distribution</A></B></TD>
-# <TD>$description</TD>
-# </TR>
-# EOF
-# }
-#
-# $html .= <<EOF;
-# </TABLE>
-#
-# <P>
-# <A NAME="overview_description"><!-- --></A>
-# <P>
-# This is the Perl documentation for $title.
-# <p>
-# <P>
-#
-# <P>
-# <HR>
-#
-# <!-- ========== START OF NAVBAR ========== -->
-# <A NAME="navbar_bottom"><!-- --></A>
-# <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
-# <TR>
-# <TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <A NAME="navbar_bottom_firstrow"><!-- --></A>
-# <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
-# <TR ALIGN="center" VALIGN="top">
-# <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-tree-$item.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
-# </TR>
-# </TABLE>
-# </TD>
-# <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
-# <b>$title</b></EM>
-# </TD>
-# </TR>
-#
-# <TR>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# PREV
-# NEXT</FONT></TD>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
-# <A HREF="view-$item.html" TARGET="_top"><B>NO FRAMES</B></A>
-#
-# <SCRIPT>
-# <!--
-# if(window==top) {
-# document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
-# }
-# //-->
-# </SCRIPT>
-# <NOSCRIPT>
-# <A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
-# </NOSCRIPT>
-# </FONT></TD>
-# </TR>
-# </TABLE>
-# <!-- =========== END OF NAVBAR =========== -->
-#
-# </BODY>
-# </HTML>
-# EOF
-# $self->write_file("$targetdir/view-$ctype-$item.html", $html);
-# }
-#
-# sub write_view_tree {
-# my ($self) = @_;
-# my $dmd = $self->{metadata};
-# $self->write_view_tree_any("all");
-# my ($class_group);
-# foreach $class_group (sort keys %{$metadata->{classgroup}}) {
-# $self->write_view_tree_any($class_group);
-# }
-# }
-#
-# sub write_view_tree_any {
-# my ($self, $this_class_group) = @_;
-# my $dmd = $self->{metadata};
-# my ($html, $title);
-# $title = ($this_class_group eq "all") ? "All Class Groups" : "$this_class_group Class Group";
-# $html = <<EOF;
-# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
-# <!--NewPage-->
-# <HTML>
-# <HEAD>
-# <!-- Generated by perldocs on $datetime -->
-# <TITLE>Class Hierarchy ($title)</TITLE>
-# <LINK REL="stylesheet" HREF="${relroot}style.css" TYPE="text/css">
-# <SCRIPT>
-# function asd() {
-# parent.document.title="Class Hierarchy ($title)";
-# }
-# </SCRIPT>
-# </HEAD>
-# <BODY bgcolor="white" link="$linkcolor" alink="$activecolor" vlink="$activecolor" onload="asd();">
-#
-# <!-- ========== START OF NAVBAR ========== -->
-# <A NAME="navbar_top"><!-- --></A>
-# <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
-# <TR>
-# <TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <A NAME="navbar_top_firstrow"><!-- --></A>
-# <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
-# <TR ALIGN="center" VALIGN="top">
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-a-all.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
-# <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
-# </TR>
-# </TABLE>
-# </TD>
-# <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
-# <b>$title</b></EM>
-# </TD>
-# </TR>
-#
-# <TR>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# PREV
-# NEXT</FONT></TD>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
-# <A HREF="view-tree-all.html" TARGET="_top"><B>NO FRAMES</B></A>
-#
-# <SCRIPT>
-# <!--
-# if(window==top) {
-# document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
-# }
-# //-->
-# </SCRIPT>
-# <NOSCRIPT>
-# <A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
-# </NOSCRIPT>
-# </FONT></TD>
-# </TR>
-# </TABLE>
-# <!-- =========== END OF NAVBAR =========== -->
-#
-# <HR>
-# <CENTER>
-# <H2>
-# Hierarchy For $title</H2>
-# </CENTER>
-# <DL>
-# <DT>
-# <B>Class Group Hierarchies:</B><DD>
-# EOF
-#
-# my ($class_group);
-# if ($this_class_group eq "all") {
-# foreach $class_group (sort keys %{$metadata->{classgroup}}) {
-# if ($class_group ne "all") {
-# $html .= " <A HREF=\"${class_group}-tree.html\">$class_group</A>,\n";
-# }
-# else {
-# $html .= " <A HREF=\"view-tree-all.html\">All Classes</A>\n";
-# }
-# }
-# }
-# else {
-# $html .= " <A HREF=\"view-tree-all.html\">All Classes</A>\n";
-# }
-#
-# $html .= <<EOF;
-# </DD>
-# </DT>
-# </DL>
-# <HR>
-# <H2>
-# Class Hierarchy
-# </H2>
-# EOF
-#
-# $html .= &class_group_tree($metadata, $this_class_group);
-#
-# $html .= <<EOF;
-# <HR>
-#
-# <!-- ========== START OF NAVBAR ========== -->
-# <A NAME="navbar_bottom"><!-- --></A>
-# <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
-# <TR>
-# <TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
-# <A NAME="navbar_bottom_firstrow"><!-- --></A>
-# <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
-# <TR ALIGN="center" VALIGN="top">
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-a-all.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
-# <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
-# <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
-# </TR>
-# </TABLE>
-#
-# </TD>
-# <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
-# <b>$title</b></EM>
-# </TD>
-# </TR>
-#
-# <TR>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# PREV
-# NEXT</FONT></TD>
-# <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-# <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
-# <A HREF="view-tree-all.html" TARGET="_top"><B>NO FRAMES</B></A>
-#
-# <SCRIPT>
-# <!--
-# if(window==top) {
-# document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
-# }
-# //-->
-# </SCRIPT>
-# <NOSCRIPT>
-# <A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
-# </NOSCRIPT>
-# </FONT></TD>
-# </TR>
-# </TABLE>
-# <!-- =========== END OF NAVBAR =========== -->
-#
-# </BODY>
-# </HTML>
-# EOF
-#
-# if ($this_class_group eq "all") {
-# $self->write_file("$targetdir/view-tree-all.html", $html);
-# }
-# else {
-# $self->write_file("$targetdir/${this_class_group}-tree.html", $html);
-# }
-# }
+sub write_view_tree_any {
+ my ($self, $this_class_group) = @_;
+ my $dmd = $self->{metadata};
+ my $bgcolor = $self->{conf}{bgcolor};
+ my $washedbgcolor = $self->{conf}{washedbgcolor};
+ my $linkcolor = $self->{conf}{linkcolor};
+ my $activecolor = $self->{conf}{activecolor};
+ my $datetime = $self->{conf}{datetime};
+ my $targetdir = $self->{conf}{targetdir};
+ my $relative_root = ".";
+ my ($html, $title);
+ $title = ($this_class_group eq "all") ? "All Class Groups" : "$this_class_group Class Group";
+ $html = <<EOF;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+ <!-- Generated by perldocs on $datetime -->
+ <TITLE>Class Hierarchy ($title)</TITLE>
+ <LINK REL="stylesheet" HREF="${relative_root}/style.css" TYPE="text/css">
+ <SCRIPT>
+ function asd() {
+ parent.document.title="Class Hierarchy ($title)";
+ }
+ </SCRIPT>
+</HEAD>
+<BODY bgcolor="white" link="$linkcolor" alink="$activecolor" vlink="$activecolor" onload="asd();">
+
+<!-- ========== START OF NAVBAR ========== -->
+<A NAME="navbar_top"><!-- --></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+<TR>
+<TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+<A NAME="navbar_top_firstrow"><!-- --></A>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-a-all.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
+ <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+<b>$title</b></EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ PREV
+ NEXT</FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="view-tree-all.html" TARGET="_top"><B>NO FRAMES</B></A>
+
+<SCRIPT>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+</SCRIPT>
+<NOSCRIPT>
+<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
+</NOSCRIPT>
+</FONT></TD>
+</TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+<HR>
+<CENTER>
+<H2>
+Hierarchy For $title</H2>
+</CENTER>
+<DL>
+<DT>
+ <B>Class Group Hierarchies:</B><DD>
+EOF
+
+ my ($class_group);
+ if ($this_class_group eq "all") {
+ foreach $class_group (sort keys %{$dmd->{classgroup}}) {
+ if ($class_group ne "all") {
+ $html .= " <A HREF=\"${class_group}-tree.html\">$class_group</A>,\n";
+ }
+ else {
+ $html .= " <A HREF=\"view-tree-all.html\">All Classes</A>\n";
+ }
+ }
+ }
+ else {
+ $html .= " <A HREF=\"view-tree-all.html\">All Classes</A>\n";
+ }
+
+ $html .= <<EOF;
+</DD>
+</DT>
+</DL>
+<HR>
+<H2>
+Class Hierarchy
+</H2>
+EOF
+
+ $html .= &class_group_tree($dmd, $this_class_group);
+
+ $html .= <<EOF;
+<HR>
+
+<!-- ========== START OF NAVBAR ========== -->
+<A NAME="navbar_bottom"><!-- --></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
+<TR>
+<TD COLSPAN=3 BGCOLOR="$washedbgcolor" CLASS="NavBarCell1">
+<A NAME="navbar_bottom_firstrow"><!-- --></A>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <A HREF="view-a-all.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class-Group</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
+ <TD BGCOLOR="$washedbgcolor" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
+ <TD BGCOLOR="$bgcolor" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
+ </TR>
+</TABLE>
+
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+<b>$title</b></EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ PREV
+ NEXT</FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
+ <A HREF="view-tree-all.html" TARGET="_top"><B>NO FRAMES</B></A>
+
+<SCRIPT>
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>');
+ }
+ //-->
+</SCRIPT>
+<NOSCRIPT>
+<A HREF="view-a-all.html" TARGET=""><B>All Classes</B></A>
+</NOSCRIPT>
+</FONT></TD>
+</TR>
+</TABLE>
+<!-- =========== END OF NAVBAR =========== -->
+
+</BODY>
+</HTML>
+EOF
+
+ if ($this_class_group eq "all") {
+ $self->write_file("$targetdir/view-tree-all.html", $html);
+ }
+ else {
+ $self->write_file("$targetdir/${this_class_group}-tree.html", $html);
+ }
+}
sub write_docset_config_file {
my ($self, $conf) = @_;
@@ -1670,7 +1727,7 @@
},
-# mode => {
+ mode => {
# # you can override the directories creation mode
# dir => 0755,
# },
-
[svn:p5ee] r15616 - in p5ee/trunk/Devel-Perldocs: . bin lib/Devel
by spadkins