]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add in a hack to improve the look of check marks in outline
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 19 Aug 2006 18:27:57 +0000 (18:27 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 19 Aug 2006 18:27:57 +0000 (18:27 +0000)
IkiWiki/Plugin/otl.pm

index 6514f0301e81bb39a50e956be727dee0e0c74485..40c52976171f901e05a576ee80e330b8c139b52b 100644 (file)
@@ -8,7 +8,23 @@ use IkiWiki;
 use IPC::Open2;
 
 sub import { #{{{
+       IkiWiki::hook(type => "filter", id => "otl", call => \&filter);
        IkiWiki::hook(type => "htmlize", id => "otl", call => \&htmlize);
+
+} # }}}
+
+sub filter (@) { #{{{
+       my %params=@_;
+        
+       # Munge up check boxes to look a little bit better. This is a hack.
+       my $checked=IkiWiki::htmllink($params{page}, $params{page},
+               "smileys/star_on.png", 0);
+       my $unchecked=IkiWiki::htmllink($params{page}, $params{page},
+               "smileys/star_off.png", 0);
+       $params{content}=~s/^(\s+)\[X\]\s/${1}$checked /mg;
+       $params{content}=~s/^(\s+)\[_\]\s/${1}$unchecked /mg;
+        
+       return $params{content};
 } # }}}
 
 sub htmlize ($) { #{{{