diff options
author | Amitai Schleier <schmonz-web-ikiwiki@schmonz.com> | 2018-10-22 00:24:59 -0400 |
---|---|---|
committer | Amitai Schleier <schmonz-web-ikiwiki@schmonz.com> | 2018-10-22 00:24:59 -0400 |
commit | 9332b8115daa2a0813cbc97dc7054576b063eab0 (patch) | |
tree | a696bd1e211add1541838f07eba7f47942a9f10b /IkiWiki | |
parent | 81bad6a03ff9c2412c34c2a20bfcd0f710cc0c03 (diff) | |
download | ikiwiki-9332b8115daa2a0813cbc97dc7054576b063eab0.tar ikiwiki-9332b8115daa2a0813cbc97dc7054576b063eab0.tar.gz |
Give graph an optional "file" param, like table's.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/graphviz.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index d4018edaa..479da6f73 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -95,6 +95,14 @@ sub render_graph (\%) { sub graph (@) { my %params=@_; + if (exists $params{file}) { + if (! exists $pagesources{$params{file}}) { + error gettext("cannot find file"); + } + $params{src} = readfile(srcfile($params{file})); + add_depends($params{page}, $params{file}); + } + # Support wikilinks in the graph source. my $src=$params{src}; $src="" unless defined $src; |