X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=tools%2FPM-Pod2html-snippet.pl;h=b1393ddabe9af6218fe8cc5f0b330b5df5323f43;hb=b82df1356a6be5ab828d198947fe0e5b76efd735;hp=5388059d5af91414856cbc5ba5aac2615d57f64b;hpb=cecf3e65d57dadbe955294a275e4408ff5e5ea31;p=sdlgit%2FSDL-Site.git diff --git a/tools/PM-Pod2html-snippet.pl b/tools/PM-Pod2html-snippet.pl index 5388059..b1393dd 100644 --- a/tools/PM-Pod2html-snippet.pl +++ b/tools/PM-Pod2html-snippet.pl @@ -38,6 +38,35 @@ for my $key (sort keys %files) my @matches = ( $files{$key}{'section'} =~ m/\w+/xg ); + if($#matches) + { + my $section_path = ''; + my $doit = 1; + + for my $section (@matches) + { + last if $section eq $matches[$#matches]; + + $section_path .= (length($section_path) ? ', ' : '') . $section; + + if($last_section =~ /^$section_path/) + { + $doit = 0; + } + } + + if($doit) + { + my @this_matches = ( $section_path =~ m/\w+/xg ); + my $i = 0; + for my $this_section (@this_matches) + { + printf($fh '', + $i++ * 30, $this_section); + } + } + } + if($last_section ne $files{$key}{'section'}) { print ($fh '
%s
') if $last_section;