--- [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

Reply via email to