ispman/scripts makedocs,1.6,1.7
Joerg Delker <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19683/scripts Modified Files: makedocs Log Message: perltidy (2nd run) Index: makedocs =================================================================== RCS file: /cvsroot/ispman/ispman/scripts/makedocs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- makedocs 4 Jan 2004 18:56:16 -0000 1.6 +++ makedocs 31 May 2004 20:13:41 -0000 1.7 @@ -3,102 +3,103 @@ # a script full of GLOBALS :) use Pod::Html; -$pwd=$ARGV[0]||"."; +$pwd = $ARGV[0] || "."; chdir $pwd; [email protected]=`find ISPMan -type f -name "*.pm"`; - [email protected] = `find ISPMan -type f -name "*.pm"`; system("mkdir -p tmp/pod"); -for (@pms){ - $subs={}; - chomp; - $file=$_; - s/^ISPMan\///; - $module=$_; - $module=~s/\.pm$//; - $module=~s/\//::/g; - $modules->{$module}{'file'}=$file; - $text=""; - $_head_pod=""; - $_end_pod=""; - open "F", "$file" or die "Cant open $!"; - while (<F>){ - $text.=$_; - $subs->{$1}++ if /\s*sub\s\s*(\w+)/; - } - close("F"); - for $sub(keys %$subs){ - ($subs->{$sub}) = $text=~m/sub $sub[\w\W]*?(=item B<$sub>[\w\W]*?=cut)/; - } - $modules->{$module}{'subs'}= $subs; - ($_head_pod) = $text=~m!(\=head1 NAME[\w\W]*?=cut)!; - ($_end_pod) = $text=~m!__END__([\w\W]*?=cut)!; - - $_head_pod=~s/^\s\s*//g; - $_end_pod=~s/^\s\s*//g; - $_head_pod=~s/\s\s*$//g; - $_end_pod=~s/\s\s*$//g; - $_pod=""; - $_pod=($_head_pod eq $_end_pod)?$_head_pod:join "\n", ($_head_pod, $_end_pod); - $modules->{$module}{'pod'}=$_pod if $_pod; - +for (@pms) { + $subs = {}; + chomp; + $file = $_; + s/^ISPMan\///; + $module = $_; + $module =~ s/\.pm$//; + $module =~ s/\//::/g; + $modules->{$module}{'file'} = $file; + $text = ""; + $_head_pod = ""; + $_end_pod = ""; + open "F", "$file" or die "Cant open $!"; + + while (<F>) { + $text .= $_; + $subs->{$1}++ if /\s*sub\s\s*(\w+)/; + } + close("F"); + for $sub ( keys %$subs ) { + ( $subs->{$sub} ) = + $text =~ m/sub $sub[\w\W]*?(=item B<$sub>[\w\W]*?=cut)/; + } + $modules->{$module}{'subs'} = $subs; + ($_head_pod) = $text =~ m!(\=head1 NAME[\w\W]*?=cut)!; + ($_end_pod) = $text =~ m!__END__([\w\W]*?=cut)!; + + $_head_pod =~ s/^\s\s*//g; + $_end_pod =~ s/^\s\s*//g; + $_head_pod =~ s/\s\s*$//g; + $_end_pod =~ s/\s\s*$//g; + $_pod = ""; + $_pod = ( $_head_pod eq $_end_pod ) ? $_head_pod : join "\n", + ( $_head_pod, $_end_pod ); + $modules->{$module}{'pod'} = $_pod if $_pod; } -$c=0; +$c = 0; +$index = "<html><head></head><body bgcolor=white><font face=Helvetica size=3>"; -$index="<html><head></head><body bgcolor=white><font face=Helvetica size=3>"; +for $module ( sort keys %$modules ) { + $moduleFile = "$module\.html"; + $moduleFile =~ s!::!/!g; -for $module(sort keys %$modules){ - $moduleFile="$module\.html"; - $moduleFile=~s!::!/!g; - - $moduleIndex="<br><b>"; - if ($modules->{$module}{'pod'}) { - $moduleIndex.="<a target=api_content href='$moduleFile'>$module</a>"; - } else { - $moduleIndex.="$module"; - } - $moduleIndex.="</b>"; + $moduleIndex = "<br><b>"; + if ( $modules->{$module}{'pod'} ) { + $moduleIndex .= "<a target=api_content href='$moduleFile'>$module</a>"; + } + else { + $moduleIndex .= "$module"; + } + $moduleIndex .= "</b>"; - for $sub(keys %{$modules->{$module}{'subs'}}){ - $c++; - if ($modules->{$module}{'subs'}{$sub}){ - print "Generating documentation for $module\:\:$sub\n"; - open "T", ">tmp/pod/tmppodin$c.pod"; - print T "=head1 $module\:\:$sub\n\n"; - print T "=over 4\n\n"; - print T $modules->{$module}{'subs'}{$sub}; - close "T"; - $outfile=$module; - $outfile=~s!::!/!g; - $subLink="$outfile/$sub\.html"; - $moduleIndex.="<br> <a target=api_content href='$subLink'>$sub</a>"; - $dir= "ispman-web/htdocs/docs/API/$outfile"; - system("mkdir -p $dir"); - $out= "ispman-web/htdocs/docs/API/$outfile/$sub.html\n"; - pod2html("--infile=tmp/pod/tmppodin$c.pod", "--outfile=$out"); - } - } - if ($modules->{$module}{'pod'}) { - open "T", ">tmp/pod/podtmppodin$c.pod"; - print T $modules->{$module}{'pod'}; - close "T"; - $outfile="ispman-web/htdocs/docs/API/$moduleFile"; - pod2html("--infile=tmp/pod/podtmppodin$c.pod", "--outfile=$outfile"); - } - $index.="<br>$moduleIndex"; + for $sub ( keys %{ $modules->{$module}{'subs'} } ) { + $c++; + if ( $modules->{$module}{'subs'}{$sub} ) { + print "Generating documentation for $module\:\:$sub\n"; + open "T", ">tmp/pod/tmppodin$c.pod"; + print T "=head1 $module\:\:$sub\n\n"; + print T "=over 4\n\n"; + print T $modules->{$module}{'subs'}{$sub}; + close "T"; + $outfile = $module; + $outfile =~ s!::!/!g; + $subLink = "$outfile/$sub\.html"; + $moduleIndex .= + "<br> <a target=api_content href='$subLink'>$sub</a>"; + $dir = "ispman-web/htdocs/docs/API/$outfile"; + system("mkdir -p $dir"); + $out = "ispman-web/htdocs/docs/API/$outfile/$sub.html\n"; + pod2html( "--infile=tmp/pod/tmppodin$c.pod", "--outfile=$out" ); + } + } + if ( $modules->{$module}{'pod'} ) { + open "T", ">tmp/pod/podtmppodin$c.pod"; + print T $modules->{$module}{'pod'}; + close "T"; + $outfile = "ispman-web/htdocs/docs/API/$moduleFile"; + pod2html( "--infile=tmp/pod/podtmppodin$c.pod", "--outfile=$outfile" ); + } + $index .= "<br>$moduleIndex"; } open "M", ">ispman-web/htdocs/docs/API/index.htm"; print M $index; close("M"); - -open ("I", ">ispman-web/htdocs/docs/API/index.html"); +open( "I", ">ispman-web/htdocs/docs/API/index.html" ); print I qq| <HTML> <HEAD><title>ISPMan API DOCS</title> ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click