FWIW, I slighly modified this script to fill in options I care about.  The
result looked more like the resot of the ActiveState docs - headers included
with red background, links worked, etc.

First I added the following to the bottom of Active.css.  This was needed
since pod2html includes to <P><CLASS=BLOCK></P> tags for the headers, and I
wanted them to match the rest of ActiveState's headers:

p.block
    {
    color: #B82619;
    font-size: 18px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: bold;
    background-color: #EAE2BB;
    }

Here's my slight mods to the script below:

#! perl -w

###########################################################
# Just a quick and dirty utility to search for POD that 
# hasn't been converted to HTML by an install or was simply
# unzipped or copied into the site or lib subdirectories. 
# Checks to see if an existing .html version of the POD 
# exists, if not converts it to HTML. After conversion the 
# AS Docs TOC is rebuilt so that all newly added docs are listed.

use strict;
use Pod::Html;
use Pod::Find qw(pod_find);
use ActivePerl::DocTools;
use File::Path;

my $infile_path_root = "d:/perl";
my $outfile_path_root = "$infile_path_root/html";
my $logfile = "$infile_path_root/allpod.txt";
my $css = "$infile_path_root/html/Active.css";


open LOGFILE, ">>$logfile" || die "couldn't open LOGFILE $logfile\n";
&search_for_pod;
print LOGFILE "-" x 60, "\n" ;
close LOGFILE;
ActivePerl::DocTools::WriteTOC();
#ActivePerl::DocTools::TOC::RDF
sub search_for_pod {
  my %pods = pod_find({ -verbose => 0, -inc => 1 });
  foreach(sort keys %pods) {
    print "Converting $_\n";
    convert_pod($_);
  }
}

sub convert_pod {
  my $podfile = shift;
  $podfile =~ s#\\#/#g;
  if ($podfile =~ m!$infile_path_root/(.*)/(\w+)\.p.+$!i) {
    my $path = $1;
    my $name = $2;
    if (! -e "$outfile_path_root/$path/$name\.html") {
      mkpath("$outfile_path_root/$path");
      pod2html( "--infile=$podfile",
                "--outfile=$outfile_path_root/$path/$name.html",
                "--podroot=$outfile_path_root",
                "--podpath=site/lib:lib",
                "--css=$css",
                "--header",
                "--htmlroot=$outfile_path_root",
                "--libpods=perlfunc:perlguts:perlvar:perlrun:perlop",
      );
      print "-- Created $outfile_path_root/$path/$name.html\n";
      print LOGFILE "-- Created $outfile_path_root/$path/$name.html\n";
    }
  }
}

__END__

> -----Original Message-----
> From: Jim Angstadt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 07, 2002 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: Re: perldoc
> 
> 
> 
> --- [EMAIL PROTECTED] wrote:
> > Hi,
> > 
> > Someone recently mentioned that their local HTML
> > perldocs was automagically regenerated after they
> > downloaded and installed new modules. Well, mine
> > never is. I don't care whether it's automagical or
> > not but is there a way of doing it? I suppose it's
> > pod2html, but not sure what all the options are. I
> > was hoping there would be a way to just say
> > "regenerate" keeping all the options as they are...
> > 
> > ta, jamie
> <snip> 
> 
> Hi Jamie,
> 
> Below are two scripts for rebuilding html docs.  
> The first is to rebuild just the table of contents.  
> That might be helpful if you manually add modules 
> to your lib directories.
> 
> # ----------
> #!perl -w
> use strict;
> use ActivePerl::DocTools;
> 
> # Just rebuilts html toc.
> ActivePerl::DocTools::WriteTOC();
> # ----------
> 
> The second script will build the html from pod and 
> then do the toc.  Unfortunately, I did not save the 
> author name.  As I recall, these came out of 
> discussion several months ago on one of the AS list, 
> but I do not remember which list.
> 
> hth,
> Jim
> 
> # ----------
> #!/perl/bin/perl.exe -w
> 
> ###########################################################
> # Just a quick and dirty utility to search for POD
> that 
> # hasn't been converted to HTML by an install or was
> simply
> # unzipped or copied into the site or lib
> subdirectories. 
> # Checks to see if an existing .html version of the
> POD 
> # exists, if not converts it to HTML. After conversion
> the 
> # AS Docs TOC is rebuilt so that all newly added docs
> are listed.
> #
> # *! NOTE: If the install location is not C:\Perl 
> #    (ie: D:\Perl or C:\OthrDir\Perl) then the 
> #  $infile_path_root and $outfile_path_root should be
> changed 
> #   to reflect the install location.
> 
> use strict;
> use Pod::Html;
> use Pod::Find qw(pod_find);
> use ActivePerl::DocTools;
> use File::Path;
> 
> my $infile_path_root = "c:/perl";
> my $outfile_path_root = "c:/perl/html";
> my $logfile = "c:/perl/allpod.txt";
> 
> open LOGFILE, ">>$logfile" || die "couldn't open
> LOGFILE $logfile\n";
> &search_for_pod;
> print LOGFILE "-" x 60, "\n";
> close LOGFILE;
> ActivePerl::DocTools::WriteTOC();
> 
> sub search_for_pod {
>   my %pods = pod_find({ -verbose => 0, -inc => 1 });
>   foreach(sort keys %pods) {
>     convert_pod($_);
>   }
> }
> 
> sub convert_pod {
>   my $podfile = shift;
>   $podfile =~ s#\\#/#g;
>   if ($podfile =~
> m!$infile_path_root/(.*)/(\w+)\.p.+$!i) {
>     my $path = $1;
>     my $name = $2;
>     if (! -e "$outfile_path_root/$path/$name\.html") {
>       mkpath("$outfile_path_root/$path");
>       pod2html( "--infile=$podfile",
>        
> "--outfile=$outfile_path_root/$path/$name.html",
>         "--podroot=$infile_path_root",
>         "--podpath=site/lib:lib",
>       );
>       print LOGFILE "-- Created
> $outfile_path_root/$path/$name.html\n";
>     }
>   }
> }
> 
> 
> # -----
> 
> # pod2html --infile=ppm.pl --outfile=ppm.pl.html
> # pod2html --infile=ppm.bat --outfile=ppm.bat.html
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 


This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. 


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to