]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Process .md like .mdwn, but disallow web creation.
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Tue, 8 Mar 2016 19:31:15 +0000 (14:31 -0500)
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>
Tue, 8 Mar 2016 19:31:15 +0000 (14:31 -0500)
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/rename.pm

index e93db94ebc0f02d5e940d9092cd894fb9362c20e..b47f965e7b76359d391a5a63db8fbfc2c215a46a 100644 (file)
@@ -356,7 +356,8 @@ sub editcomment ($$) {
        my @page_types;
        if (exists $IkiWiki::hooks{htmlize}) {
                foreach my $key (grep { !/^_/ && isallowed($_) } keys %{$IkiWiki::hooks{htmlize}}) {
-                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key];
+                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]
+                               unless $IkiWiki::hooks{htmlize}{$key}{nocreate};
                }
        }
        @page_types=sort @page_types;
index 78d0704c7fd3b699acbb65df391e475b29fae52b..6ca4b589f507ae595d36bb802a97ee9640f0b9bd 100644 (file)
@@ -305,7 +305,8 @@ sub cgi_editpage ($$) {
                        my @page_types;
                        if (exists $hooks{htmlize}) {
                                foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) {
-                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key];
+                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key]
+                                               unless $hooks{htmlize}{$key}{nocreate};
                                }
                        }
                        @page_types=sort @page_types;
index 014e78eea124604e249d35d42a6b9ccf6524c254..daf9d592e4189e1e06d279b568e43db3b3858262 100644 (file)
@@ -9,6 +9,7 @@ use IkiWiki 3.00;
 sub import {
        hook(type => "getsetup", id => "mdwn", call => \&getsetup);
        hook(type => "htmlize", id => "mdwn", call => \&htmlize, longname => "Markdown");
+       hook(type => "htmlize", id => "md", call => \&htmlize, longname => "Markdown (popular file extension)", nocreate => 1);
 }
 
 sub getsetup () {
index 6d56340b896519e921e9b6c7d8a06ffd1d56fe2a..4a86d5a09b11f1e5097b053c6624cf0080f13796 100644 (file)
@@ -141,7 +141,8 @@ sub rename_form ($$$) {
                my @page_types;
                if (exists $IkiWiki::hooks{htmlize}) {
                        foreach my $key (grep { !/^_/ } keys %{$IkiWiki::hooks{htmlize}}) {
-                               push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key];
+                               push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]
+                                       unless $IkiWiki::hooks{htmlize}{$key}{nocreate};
                        }
                }
                @page_types=sort @page_types;