[system] / trunk / webwork-modperl / bin / mkhtmldocs Repository:
ViewVC logotype

View of /trunk/webwork-modperl/bin/mkhtmldocs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1663 - (download) (annotate)
Tue Dec 9 01:12:32 2003 UTC (9 years, 5 months ago) by sh002i
File size: 2002 byte(s)
Normalized headers. All files now contain the text below as a header.
This is important since all files now (a) use the full name of the
package, (b) assign copyright to "The WeBWorK Project", (c) give the
full path of the file (relative to CVSROOT) instead of simply the file
name, and (d) include license and warranty information.

Here is the new header:

################################################################################
# WeBWorK Online Homework Delivery System
# Copyright © 2000-2003 The WeBWorK Projcct, http://openwebwork.sf.net/
# $CVSHeader$
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of either: (a) the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version, or (b) the "Artistic License" which comes with this package.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
# Artistic License for more details.
################################################################################

    1 #!/usr/bin/env perl
    2 ################################################################################
    3 # WeBWorK Online Homework Delivery System
    4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/
    5 # $CVSHeader$
    6 # 
    7 # This program is free software; you can redistribute it and/or modify it under
    8 # the terms of either: (a) the GNU General Public License as published by the
    9 # Free Software Foundation; either version 2, or (at your option) any later
   10 # version, or (b) the "Artistic License" which comes with this package.
   11 # 
   12 # This program is distributed in the hope that it will be useful, but WITHOUT
   13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   14 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   15 # Artistic License for more details.
   16 ################################################################################
   17 
   18 =head1 NAME
   19 
   20 mkhtmldocs - use pod2html to generate HTML documentation
   21 
   22 =cut
   23 
   24 use strict;
   25 use warnings;
   26 use FindBin;
   27 
   28 # set this to the URL of the htdocs/doc directory.
   29 use constant DOC_BASE => "/webwork2_files/doc";
   30 # FIXME: this should probably be read from global.conf.
   31 
   32 sub main(@) {
   33 	my $force = @_ && $_[0] eq "-f";
   34 	
   35 	my $lib = "$FindBin::Bin/../lib";
   36 	my $htdocs = "$FindBin::Bin/../htdocs";
   37 	my $doc = "$htdocs/doc";
   38 	my $htmlroot = DOC_BASE;
   39 	
   40 	my @modules = `find $lib -name "*.pm"`;
   41 	foreach my $module (@modules) {
   42 		chomp $module;
   43 		
   44 		my $docfile = $module;
   45 		$docfile =~ s/^$lib/$doc/;
   46 		$docfile =~ s/\.pm$/.html/;
   47 		
   48 		next if not $force and -e $docfile and (stat $docfile)[9] >= (stat $module)[9];
   49 		
   50 		my ($docdir) = $docfile =~ m|^(.*)/|;
   51 		unless (-e $docdir) {
   52 			print "creating missing directory $docdir\n";
   53 			system "mkdir -p $docdir"
   54 				and die "mkdir failed: $!\n";
   55 		}
   56 		
   57 		print "generating documentation for module $module\n";
   58 		system "pod2html --htmlroot=$htmlroot --podroot=$lib --infile=$module --outfile=$docfile"
   59 			and die "pod2html failed: $!\n";
   60 	}
   61 }
   62 
   63 main(@ARGV);

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9