X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/6f1539320b7b2701d391c9921177b31898767bb7..04ff998c51b578017edf369e0dfc2dc7c63d8071:/IkiWiki/Plugin/graphviz.pm diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index b43e96a73..dfd66a03e 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } @@ -45,7 +46,7 @@ sub render_graph (\%) { 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 (@) {