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