aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/graphviz.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/graphviz.pm')
-rw-r--r--IkiWiki/Plugin/graphviz.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index 32e994d6b..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",
},
}
@@ -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 "<img src=\"data:image/png;base64,".
@@ -78,12 +80,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 (@) {