Merge commit 'remotes/jmtd/friendly_markup_names'
authorJoey Hess <joey@gnu.kitenet.net>
Sat, 16 May 2009 14:37:15 +0000 (10:37 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sat, 16 May 2009 14:37:15 +0000 (10:37 -0400)
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/textile.pm
doc/plugins/write.mdwn

index 0068a6b118cd15ca7e110a51fdf81fa1ab313526..af42097baedc2acb46534e9c818e0124ec0dc82b 100644 (file)
@@ -276,8 +276,9 @@ sub cgi_editpage ($$) {
                        
                        my @page_types;
                        if (exists $hooks{htmlize}) {
-                               @page_types=grep { !/^_/ }
-                                       keys %{$hooks{htmlize}};
+                               foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) {
+                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key];
+                               }
                        }
                        
                        $form->tmpl_param("page_select", 1);
index 0e134c8224f470c6cc101e0b14e6106c44a541e6..c62780cb892b37a9c5dd8b6c5230bdd4e4567d2e 100644 (file)
@@ -8,7 +8,7 @@ use IkiWiki 3.00;
 
 sub import {
        hook(type => "getsetup", id => "mdwn", call => \&getsetup);
-       hook(type => "htmlize", id => "mdwn", call => \&htmlize);
+       hook(type => "htmlize", id => "mdwn", call => \&htmlize, longname => "Markdown");
 }
 
 sub getsetup () {
index b604aa3c52ab1d0fe34b686a4634920ac6310dc6..8cc5a7951d3575e67b221ca312993fff158bae20 100644 (file)
@@ -11,7 +11,7 @@ use Encode;
 
 sub import {
        hook(type => "getsetup", id => "textile", call => \&getsetup);
-       hook(type => "htmlize", id => "txtl", call => \&htmlize);
+       hook(type => "htmlize", id => "txtl", call => \&htmlize, longname => "Textile");
 }
 
 sub getsetup () {
index 28da243d5072fdfa6bd3e87d49b33473fd7f6b4c..d0f6a09e1ac9127efed521713c5b1be7182ba4d2 100644 (file)
@@ -198,6 +198,9 @@ value, then the id parameter specifies not a filename extension, but
 a whole filename that can be htmlized. This is useful for files
 like `Makefile` that have no extension.
 
+If `hook` is passed an optional "longname" parameter, this value is used
+when prompting a user to choose a page type on the edit page form.
+
 ### pagetemplate
 
        hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);