#!/usr/freeware/bin/perl ###################################################################### # Creates a document tree from the installed Persistent classes. ###################################################################### use Pod::Html; ### copy the pod/pm directory structure over ### print "----------------------------------------\n"; print "Copying POD source tree over...\n"; print "----------------------------------------\n"; `cp -r /usr/freeware/lib/perl5/site_perl/5.005/Persistent* .`; ### convert the POD to HTML ### print "----------------------------------------\n"; print "Converting POD to HTML...\n"; print "----------------------------------------\n"; pod2html("--podpath=.", "--podroot=.", "--htmlroot=.", "--recurse", "--infile=Persistent.pod", "--outfile=Persistent.html"); chdir 'Persistent'; foreach my $file (<*.pm>) { my($basename, $ext) = split(/\./, $file); pod2html("--podpath=.", "--podroot=..", "--htmlroot=..", "--recurse", "--infile=${basename}.pm", "--outfile=${basename}.html"); } chdir 'DataType'; foreach my $file (<*.pm>) { my($basename, $ext) = split(/\./, $file); pod2html("--podpath=.", "--podroot=../..", "--htmlroot=../..", "--recurse", "--libpods=perlfunc", "--infile=${basename}.pm", "--outfile=${basename}.html"); } ### remove the pod/pm files ### print "----------------------------------------\n"; print "Removing POD source...\n"; print "----------------------------------------\n"; unlink <*.pm>; unlink ; chdir '..'; unlink <*.pm>; unlink ; chdir '..'; unlink <*.pod>; unlink ; ### clean up the generated HTML ### print "----------------------------------------\n"; print "Cleaning up generated HTML...\n"; print "----------------------------------------\n"; clean_up_html_in_cur_dir(); chdir 'Persistent'; clean_up_html_in_cur_dir(); chdir 'DataType'; clean_up_html_in_cur_dir(); ### cleans up the HTML in a file ### sub clean_up_html_in_cur_dir { foreach my $file (<*.html>) { open(IN, "<$file") or die "Can't open $file: $!"; open(OUT, ">$file.NEW") or die "Can't open $file.NEW: $!"; foreach () { s/>the (\w+) manpage$1BasePersistent::BaseDBIPersistent::DBIDBMPersistent::DBMFilePersistent::FileLDAPPersistent::LDAPMemoryPersistent::MemoryMySQLPersistent::MySQLOraclePersistent::OracleSybasePersistent::SybasemSQLPersistent::mSQLDataType::BasePersistent::DataType::BaseDataType::CharPersistent::DataType::CharDataType::DateTimePersistent::DataType::DateTimeDataType::NumberPersistent::DataType::NumberDataType::StringPersistent::DataType::StringDataType::VarCharPersistent::DataType::VarChar