2 # haiku generator plugin
3 package IkiWiki::Plugin::haiku;
10 hook(type => "preprocess", id => "haiku", call => \&preprocess);
13 sub preprocess (@) { #{{{
18 if ($@ || ! Coy->can("Coy::with_haiku")) {
21 No darting, subtle haiku.
25 no, wait, that's not quite it
29 no code, count Five-Seven-Five
34 $haiku=$canned[rand @canned];
37 $haiku=Coy::with_haiku($params{hint} ? $params{hint} : $params{page});
40 $haiku=~s/\s+-----\n//s;
41 $haiku=~s/\s+-----.*//s;
45 $haiku=~s/\n/<br>\n/mg;
47 return "\n\n<blockquote>$haiku</blockquote>\n\n";