X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5e2e95a516e7f967654108bbc4d8e9ab71a6820f..be02a80b7a19f3c33a8ea42c0750d94e0a91206f:/IkiWiki/Plugin/graphviz.pm
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index 32e994d6b..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,10 +37,10 @@ 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);
@@ -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 (@) {