2 # haiku generator plugin
3 package IkiWiki::Plugin::haiku;
10 IkiWiki::hook(type => "preprocess", id => "haiku",
11 call => \&preprocess);
14 sub preprocess (@) { #{{{
22 No darting, subtle haiku.
26 no, wait, that's not quite it
30 no code, count Five-Seven-Five
35 $haiku=$canned[rand @canned];
38 # Coy is rather strange, so the best way to get a haiku
39 # out of it is to die..
40 eval {die exists $params{hint} ? $params{hint} : $params{page}};
44 $haiku=~s/\s+-----\n//s;
45 $haiku=~s/\s+-----.*//s;
49 $haiku=~s/\n/<br>\n/mg;