# HG changeset patch # User adb014 # Date 1160684688 0 # Node ID 6548c639892b0f9fe47d5f22d69378a4f3f6a073 # Parent e25f9a6bec9e7c8fd7a6de7b1f2b0d3b5d9751a4 Create a seperate page list only the contents of a package alphabetically diff -r e25f9a6bec9e -r 6548c639892b admin/make_index --- a/admin/make_index Thu Oct 12 20:23:49 2006 +0000 +++ b/admin/make_index Thu Oct 12 20:24:48 2006 +0000 @@ -63,6 +63,7 @@ # [toolbox_2,category_2],..] my %TB_description = (); my %index_notes = (); # index_notes{function} = comment +my %index_by_package = (); # i_package{package} = list of functions # find and load all indices my @index_files = (); @@ -512,8 +513,15 @@ } else { ++$n_functions; } - - $octave_forge_function{$function} = 1 unless $file =~ /^$OCTAVE/; + if (! ($file =~ /^$OCTAVE/)) { + $octave_forge_function{$function} = 1; + my $package = $file; + $package =~ s|^\s*([^/]+/[^/]+/).*$|$1|; + if ($package =~ /^\s*$/) { + printf("%-12s %-20s %s\n", $function, $file, $package); + } + push @{$index_by_package{$package}}, $function; + } if (!defined $index_by_function{$function}) { my $entry = $file; $entry = "$file: $function" if $file !~ /[.]m$/; @@ -652,6 +660,9 @@ #write_TBnavbar($_); write_TBdetails($_); } + foreach ( package_list() ) { + write_package_details($_); + } # Write one file for each letter. # @@ -846,6 +857,48 @@ print OUT "__TRAILER__\n"; close(OUT); } # 1}}} +sub write_package_details { # 1{{{ + my $packdir = shift; + my $package; + my $title; + my $desc = sprintf("%s/DESCRIPTION", $packdir); + open(IN, $desc) or die "Cannot read $desc: $!\n"; + while() { + if (/^[Nn]ame:/) { + chomp; + s/^[Nn]ame:\s*//; + s/\s*$//; + $package = lc($_); + } elsif (/^[Tt]itle:/) { + chomp; + s/^[Tt]itle:\s*//; + s/\s*$//; + $title = $_; + } + } + close(IN); + my $file = "$catdir/funref_$package.in"; + + open(OUT, ">$file") or die "Cannot write $file: $!\n"; + print OUT <\n"; + foreach my $func ( pack_list($packdir) ) { + + # column 1: the function (x-ref to full description in + # cvs-tree's html file) + print OUT "
",func_ref($func,$func),"\n"; + print OUT " ", download_ref($func), "
\n"; + + # column 2: the description, if it exists + # + print OUT "
",html_desc($func),"\n"; + } + print OUT "\n"; + print OUT "__TRAILER__\n"; + close(OUT); +} # 1}}} sub write_alphabetic_navbar { # 1{{{ open(OUT,">$catdir/alphabetic.include") or die "Could not open $catdir/alphabetic.include"; @@ -1086,11 +1139,20 @@ # toolbox_list() returns an ordered list of toolboxes. return sort { uc($a) cmp uc($b) } keys %index_by_TB_cat; } # 1}}} +sub package_list { # 1{{{ +# package_list() returns an ordered list of package directories. + return sort { uc($a) cmp uc($b) } keys %index_by_package; +} # 1}}} sub cat_list { # 1{{{ # cat_list($TB) returns an ordered list of categories in a toolbox $TB. my ($TB) = @_; return sort keys %{$index_by_TB_cat{$TB}}; } # 1}}} +sub pack_list { # 1{{{ +# pack_list($package) returns an ordered list of functions in a package directory. + my ($package) = @_; + return sort @{$index_by_package{$package}}; +} # 1}}} sub cat_funcs { # 1{{{ # cat_funcs($TB,$cat) returns an ordered list of functions in $TB,$cat my ($TB,$cat) = @_;