summaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorDavid Riebenbauer <davrieb@liegesta.at>2010-01-31 02:31:12 +0100
committerDavid Riebenbauer <davrieb@liegesta.at>2010-02-02 14:04:28 +0100
commitb18fde2bde0c7d445fd4aab3cd35add8c211aab4 (patch)
tree6a9ba0da65f9c760d93a5c1da5ca8081ae8a5124 /IkiWiki.pm
parentf35d35abe36166893f68061a1fcb2a26bc056fbc (diff)
Add a function add_autofiles().
The objective is to provide a sensible way to let plugins add files during the "scan stage" of the build. Currently does a little verification and adds the file to the global array @add_autofiles.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index cb1c46a68..115c512d3 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -14,7 +14,7 @@ use open qw{:utf8 :std};
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
%pagestate %wikistate %renderedfiles %oldrenderedfiles
%pagesources %destsources %depends %depends_simple %hooks
- %forcerebuild %loaded_plugins};
+ %forcerebuild %loaded_plugins @autofiles};
use Exporter q{import};
our @EXPORT = qw(hook debug error template htmlpage deptype
@@ -1898,6 +1898,14 @@ sub add_link ($$) {
unless grep { $_ eq $link } @{$links{$page}};
}
+sub add_autofile ($) {
+ my $addfile=shift;
+ my ($file,$page) = verify_src_file($addfile,$config{srcdir});
+ if ($page) {
+ push @autofiles, $file;
+ }
+}
+
sub pagespec_translate ($) {
my $spec=shift;