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"));
33 # Other plugins can register htmlizeformat hooks to add support
34 # for page types not suitable for htmlize, or that need special
35 # processing when included via format. Try them until one succeeds.
37 IkiWiki::run_hooks(htmlizeformat => sub {
38 $ret=shift->($format, $text)
45 elsif (exists $IkiWiki::hooks{htmlize}{$format}) {
46 return IkiWiki::htmlize($params{page}, $params{destpage},
50 error(sprintf(gettext("unsupported page format %s"), $format));