use warnings;
use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
use IPC::Open2;
my $match_num=qr/[-+]?[0-9]+(?:\.[0-9]+)?/;
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;
if (! -e "$config{destdir}/$fn") {
my $pid;
- my $sigpipe=0;;
+ my $sigpipe=0;
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "php");
}
return '<img src="'.urlto($fn, $params{destpage}).'" alt="graph" />';
-} # }}}
+}
1