]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/sparkline.pm
avoid mixing english with translation
[git.ikiwiki.info.git] / IkiWiki / Plugin / sparkline.pm
index bcff46aeb47ed8156b8d866f348ffab29a7a0f23..1ed65e5b7c354df8d985ff73101b13da9c28bb44 100644 (file)
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::sparkline;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 use IPC::Open2;
 
 my $match_num=qr/[-+]?[0-9]+(?:\.[0-9]+)?/;
@@ -14,11 +14,20 @@ my %locmap=(
        left => 'TEXT_LEFT',
 );
 
-sub import { #{{{
+sub import {
+       hook(type => "getsetup", id => "sparkline", call => \&getsetup);
        hook(type => "preprocess", id => "sparkline", call => \&preprocess);
-} # }}}
+}
 
-sub preprocess (@) { #{{{
+sub getsetup () {
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
+}
+
+sub preprocess (@) {
        my %params=@_;
 
        my $php;
@@ -157,6 +166,6 @@ sub preprocess (@) { #{{{
        }
 
        return '<img src="'.urlto($fn, $params{destpage}).'" alt="graph" />';
-} # }}}
+}
 
 1