home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _c7119fbdd9d7ec9b849aee10b96458cb < prev    next >
Text File  |  2004-06-01  |  2KB  |  95 lines

  1. package ActivePerl::DocTools;
  2.  
  3. use strict;
  4. use warnings;
  5. use Exporter ();
  6.  
  7. our @ISA = 'Exporter';
  8. our @EXPORT = qw(UpdateHTML);
  9.  
  10. use ActivePerl::DocTools::TOC::HTML;
  11. use ActivePerl::DocTools::TOC::RDF;
  12.  
  13. use ActivePerl::DocTools::Tree::HTML;
  14.  
  15. our $VERSION = 0.04;
  16.  
  17. our $dirbase = $ActivePerl::DocTools::TOC::dirbase;
  18.  
  19. sub WriteTOC {
  20.     my $fh;
  21.     unless (open $fh, '>', "$dirbase/perltoc.html") {
  22.     warn "Unable to open $dirbase/perltoc.html for writing: $!\n";
  23.     return undef;
  24.     }
  25.  
  26.     my $html_toc = ActivePerl::DocTools::TOC::HTML->new();
  27.     print $fh $html_toc->TOC();
  28. }
  29.  
  30. sub WriteRDF {
  31.     my $rdf_toc = ActivePerl::DocTools::TOC::RDF->new();
  32.     print $rdf_toc->TOC();
  33. }
  34.  
  35. sub UpdateHTML {
  36.     # if $noisy is false, ignores errors
  37.     # if $noisy is "wait", waits for confirmation
  38.     # else dies if there are errors
  39.     my $noisy = shift;
  40.     eval {
  41.     ActivePerl::DocTools::Tree::HTML::Update();
  42.     WriteTOC();
  43.     };
  44.     if ($@ and $noisy) {
  45.     if ($noisy eq 'wait') {
  46.         # this is somewhat bletcherous
  47.         print "Error building documentation: $@\n";
  48.         print "Press [Enter] to continue\n";
  49.         <STDIN>;
  50.         exit 1;
  51.     }
  52.     die $@;
  53.     }
  54. }
  55.  
  56. 1;
  57.  
  58. __END__
  59.  
  60. #=head1 NAME
  61.  
  62. ActivePerl::DocTools - Perl extension for Documentation TOC Generation
  63.  
  64. #=head1 SYNOPSIS
  65.  
  66.     use ActivePerl::DocTools;
  67.     
  68.     ActivePerl::DocTools::WriteTOC();
  69.  
  70. #=head1 DESCRIPTION
  71.  
  72. Generates the TOC for Perl html docs. Currently used by PPM.
  73.  
  74. Much of the code that used to be in this module has been moved
  75. out into the ActivePerl::DocTools::TOC packages. However, the
  76. ActivePerl::DocTools::WriteTOC() function has been preserved for
  77. compatibility with PPM.
  78.  
  79. #=head2 EXPORTS
  80.  
  81. Nothing.
  82.  
  83. #=head1 AUTHOR
  84.  
  85. David Sparks, DaveS@ActiveState.com
  86. Neil Kandalgaonkar, NeilK@ActiveState.com
  87.  
  88. #=head1 SEE ALSO
  89.  
  90. The amazing L<PPM>.
  91.  
  92. L<ActivePerl::DocTools::TOC>
  93.  
  94. #=cut
  95.