X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=IkiWiki%2FPlugin%2Fgraphviz.pm;h=4ed8b89f165847832762408c05b0abedc21aaf6c;hb=937c0742322065452a204069e0ba5abc625ec0c6;hp=b43e96a73adad4b1b8091c689110c70611a983f6;hpb=ffec6806087981420eaf83c8d83cc4523a46d0de;p=ikiwiki.git diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index b43e96a73..4ed8b89f1 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } @@ -36,16 +37,16 @@ sub render_graph (\%) { $src .= "}\n"; # Use the sha1 of the graphviz code as part of its filename. - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; error($@) if $@; my $dest=$params{page}."/graph-". - IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)). + IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($src)). ".png"; will_render($params{page}, $dest); if (! -e "$config{destdir}/$dest") { my $pid; - my $sigpipe=0;; + my $sigpipe=0; $SIG{PIPE}=sub { $sigpipe=1 }; $pid=open2(*IN, *OUT, "$params{prog} -Tpng"); @@ -70,7 +71,8 @@ sub render_graph (\%) { writefile($dest, $config{destdir}, $png, 1); } else { - # can't write the file, so embed it in a data uri + # in preview mode, embed the image in a data uri + # to avoid temp file clutter eval q{use MIME::Base64}; error($@) if $@; return "\n"; - } - else { - return "\n"; - } + return "\n"; } sub graph (@) {