]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/graphviz.pm
Merge branch 'master' into commentreorg
[git.ikiwiki.info.git] / IkiWiki / Plugin / graphviz.pm
index 23631da300509c9ced74dcfc4eb58ab14dd91e2b..c91c92fec72af9bbe4d4cf1c8a0f07f01e6933ec 100644 (file)
@@ -5,7 +5,7 @@ package IkiWiki::Plugin::graphviz;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 use IPC::Open2;
 
 sub import {
 use IPC::Open2;
 
 sub import {
@@ -18,6 +18,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "widget",
                },
 }
 
                },
 }
 
@@ -45,7 +46,7 @@ sub render_graph (\%) {
 
        if (! -e "$config{destdir}/$dest") {
                my $pid;
 
        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");
 
                $SIG{PIPE}=sub { $sigpipe=1 };
                $pid=open2(*IN, *OUT, "$params{prog} -Tpng");
 
@@ -78,12 +79,7 @@ sub render_graph (\%) {
                }
        }
 
                }
        }
 
-       if ($params{preview}) {
-               return "<img src=\"".urlto($dest, "")."\" />\n";
-       }
-       else {
-               return "<img src=\"".urlto($dest, $params{destpage})."\" />\n";
-       }
+       return "<img src=\"".urlto($dest, $params{destpage})."\" />\n";
 }
 
 sub graph (@) {
 }
 
 sub graph (@) {