3 package IkiWiki::Plugin::otl;
11 IkiWiki::hook(type => "filter", id => "otl", call => \&filter);
12 IkiWiki::hook(type => "htmlize", id => "otl", call => \&htmlize);
19 # Munge up check boxes to look a little bit better. This is a hack.
20 my $checked=IkiWiki::htmllink($params{page}, $params{page},
21 "smileys/star_on.png", 0);
22 my $unchecked=IkiWiki::htmllink($params{page}, $params{page},
23 "smileys/star_off.png", 0);
24 $params{content}=~s/^(\s*)\[X\]\s/${1}$checked /mg;
25 $params{content}=~s/^(\s*)\[_\]\s/${1}$unchecked /mg;
27 return $params{content};
30 sub htmlize (@) { #{{{
36 open2(*IN, *OUT, 'otl2html -S /dev/null -T /dev/stdin');
41 IkiWiki::debug("failed to run otl2html: $@");
42 return $params{content};
45 # open2 doesn't respect "use open ':utf8'"
46 binmode (IN, ':utf8');
47 binmode (OUT, ':utf8');
49 print OUT $params{content};
56 $ret=~s/<div class="Footer">.*//s;