X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/2c05a34be17c805d929f0ad563acf857eba1d46b..dd175cda8743068d12dd34b5c89e9fba6bd114c9:/IkiWiki/Plugin/sparkline.pm diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index bcff46aeb..458192695 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -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; @@ -121,7 +130,7 @@ sub preprocess (@) { #{{{ if (! -e "$config{destdir}/$fn") { my $pid; - my $sigpipe=0;; + my $sigpipe=0; $SIG{PIPE}=sub { $sigpipe=1 }; $pid=open2(*IN, *OUT, "php"); @@ -157,6 +166,6 @@ sub preprocess (@) { #{{{ } return 'graph'; -} # }}} +} 1