2 # haiku generator plugin
3 package IkiWiki::Plugin::haiku;
10 hook(type => "getsetup", id => "haiku", call => \&getsetup);
11 hook(type => "preprocess", id => "haiku", call => \&preprocess);
28 if ($@ || ! Coy->can("Coy::with_haiku")) {
31 No darting, subtle haiku.
35 no, wait, that's not quite it
39 no code, count Five-Seven-Five
44 $haiku=$canned[rand @canned];
47 $haiku=Coy::with_haiku($params{hint} ? $params{hint} : $params{page});
50 $haiku=~s/\s+-----\n//s;
51 $haiku=~s/\s+-----.*//s;
55 $haiku=~s/\n/<br \/>\n/mg;
57 return "\n\n<blockquote><p>$haiku</p></blockquote>\n\n";