Process .md like .mdwn, but disallow web creation.

master
Amitai Schlair 2016-03-08 14:31:15 -05:00
parent cc0e6b77f0
commit 63fa0ef5ba
4 changed files with 7 additions and 3 deletions

View 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;

View 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;

View 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 () {

View 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;