2 package IkiWiki::Plugin::format;
9 hook(type => "preprocess", id => "format", call => \&preprocess);
16 my $text=IkiWiki::preprocess($params{page}, $params{destpage}, shift);
19 if (! defined $format || ! defined $text) {
20 error(gettext("must specify format and text"));
22 elsif (exists $IkiWiki::hooks{htmlize}{$format}) {
23 return IkiWiki::htmlize($params{page}, $params{destpage},
27 # Other plugins can register htmlizefallback
28 # hooks to add support for page types
29 # not suitable for htmlize. Try them until
32 IkiWiki::run_hooks(htmlizefallback => sub {
33 $ret=shift->($format, $text)
36 return $ret if defined $ret;
38 error(sprintf(gettext("unsupported page format %s"), $format));