From 27193a2eeba3aa2f5ed8c0168f828149696b2b7f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 May 2009 15:50:25 -0400 Subject: support longname for page types in commands and rename Also, sort the list of page types. --- IkiWiki/Plugin/rename.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin/rename.pm') diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 41af3ca4d..0b6e74705 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -116,14 +116,16 @@ sub rename_form ($$$) { # insert the standard extensions my @page_types; if (exists $IkiWiki::hooks{htmlize}) { - @page_types=grep { !/^_/ } - keys %{$IkiWiki::hooks{htmlize}}; + foreach my $key (grep { !/^_/ } keys %{$IkiWiki::hooks{htmlize}}) { + push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]; + } } + @page_types=sort @page_types; # make sure the current extension is in the list my ($ext) = $pagesources{$page}=~/\.([^.]+)$/; if (! $IkiWiki::hooks{htmlize}{$ext}) { - unshift(@page_types, $ext); + unshift(@page_types, [$ext, $ext]); } $f->field(name => "type", type => 'select', -- cgit v1.2.3