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