From: Wolfgang Bangerth Date: Mon, 29 Jan 2018 22:13:20 +0000 (-0700) Subject: Sort entries to the code gallery by their name, not their directory name. X-Git-Tag: v9.0.0-rc1~485^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5827%2Fhead;p=dealii.git Sort entries to the code gallery by their name, not their directory name. --- diff --git a/doc/doxygen/scripts/code-gallery.pl b/doc/doxygen/scripts/code-gallery.pl index 04a514828e..190893d4ba 100644 --- a/doc/doxygen/scripts/code-gallery.pl +++ b/doc/doxygen/scripts/code-gallery.pl @@ -29,10 +29,15 @@ while (my $line = ) print $line; } -# print the list of code gallery programs as a descriptor/description -# list -print "
\n"; -foreach my $gallery (sort @ARGV) +# create a list of code gallery program descriptions. we will later +# output this as a descriptor/description list, but for the moment +# we will simply create each entry as a string, and insert it in +# a map keyed by the entry's name so that we can later output them +# in a way that looks sorted on the screen, rather than is sorted +# by the directory name (which looks pretty random to the human +# reader) +my %descriptions; +foreach my $gallery (@ARGV) { my $gallery_underscore = $gallery; @@ -57,14 +62,26 @@ foreach my $gallery (sort @ARGV) $authors =~ s/,$//; $gallery_underscore =~ s/-/_/; - print "
\@ref code_gallery_${gallery_underscore} \"$entryname\" (by $authors)
\n"; - print "
\n"; + + my $description; + $description = "
\@ref code_gallery_${gallery_underscore} \"$entryname\" (by $authors)
\n"; + $description = $description . "
\n"; open TOOLTIP, "<$gallery_dir/$gallery/doc/tooltip"; while (my $line = ) { - print " $line"; + $description = $description . " $line"; } - print "
\n"; - print "\n"; + $description = $description . " \n"; + $description = $description . "\n"; + + # now insert this description into the map mentioned above + $descriptions{$entryname} = $description; +} + +# now print the entries generated above sorted by their keys +print "
\n"; +foreach my $key (sort keys %descriptions) +{ + print $descriptions{$key}; } print "
\n";