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 ($config{deterministic}) {
29 $haiku = "Coy changes often.
30 For deterministic builds
34 elsif ($@ || ! Coy->can("Coy::with_haiku")) {
37 No darting, subtle haiku.
41 no, wait, that's not quite it
45 no code, count Five-Seven-Five
50 $haiku=$canned[rand @canned];
53 $haiku=Coy::with_haiku($params{hint} ? $params{hint} : $params{page});
56 $haiku=~s/\s+-----\n//s;
57 $haiku=~s/\s+-----.*//s;
61 $haiku=~s/\n/<br \/>\n/mg;
63 return "\n\n<blockquote><p>$haiku</p></blockquote>\n\n";