From 77cb7e6051c374b94af3c5af1c0d9a4480b0e9e7 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Tue, 11 Jun 2013 19:51:10 -0700 Subject: [PATCH 1/7] Update_Docs: Initial Work to Allow Subdirectory Scanning The changes are not as widespread as it appears, but a large percentage of the code had to be indented Doesn't fully work yet. --- bin/update_docs | 274 ++++++++++++++++++++++++++---------------------- 1 file changed, 149 insertions(+), 125 deletions(-) diff --git a/bin/update_docs b/bin/update_docs index ce8f957d1..201c81744 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -80,130 +80,154 @@ $outdir = '../docs' unless $outdir and -d $outdir; -w $outdir || die "directory $outdir isn't writeable"; mkdir "$outdir/lib" unless -d "$outdir/lib"; -# make list of module and script files in lib so we can extract pod doc later -my %libfiles; -opendir LIB, $libdir || die "can't open $libdir directory: $!"; - -foreach ( readdir LIB ) { - $libfiles{$_}{exists} = 1 if /\.p[lm]$/i; -} +my ( $ipod, $mpod ); +## Get list of possible directories +my %libsubdirs; +opendir LIB, $libdir || die "can't open $libdir directory: $!"; + foreach ( readdir LIB ) { + $libsubdirs{$_}{exists} = 1 if (-d "$libdir/$_" && !($_ =~ /^site/i) + && !($_ =~ /^\./)); + } closedir LIB; -# make list of lib html files so we can delete obsolete ones -my %htmlfiles; -opendir OUT, "$outdir/lib" || die "can't open $outdir/lib directory: $!"; - -foreach ( readdir OUT ) { - $htmlfiles{$_}{exists} = 1 if /\.html$/i; -} - -closedir OUT; - -# convert the pod doc in each changed pl or pm file into html -my $changes = 0; -foreach my $lib ( keys %libfiles ) { - my $libfile = "$libdir/$lib"; - my $htmlfile = "$outdir/lib/$lib"; - $htmlfile =~ s/\.p[lm]$/.html/i; - $libfiles{$lib}{html} = $htmlfile; - - my $mdate = ( stat($libfile) )[9]; - my $hdate = ( stat($htmlfile) )[9]; - - #print "mdate $mdate hdate $hdate $libfile\n"; - if ( !-e $htmlfile or $mdate > $hdate ) { - print "converting $libfile to $htmlfile\n"; - $changes++; - pod2html( - "--title=$lib", "--infile=$libfile", - "--outfile=$htmlfile", "--header", - "--htmlroot=/docs", "--htmldir=$outdir/..", - "--podroot=$docdir", "--podpath=.", - "--css=/lib/pod.css", - ); - } -} - -# check for deleted lib files -foreach ( keys %htmlfiles ) { - my $htmlfile = "$outdir/lib/$_"; - my $pm = $_; - my $pl = $_; - $pm =~ s/\.html$/.pm/i; - $pl =~ s/\.html$/.pl/i; - my $check; #Don't invent keys that dont exist - $check = $pm if( exists( $libfiles{$pm})); - $check = $pl if( exists( $libfiles{$pl})); - if ( !$check or !$libfiles{$check}{exists}) { - $changes++; - print "deleting $htmlfile\n"; - unlink $htmlfile; - } -} - -# write out items and modules lists if any pm files changed -my ( $ipod, $mpod ); -if ($changes) { - my %packages; - foreach my $pm ( keys %libfiles ) { - next unless $pm =~ /.+\.pm$/i; - my $html = $pm; - $html =~ s/\.pm$/.html/i; - my $noext = $pm; - $noext =~ s/\.pm$//i; - my $modfile = "$libdir/$pm"; - my $htmlfile = "$outdir/lib/$html"; - - my $fh; - unless( open( $fh, $modfile) ) { - print "Can't open $modfile, skipping: $!\n"; - next; +## Start foreach loop + +foreach my $libsubdir ( keys %libsubdirs ) { + + ## make outdir if doesn't exist + ## Set libdir and outdir to correct settings + $libdir = "../lib/$libsubdir"; + my $htmldir = "$outdir/lib/$libsubdir"; + mkdir "$htmldir" unless -d "$htmldir"; + +print "[krk] - $libdir - $htmldir"; + + # make list of module and script files in lib so we can extract pod doc later + my %libfiles; + opendir LIB, $libdir || die "can't open $libdir directory: $!"; + + foreach ( readdir LIB ) { + $libfiles{$_}{exists} = 1 if /\.p[lm]$/i; } - my $current_p; - while ( my $l = <$fh> ) { - if ( $l =~ /^package ([^;]+);/ ) { - $current_p = $1; - - #print "found package $current_p in $pm\n"; - $packages{$current_p}{pm} = $pm; - $packages{$current_p}{html} = $html; - $packages{$current_p}{noext} = $noext; - } - elsif ( $l =~ /^sub new / ) { - - #print "found 'new' method in package $current_p in $pm\n"; - $packages{$current_p}{isitem} = 1 if $current_p; - } - elsif ( $l =~ /^=head/ ) { - - #print "found pod directive in package $current_p in $pm\n"; - $packages{$current_p}{haspod} = 1 if $current_p; - } - } - print "didn't find any packages in $pm\n" unless $current_p; - close $fh; - } - - foreach ( sort keys %packages ) { - - #print "package: $_\n"; - s/\//::/g; - my $pod = "=item $_\n\n"; - if ( $packages{$_}{haspod} ) { - $pod .= "L<$_|lib::" . $packages{$_}{noext} . "/$_>\n\n"; - } - else { - $pod .= "package $_ in $packages{$_}{pm} isn't documented yet\n\n"; - } - if ( $packages{$_}{isitem} ) { - $ipod .= $pod; - } - else { - $mpod .= $pod; - } - } -} + + closedir LIB; + + # make list of lib html files so we can delete obsolete ones + my %htmlfiles; + opendir OUT, $htmldir || die "can't open $htmldir directory: $!"; + + foreach ( readdir OUT ) { + $htmlfiles{$_}{exists} = 1 if /\.html$/i; + } + + closedir OUT; + + # convert the pod doc in each changed pl or pm file into html + my $changes = 0; + foreach my $lib ( keys %libfiles ) { + my $libfile = "$libdir/$lib"; + my $htmlfile = "$htmldir/$lib"; + $htmlfile =~ s/\.p[lm]$/.html/i; + $libfiles{$lib}{html} = $htmlfile; + + my $mdate = ( stat($libfile) )[9]; + my $hdate = ( stat($htmlfile) )[9]; + + #print "mdate $mdate hdate $hdate $libfile\n"; + if ( !-e $htmlfile or $mdate > $hdate ) { + print "converting $libfile to $htmlfile\n"; + $changes++; + pod2html( + "--title=$lib", "--infile=$libfile", + "--outfile=$htmlfile", "--header", + "--htmlroot=/docs", "--htmldir=$htmldir/..", + "--podroot=$docdir", "--podpath=.", + "--css=/lib/pod.css", + ); + } + } + + # check for deleted lib files + foreach ( keys %htmlfiles ) { + my $htmlfile = "$htmldir/$_"; + my $pm = $_; + my $pl = $_; + $pm =~ s/\.html$/.pm/i; + $pl =~ s/\.html$/.pl/i; + my $check; #Don't invent keys that dont exist + $check = $pm if( exists( $libfiles{$pm})); + $check = $pl if( exists( $libfiles{$pl})); + if ( !$check or !$libfiles{$check}{exists}) { + $changes++; + print "deleting $htmlfile\n"; + unlink $htmlfile; + } + } + + # write out items and modules lists if any pm files changed + if ($changes) { + my %packages; + foreach my $pm ( keys %libfiles ) { + next unless $pm =~ /.+\.pm$/i; + my $html = $pm; + $html =~ s/\.pm$/.html/i; + my $noext = $pm; + $noext =~ s/\.pm$//i; + my $modfile = "$libdir/$pm"; + my $htmlfile = "$htmldir/$html"; + + my $fh; + unless( open( $fh, $modfile) ) { + print "Can't open $modfile, skipping: $!\n"; + next; + } + my $current_p; + while ( my $l = <$fh> ) { + if ( $l =~ /^package ([^;]+);/ ) { + $current_p = $1; + + #print "found package $current_p in $pm\n"; + $packages{$current_p}{pm} = $pm; + $packages{$current_p}{html} = $html; + $packages{$current_p}{noext} = $noext; + } + elsif ( $l =~ /^sub new / ) { + + #print "found 'new' method in package $current_p in $pm\n"; + $packages{$current_p}{isitem} = 1 if $current_p; + } + elsif ( $l =~ /^=head/ ) { + + #print "found pod directive in package $current_p in $pm\n"; + $packages{$current_p}{haspod} = 1 if $current_p; + } + } + print "didn't find any packages in $pm\n" unless $current_p; + close $fh; + } + + foreach ( sort keys %packages ) { + + #print "package: $_\n"; + s/\//::/g; + my $pod = "=item $_\n\n"; + if ( $packages{$_}{haspod} ) { + $pod .= "L<$_|lib::" . $packages{$_}{noext} . "/$_>\n\n"; + } + else { + $pod .= "package $_ in $packages{$_}{pm} isn't documented yet\n\n"; + } + if ( $packages{$_}{isitem} ) { + $ipod .= $pod; + } + else { + $mpod .= $pod; + } + } + } + +}##Stop loop here? if ($ipod) { print "writing $outdir/items.pod file\n"; @@ -243,11 +267,11 @@ else { s/\.pod$/.html/i; print("deleting $docdir/$_\n"), unlink "$docdir/$_" if -e "$docdir/$_"; } - foreach ( keys %libfiles ) { - s/\.p[lm]$/.html/i; - print("deleting $docdir/lib/$_\n"), unlink "$docdir/lib/$_" - if -e "$docdir/lib/$_"; - } +# foreach ( keys %libfiles ) { +# s/\.p[lm]$/.html/i; +# print("deleting $docdir/lib/$_\n"), unlink "$docdir/lib/$_" +# if -e "$docdir/lib/$_"; +# } print("deleting $docdir/lib/\n"), rmdir "$docdir/lib" if -d "$docdir/lib"; print("deleting $docdir/modules.pod\n"), unlink "$docdir/modules.pod" if -w "$docdir/modules.pod"; From 0d1f2770854ca1578387364a9c40a87cd7475048 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Wed, 12 Jun 2013 17:25:00 -0700 Subject: [PATCH 2/7] Update_Docs: Print SubDir Files in Items and Modules List --- bin/update_docs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/update_docs b/bin/update_docs index 201c81744..83c2a2df7 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -87,22 +87,15 @@ my %libsubdirs; opendir LIB, $libdir || die "can't open $libdir directory: $!"; foreach ( readdir LIB ) { $libsubdirs{$_}{exists} = 1 if (-d "$libdir/$_" && !($_ =~ /^site/i) - && !($_ =~ /^\./)); + && !($_ =~ /^\.\./)); } closedir LIB; -## Start foreach loop - foreach my $libsubdir ( keys %libsubdirs ) { - - ## make outdir if doesn't exist - ## Set libdir and outdir to correct settings $libdir = "../lib/$libsubdir"; my $htmldir = "$outdir/lib/$libsubdir"; mkdir "$htmldir" unless -d "$htmldir"; - -print "[krk] - $libdir - $htmldir"; - + # make list of module and script files in lib so we can extract pod doc later my %libfiles; opendir LIB, $libdir || die "can't open $libdir directory: $!"; @@ -211,9 +204,10 @@ print "[krk] - $libdir - $htmldir"; #print "package: $_\n"; s/\//::/g; + my $class = ($libsubdir eq ".") ? '' : $libsubdir . "::"; my $pod = "=item $_\n\n"; if ( $packages{$_}{haspod} ) { - $pod .= "L<$_|lib::" . $packages{$_}{noext} . "/$_>\n\n"; + $pod .= "L<$_|lib::" . $class . $packages{$_}{noext} . "/$_>\n\n"; } else { $pod .= "package $_ in $packages{$_}{pm} isn't documented yet\n\n"; @@ -225,9 +219,8 @@ print "[krk] - $libdir - $htmldir"; $mpod .= $pod; } } - } - -}##Stop loop here? + } +} if ($ipod) { print "writing $outdir/items.pod file\n"; From 5f9c7dc2806046397b7c78ca138abb35d7de3e2b Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Wed, 12 Jun 2013 17:30:00 -0700 Subject: [PATCH 3/7] Update_Docs: Move Package Sorting Outside of Directory Loop This allows for sorting of the entire list, not just parts of it --- bin/update_docs | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/bin/update_docs b/bin/update_docs index 83c2a2df7..c5957c2ee 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -80,7 +80,9 @@ $outdir = '../docs' unless $outdir and -d $outdir; -w $outdir || die "directory $outdir isn't writeable"; mkdir "$outdir/lib" unless -d "$outdir/lib"; -my ( $ipod, $mpod ); +#Define variables used in creating module and item lists +my ($ipod, $mpod, %packages); +my $changes = 0; ## Get list of possible directories my %libsubdirs; @@ -117,7 +119,6 @@ foreach my $libsubdir ( keys %libsubdirs ) { closedir OUT; # convert the pod doc in each changed pl or pm file into html - my $changes = 0; foreach my $lib ( keys %libfiles ) { my $libfile = "$libdir/$lib"; my $htmlfile = "$htmldir/$lib"; @@ -160,7 +161,6 @@ foreach my $libsubdir ( keys %libsubdirs ) { # write out items and modules lists if any pm files changed if ($changes) { - my %packages; foreach my $pm ( keys %libfiles ) { next unless $pm =~ /.+\.pm$/i; my $html = $pm; @@ -184,6 +184,7 @@ foreach my $libsubdir ( keys %libsubdirs ) { $packages{$current_p}{pm} = $pm; $packages{$current_p}{html} = $html; $packages{$current_p}{noext} = $noext; + $packages{$current_p}{class} = ($libsubdir eq ".") ? '' : $libsubdir . "::"; } elsif ( $l =~ /^sub new / ) { @@ -199,29 +200,30 @@ foreach my $libsubdir ( keys %libsubdirs ) { print "didn't find any packages in $pm\n" unless $current_p; close $fh; } - - foreach ( sort keys %packages ) { - - #print "package: $_\n"; - s/\//::/g; - my $class = ($libsubdir eq ".") ? '' : $libsubdir . "::"; - my $pod = "=item $_\n\n"; - if ( $packages{$_}{haspod} ) { - $pod .= "L<$_|lib::" . $class . $packages{$_}{noext} . "/$_>\n\n"; - } - else { - $pod .= "package $_ in $packages{$_}{pm} isn't documented yet\n\n"; - } - if ( $packages{$_}{isitem} ) { - $ipod .= $pod; - } - else { - $mpod .= $pod; - } - } } } +#Sort Packages and Place into Module or Item List +if ($changes) { + foreach ( sort keys %packages ) { + s/\//::/g; + my $pod = "=item $_\n\n"; + if ( $packages{$_}{haspod} ) { + $pod .= "L<$_|lib::" . $packages{$_}{class} . $packages{$_}{noext} . "/$_>\n\n"; + } + else { + $pod .= "package $_ in $packages{$_}{pm} isn't documented yet\n\n"; + } + if ( $packages{$_}{isitem} ) { + $ipod .= $pod; + } + else { + $mpod .= $pod; + } + } +} + +#Create Item List POD if ($ipod) { print "writing $outdir/items.pod file\n"; open TAR, "> $outdir/items.pod"; @@ -229,6 +231,7 @@ if ($ipod) { close TAR; } +#Create Module List POD if ($mpod) { print "writing $outdir/modules.pod file\n"; open TAR, "> $outdir/modules.pod"; From 9eccb18280c91b2a0d98d439c5a55a1d7692f90b Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Wed, 12 Jun 2013 17:30:00 -0700 Subject: [PATCH 4/7] Update_Docs: Fix Regex Error Used to Distinguish Items from Modules "sub new" should be followed by a whitespace character, but no necessarily a space --- bin/update_docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/update_docs b/bin/update_docs index c5957c2ee..98ad03e26 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -186,7 +186,7 @@ foreach my $libsubdir ( keys %libsubdirs ) { $packages{$current_p}{noext} = $noext; $packages{$current_p}{class} = ($libsubdir eq ".") ? '' : $libsubdir . "::"; } - elsif ( $l =~ /^sub new / ) { + elsif ( $l =~ /^sub new\s/ ) { #print "found 'new' method in package $current_p in $pm\n"; $packages{$current_p}{isitem} = 1 if $current_p; From 3305afd3f0694451c2cc5d8f50985e4ebfe6b538 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Wed, 12 Jun 2013 17:35:00 -0700 Subject: [PATCH 5/7] Update_Docs: Disable code which deleted files in the distro dir; Cleanup internal comments Script previously would delete extra files in the /doc dir even when users had followed the suggested install procedure and used an alternative docs dir. The distribution directory structure should not be modified if users are installing things the way we suggest. --- bin/update_docs | 82 ++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/bin/update_docs b/bin/update_docs index 98ad03e26..d32375122 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -13,10 +13,10 @@ recommended that documentation be created along side the code it relates to. =over -=item html_alias_docs +=item html_alias2_docs This script will write its output to the directory specified in -C, otherwise it will write to C<../docs>. +C, otherwise it will write to C<../docs>. =back @@ -80,11 +80,11 @@ $outdir = '../docs' unless $outdir and -d $outdir; -w $outdir || die "directory $outdir isn't writeable"; mkdir "$outdir/lib" unless -d "$outdir/lib"; -#Define variables used in creating module and item lists +# Define variables used in creating module and item lists my ($ipod, $mpod, %packages); my $changes = 0; -## Get list of possible directories +# Generate the list of directories to scan for pm or pl files my %libsubdirs; opendir LIB, $libdir || die "can't open $libdir directory: $!"; foreach ( readdir LIB ) { @@ -100,22 +100,18 @@ foreach my $libsubdir ( keys %libsubdirs ) { # make list of module and script files in lib so we can extract pod doc later my %libfiles; - opendir LIB, $libdir || die "can't open $libdir directory: $!"; - + opendir LIB, $libdir || die "can't open $libdir directory: $!"; foreach ( readdir LIB ) { $libfiles{$_}{exists} = 1 if /\.p[lm]$/i; - } - + } closedir LIB; # make list of lib html files so we can delete obsolete ones my %htmlfiles; opendir OUT, $htmldir || die "can't open $htmldir directory: $!"; - foreach ( readdir OUT ) { $htmlfiles{$_}{exists} = 1 if /\.html$/i; - } - + } closedir OUT; # convert the pod doc in each changed pl or pm file into html @@ -128,7 +124,7 @@ foreach my $libsubdir ( keys %libsubdirs ) { my $mdate = ( stat($libfile) )[9]; my $hdate = ( stat($htmlfile) )[9]; - #print "mdate $mdate hdate $hdate $libfile\n"; + # If the HTML file older or doesn't exist make a new one if ( !-e $htmlfile or $mdate > $hdate ) { print "converting $libfile to $htmlfile\n"; $changes++; @@ -142,7 +138,7 @@ foreach my $libsubdir ( keys %libsubdirs ) { } } - # check for deleted lib files + # Delete HTML files if the pm or pl file has been deleted foreach ( keys %htmlfiles ) { my $htmlfile = "$htmldir/$_"; my $pm = $_; @@ -179,21 +175,15 @@ foreach my $libsubdir ( keys %libsubdirs ) { while ( my $l = <$fh> ) { if ( $l =~ /^package ([^;]+);/ ) { $current_p = $1; - - #print "found package $current_p in $pm\n"; $packages{$current_p}{pm} = $pm; $packages{$current_p}{html} = $html; $packages{$current_p}{noext} = $noext; $packages{$current_p}{class} = ($libsubdir eq ".") ? '' : $libsubdir . "::"; } elsif ( $l =~ /^sub new\s/ ) { - - #print "found 'new' method in package $current_p in $pm\n"; $packages{$current_p}{isitem} = 1 if $current_p; } elsif ( $l =~ /^=head/ ) { - - #print "found pod directive in package $current_p in $pm\n"; $packages{$current_p}{haspod} = 1 if $current_p; } } @@ -203,7 +193,7 @@ foreach my $libsubdir ( keys %libsubdirs ) { } } -#Sort Packages and Place into Module or Item List +# Sort Packages and Place into Module or Item List if ($changes) { foreach ( sort keys %packages ) { s/\//::/g; @@ -223,7 +213,7 @@ if ($changes) { } } -#Create Item List POD +# Create Item List POD if ($ipod) { print "writing $outdir/items.pod file\n"; open TAR, "> $outdir/items.pod"; @@ -231,7 +221,7 @@ if ($ipod) { close TAR; } -#Create Module List POD +# Create Module List POD if ($mpod) { print "writing $outdir/modules.pod file\n"; open TAR, "> $outdir/modules.pod"; @@ -239,43 +229,47 @@ if ($mpod) { close TAR; } -# make list of pod files so we can convert them to html +# make list of distributed pod files that need to be converted to html my %podfiles; opendir POD, $docdir || die "can't open $docdir directory: $!"; - foreach ( readdir POD ) { $podfiles{$_}{exists} = 1 if /\.pod$/i; } - $podfiles{'items.pod'}{exists} = 1 if -f "$outdir/items.pod"; $podfiles{'modules.pod'}{exists} = 1 if -f "$outdir/modules.pod"; closedir POD; -# delete html files from docs dir if out dir is diff and pod ex +# delete html files from docs dir if out dir is diff and pod exists my $docsi = ( stat($docdir) )[1]; my $outi = ( stat($outdir) )[1]; if ( $docsi eq $outi ) { - print "you should set the html_alias_docs directory to a place outside" - . " the mh distribution\n"; + print "you should set the html_alias2_docs directory to a place outside" + . " the mh distribution\n directory. Otherwise, everytime this script is" + . " run, you will alter\n your distribution files."; } else { - foreach ( keys %podfiles ) { - s/\.pod$/.html/i; - print("deleting $docdir/$_\n"), unlink "$docdir/$_" if -e "$docdir/$_"; - } -# foreach ( keys %libfiles ) { -# s/\.p[lm]$/.html/i; -# print("deleting $docdir/lib/$_\n"), unlink "$docdir/lib/$_" -# if -e "$docdir/lib/$_"; -# } - print("deleting $docdir/lib/\n"), rmdir "$docdir/lib" if -d "$docdir/lib"; - print("deleting $docdir/modules.pod\n"), unlink "$docdir/modules.pod" - if -w "$docdir/modules.pod"; - print("deleting $docdir/items.pod\n"), unlink "$docdir/items.pod" - if -w "$docdir/items.pod"; + # the following would delete files from the distribution docs dir + # When MisterHouse is installed in the recommended fashion, this deletes a + # number of files from the distribution directory structure. I am disabling + # for the moment, as I don't think we should be altering the distribution + # directory structure + #foreach ( keys %podfiles ) { + # s/\.pod$/.html/i; + # print("deleting $docdir/$_\n"), unlink "$docdir/$_" if -e "$docdir/$_"; + #} + #foreach ( keys %libfiles ) { + # s/\.p[lm]$/.html/i; + # print("deleting $docdir/lib/$_\n"), unlink "$docdir/lib/$_" + # if -e "$docdir/lib/$_"; + #} + #print("deleting $docdir/lib/\n"), rmdir "$docdir/lib" if -d "$docdir/lib"; + #print("deleting $docdir/modules.pod\n"), unlink "$docdir/modules.pod" + # if -w "$docdir/modules.pod"; + #print("deleting $docdir/items.pod\n"), unlink "$docdir/items.pod" + # if -w "$docdir/items.pod"; } -# convert any modified pod files to html +# convert any modified distributed pod files to html foreach my $doc ( keys %podfiles ) { my $podfile = "$docdir/$doc"; my $ind = ""; @@ -290,11 +284,9 @@ foreach my $doc ( keys %podfiles ) { $pdate = ( stat($podfile) )[9] if -f $podfile; $hdate = ( stat($htmlfile) )[9] if -f $htmlfile; - #print "pdate $pdate hdate $hdate : $doc\n"; if ( !-e "$outdir/$doc.html" or $pdate > $hdate ) { print "pod2html $podfile > $htmlfile\n"; - #`pod2html --htmlroot $outdir $docdir/$doc.pod > $outdir/$doc.html`; pod2html( "--infile=$podfile", "--outfile=$htmlfile", "--noheader", From 3ecfe5158493b22a0349dbf5d6f77bb21dc099b2 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Wed, 12 Jun 2013 18:45:13 -0700 Subject: [PATCH 6/7] Format Docs: Make Head3 Larger, Add Head4 Style It looked silly to have heading 3 smaller than the body text. Heading4 is not often used, but it should be defined to avoid the default setting in browsers. --- web/lib/pod.css | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/lib/pod.css b/web/lib/pod.css index 71ba2c74f..7f32e3b0f 100644 --- a/web/lib/pod.css +++ b/web/lib/pod.css @@ -103,8 +103,16 @@ h2 { } h3 { - font: 0.8em "ITC Garamond", Garamond, Georgia, "Times New Roman", Times, serif; + font: 1.0em "ITC Garamond", Garamond, Georgia, "Times New Roman", Times, serif; + color: #36497d; + margin-top: 9px; + margin-bottom: 3px; +} + +h4 { + font: 1.0em "ITC Garamond", Garamond, Georgia, "Times New Roman", Times, serif; color: #36497d; + margin-left: 30px; margin-top: 9px; margin-bottom: 3px; } From 8f7a6a955b4e1fecaa32b732a3c7f4a08efa3c8f Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Thu, 13 Jun 2013 17:00:06 -0700 Subject: [PATCH 7/7] Update Docs: Fix Pod2Html Commands so Links Are Created; Modify Example.pod The settings in pod2html were preventing proper links from being created. The new settings allow it to properly search the pod directories Updated Example.pod to suggest using a link to identify inherited objects. --- bin/update_docs | 4 ++-- lib/ExamplePOD.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/update_docs b/bin/update_docs index d32375122..2ca9526ce 100755 --- a/bin/update_docs +++ b/bin/update_docs @@ -131,8 +131,8 @@ foreach my $libsubdir ( keys %libsubdirs ) { pod2html( "--title=$lib", "--infile=$libfile", "--outfile=$htmlfile", "--header", - "--htmlroot=/docs", "--htmldir=$htmldir/..", - "--podroot=$docdir", "--podpath=.", + "--htmlroot=/docs/lib", "--htmldir=$htmldir/", + "--podroot=../lib", "--podpath=.", "--css=/lib/pod.css", ); } diff --git a/lib/ExamplePOD.pm b/lib/ExamplePOD.pm index 412504eb5..4a2950384 100644 --- a/lib/ExamplePOD.pm +++ b/lib/ExamplePOD.pm @@ -10,7 +10,7 @@ =head2 INHERITS -B<---Inherited Items---> +L<---Inherited Items---> =head2 METHODS