aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/aggregate.pm2
-rw-r--r--IkiWiki/Plugin/anonok.pm2
-rw-r--r--IkiWiki/Plugin/brokenlinks.pm4
-rw-r--r--IkiWiki/Plugin/camelcase.pm2
-rw-r--r--IkiWiki/Plugin/conditional.pm47
-rw-r--r--IkiWiki/Plugin/ddate.pm3
-rw-r--r--IkiWiki/Plugin/favicon.pm2
-rw-r--r--IkiWiki/Plugin/fortune.pm2
-rw-r--r--IkiWiki/Plugin/goodstuff.pm2
-rw-r--r--IkiWiki/Plugin/googlecalendar.pm2
-rw-r--r--IkiWiki/Plugin/graphviz.pm2
-rw-r--r--IkiWiki/Plugin/haiku.pm2
-rw-r--r--IkiWiki/Plugin/html.pm2
-rw-r--r--IkiWiki/Plugin/htmlscrubber.pm2
-rw-r--r--IkiWiki/Plugin/htmltidy.pm2
-rw-r--r--IkiWiki/Plugin/httpauth.pm2
-rw-r--r--IkiWiki/Plugin/img.pm2
-rw-r--r--IkiWiki/Plugin/inline.pm6
-rw-r--r--IkiWiki/Plugin/linkmap.pm4
-rw-r--r--IkiWiki/Plugin/lockedit.pm4
-rw-r--r--IkiWiki/Plugin/map.pm4
-rw-r--r--IkiWiki/Plugin/mdwn.pm2
-rw-r--r--IkiWiki/Plugin/meta.pm2
-rw-r--r--IkiWiki/Plugin/mirrorlist.pm2
-rw-r--r--IkiWiki/Plugin/more.pm2
-rw-r--r--IkiWiki/Plugin/opendiscussion.pm2
-rw-r--r--IkiWiki/Plugin/openid.pm2
-rw-r--r--IkiWiki/Plugin/orphans.pm4
-rw-r--r--IkiWiki/Plugin/otl.pm2
-rw-r--r--IkiWiki/Plugin/pagecount.pm4
-rw-r--r--IkiWiki/Plugin/pagestats.pm4
-rw-r--r--IkiWiki/Plugin/passwordauth.pm2
-rw-r--r--IkiWiki/Plugin/poll.pm2
-rw-r--r--IkiWiki/Plugin/polygen.pm2
-rw-r--r--IkiWiki/Plugin/postsparkline.pm4
-rw-r--r--IkiWiki/Plugin/prettydate.pm2
-rw-r--r--IkiWiki/Plugin/rawhtml.pm2
-rw-r--r--IkiWiki/Plugin/rst.pm2
-rw-r--r--IkiWiki/Plugin/search.pm2
-rw-r--r--IkiWiki/Plugin/shortcut.pm2
-rw-r--r--IkiWiki/Plugin/sidebar.pm2
-rw-r--r--IkiWiki/Plugin/signinedit.pm2
-rw-r--r--IkiWiki/Plugin/skeleton.pm2
-rw-r--r--IkiWiki/Plugin/smiley.pm2
-rw-r--r--IkiWiki/Plugin/sparkline.pm2
-rw-r--r--IkiWiki/Plugin/table.pm3
-rw-r--r--IkiWiki/Plugin/tag.pm2
-rw-r--r--IkiWiki/Plugin/template.pm2
-rw-r--r--IkiWiki/Plugin/textile.pm2
-rw-r--r--IkiWiki/Plugin/toc.pm2
-rw-r--r--IkiWiki/Plugin/toggle.pm2
-rw-r--r--IkiWiki/Plugin/typography.pm2
-rw-r--r--IkiWiki/Plugin/wikitext.pm2
-rw-r--r--IkiWiki/Render.pm2
-rw-r--r--IkiWiki/UserInfo.pm18
55 files changed, 94 insertions, 99 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 319243727..78f8b409c 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::aggregate;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use HTML::Entities;
use HTML::Parser;
use HTML::Tagset;
diff --git a/IkiWiki/Plugin/anonok.pm b/IkiWiki/Plugin/anonok.pm
index 3e2a746e6..cd05cd865 100644
--- a/IkiWiki/Plugin/anonok.pm
+++ b/IkiWiki/Plugin/anonok.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::anonok;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "canedit", id => "anonok", call => \&canedit,);
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index d9d50f75f..fa34a7008 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::brokenlinks;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "brokenlinks", call => \&preprocess);
@@ -20,7 +20,7 @@ sub preprocess (@) { #{{{
my @broken;
foreach my $page (keys %links) {
- if (pagespec_match($page, $params{pages}, $params{page})) {
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
my $discussion=gettext("discussion");
foreach my $link (@{$links{$page}}) {
next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion};
diff --git a/IkiWiki/Plugin/camelcase.pm b/IkiWiki/Plugin/camelcase.pm
index 0bb35b6e2..29d22b0dd 100644
--- a/IkiWiki/Plugin/camelcase.pm
+++ b/IkiWiki/Plugin/camelcase.pm
@@ -2,9 +2,9 @@
# CamelCase links
package IkiWiki::Plugin::camelcase;
-use IkiWiki;
use warnings;
use strict;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "filter", id => "camelcase", call => \&filter);
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index 22057c135..29223ace2 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -3,12 +3,9 @@ package IkiWiki::Plugin::conditional;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use UNIVERSAL;
-# Globals used to pass information into the PageSpec functions.
-our ($sourcepage, $destpage);
-
sub import { #{{{
hook(type => "preprocess", id => "if", call => \&preprocess_if);
} # }}}
@@ -21,27 +18,28 @@ sub preprocess_if (@) { #{{{
}
my $result=0;
- $sourcepage=$params{page};
- $destpage=$params{destpage};
# An optimisation to avoid needless looping over every page
# and adding of dependencies for simple uses of some of the
# tests.
if ($params{test} =~ /^(enabled|sourcepage|destpage)\((.*)\)$/) {
- $result=eval "IkiWiki::PageSpec::match_$1(undef, ".
- IkiWiki::safequote($2).", \$params{page})";
+ $result=pagespec_match($params{page}, $params{test},
+ location => $params{page},
+ sourcepage => $params{page},
+ destpage => $params{destpage});
}
else {
add_depends($params{page}, $params{test});
foreach my $page (keys %pagesources) {
- if (pagespec_match($page, $params{test}, $params{page})) {
+ if (pagespec_match($page, $params{test},
+ location => $params{page},
+ sourcepage => $params{page},
+ destpage => $params{destpage})) {
$result=1;
last;
}
}
}
- $sourcepage="";
- $destpage="";
my $ret;
if ($result) {
@@ -59,7 +57,7 @@ sub preprocess_if (@) { #{{{
package IkiWiki::PageSpec;
-sub match_enabled ($$$) { #{{{
+sub match_enabled ($$;@) { #{{{
shift;
my $plugin=shift;
@@ -67,24 +65,31 @@ sub match_enabled ($$$) { #{{{
return UNIVERSAL::can("IkiWiki::Plugin::".$plugin, "import");
} #}}}
-sub match_sourcepage ($$$) { #{{{
+sub match_sourcepage ($$;@) { #{{{
shift;
my $glob=shift;
-
- return match_glob($IkiWiki::Plugin::conditional::sourcepage, $glob,
- $IkiWiki::Plugin::conditional::sourcepage);
+ my %params=@_;
+
+ return unless exists $params{sourcepage};
+ return match_glob($params{sourcepage}, $glob, @_);
} #}}}
-sub match_destpage ($$$) { #{{{
+sub match_destpage ($$;@) { #{{{
shift;
my $glob=shift;
+ my %params=@_;
- return match_glob($IkiWiki::Plugin::conditional::destpage, $glob,
- $IkiWiki::Plugin::conditional::sourcepage);
+ return unless exists $params{destpage};
+ return match_glob($params{destpage}, $glob, @_);
} #}}}
-sub match_included ($$$) { #{{{
- return $IkiWiki::Plugin::conditional::sourcepage ne $IkiWiki::Plugin::conditional::destpage;
+sub match_included ($$;$) { #{{{
+ shift;
+ shift;
+ my %params=@_;
+
+ return unless exists $params{sourcepage} && exists $params{destpage};
+ return $params{sourcepage} ne $params{destpage};
} #}}}
1
diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm
index 862d4da5b..f4921fdfd 100644
--- a/IkiWiki/Plugin/ddate.pm
+++ b/IkiWiki/Plugin/ddate.pm
@@ -1,7 +1,8 @@
#!/usr/bin/perl
# Discordian date support fnord ikiwiki.
package IkiWiki::Plugin::ddate;
-use IkiWiki;
+
+use IkiWiki 2.00;
no warnings;
sub import { #{{{
diff --git a/IkiWiki/Plugin/favicon.pm b/IkiWiki/Plugin/favicon.pm
index 864131d1e..7169c58c3 100644
--- a/IkiWiki/Plugin/favicon.pm
+++ b/IkiWiki/Plugin/favicon.pm
@@ -5,7 +5,7 @@ package IkiWiki::Plugin::favicon;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
diff --git a/IkiWiki/Plugin/fortune.pm b/IkiWiki/Plugin/fortune.pm
index 3bab134be..a3b13f687 100644
--- a/IkiWiki/Plugin/fortune.pm
+++ b/IkiWiki/Plugin/fortune.pm
@@ -2,9 +2,9 @@
# Include a fortune in a page
package IkiWiki::Plugin::fortune;
-use IkiWiki;
use warnings;
use strict;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "fortune", call => \&preprocess);
diff --git a/IkiWiki/Plugin/goodstuff.pm b/IkiWiki/Plugin/goodstuff.pm
index 384123f60..effbc7de9 100644
--- a/IkiWiki/Plugin/goodstuff.pm
+++ b/IkiWiki/Plugin/goodstuff.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::goodstuff;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my @bundle=qw{
brokenlinks
diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm
index 3f5102210..c6409e5e6 100644
--- a/IkiWiki/Plugin/googlecalendar.pm
+++ b/IkiWiki/Plugin/googlecalendar.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::googlecalendar;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "googlecalendar",
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index 48f520c4f..5d666e1be 100644
--- a/IkiWiki/Plugin/graphviz.pm
+++ b/IkiWiki/Plugin/graphviz.pm
@@ -5,7 +5,7 @@ package IkiWiki::Plugin::graphviz;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use IPC::Open2;
sub import { #{{{
diff --git a/IkiWiki/Plugin/haiku.pm b/IkiWiki/Plugin/haiku.pm
index fe8a782fa..35208e56c 100644
--- a/IkiWiki/Plugin/haiku.pm
+++ b/IkiWiki/Plugin/haiku.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::haiku;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "haiku", call => \&preprocess);
diff --git a/IkiWiki/Plugin/html.pm b/IkiWiki/Plugin/html.pm
index fd40d5ad9..7623ba6a9 100644
--- a/IkiWiki/Plugin/html.pm
+++ b/IkiWiki/Plugin/html.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::html;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "htmlize", id => "html", call => \&htmlize);
diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm
index ae3ec4456..c5b08f604 100644
--- a/IkiWiki/Plugin/htmlscrubber.pm
+++ b/IkiWiki/Plugin/htmlscrubber.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::htmlscrubber;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "sanitize", id => "htmlscrubber", call => \&sanitize);
diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm
index 0609e72c3..cd5dc83ac 100644
--- a/IkiWiki/Plugin/htmltidy.pm
+++ b/IkiWiki/Plugin/htmltidy.pm
@@ -9,7 +9,7 @@ package IkiWiki::Plugin::htmltidy;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use IPC::Open2;
sub import { #{{{
diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm
index 786bcba3b..d28b6d2d0 100644
--- a/IkiWiki/Plugin/httpauth.pm
+++ b/IkiWiki/Plugin/httpauth.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::httpauth;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "auth", id => "httpauth", call => \&auth);
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 8888b3a56..7226231a0 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -5,7 +5,7 @@ package IkiWiki::Plugin::img;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my %imgdefaults;
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 417eec8f3..3c029e001 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::inline;
use warnings;
use strict;
-use IkiWiki 1.00;
+use IkiWiki 2.00;
use URI;
sub import { #{{{
@@ -88,7 +88,7 @@ sub preprocess_inline (@) { #{{{
my @list;
foreach my $page (keys %pagesources) {
next if $page eq $params{page};
- if (pagespec_match($page, $params{pages}, $params{page})) {
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
push @list, $page;
}
}
@@ -223,7 +223,7 @@ sub preprocess_inline (@) { #{{{
@list=@list[0..$params{feedshow} - 1];
}
if (exists $params{feedpages}) {
- @list=grep { pagespec_match($_, $params{feedpages}, $params{page}) } @list;
+ @list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list;
}
if ($rss) {
diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm
index 29a3339a6..62984d9b8 100644
--- a/IkiWiki/Plugin/linkmap.pm
+++ b/IkiWiki/Plugin/linkmap.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::linkmap;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use IPC::Open2;
sub import { #{{{
@@ -48,7 +48,7 @@ sub genmap ($) { #{{{
# Get all the items to map.
my %mapitems = ();
foreach my $item (keys %links) {
- if (pagespec_match($item, $params{pages}, $params{page})) {
+ if (pagespec_match($item, $params{pages}, location => $params{page})) {
$mapitems{$item}=urlto($item, $params{destpage});
}
}
diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm
index f204e72c0..13df5632f 100644
--- a/IkiWiki/Plugin/lockedit.pm
+++ b/IkiWiki/Plugin/lockedit.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::lockedit;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "canedit", id => "lockedit", call => \&canedit);
@@ -20,7 +20,7 @@ sub canedit ($$) { #{{{
return undef if defined $user && IkiWiki::is_admin($user);
foreach my $admin (@{$config{adminuser}}) {
- if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"), "")) {
+ if (pagespec_match($page, IkiWiki::userinfo_get($admin, "locked_pages"))) {
return sprintf(gettext("%s is locked by %s and cannot be edited"),
htmllink("", "", $page, noimageinline => 1),
IkiWiki::userlink($admin));
diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm
index 07b63cb70..5aa2852de 100644
--- a/IkiWiki/Plugin/map.pm
+++ b/IkiWiki/Plugin/map.pm
@@ -9,7 +9,7 @@ package IkiWiki::Plugin::map;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "map", call => \&preprocess);
@@ -26,7 +26,7 @@ sub preprocess (@) { #{{{
# Get all the items to map.
my @mapitems = ();
foreach my $page (keys %links) {
- if (pagespec_match($page, $params{pages}, $params{page})) {
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
push @mapitems, $page;
}
}
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index c087f2b41..ca8898679 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::mdwn;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "htmlize", id => "mdwn", call => \&htmlize);
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index e13f57978..18e28a196 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::meta;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my %meta;
my %title;
diff --git a/IkiWiki/Plugin/mirrorlist.pm b/IkiWiki/Plugin/mirrorlist.pm
index 34a97cc0b..3997e6fef 100644
--- a/IkiWiki/Plugin/mirrorlist.pm
+++ b/IkiWiki/Plugin/mirrorlist.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::mirrorlist;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "pagetemplate", id => "mirrorlist", call => \&pagetemplate);
diff --git a/IkiWiki/Plugin/more.pm b/IkiWiki/Plugin/more.pm
index dae3728ba..6a34682ba 100644
--- a/IkiWiki/Plugin/more.pm
+++ b/IkiWiki/Plugin/more.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::more;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my $linktext = gettext("more");
diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm
index 4b1a432b2..fd5c9673d 100644
--- a/IkiWiki/Plugin/opendiscussion.pm
+++ b/IkiWiki/Plugin/opendiscussion.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::opendiscussion;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "canedit", id => "opendiscussion", call => \&canedit);
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 65b884814..34cd157f5 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::openid;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "getopt", id => "openid", call => \&getopt);
diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm
index 65d5e3e9b..3a0150d53 100644
--- a/IkiWiki/Plugin/orphans.pm
+++ b/IkiWiki/Plugin/orphans.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::orphans;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "orphans", call => \&preprocess);
@@ -28,7 +28,7 @@ sub preprocess (@) { #{{{
my $discussion=gettext("discussion");
foreach my $page (keys %pagesources) {
next if $linkedto{$page};
- next unless pagespec_match($page, $params{pages}, $params{page});
+ next unless pagespec_match($page, $params{pages}, location => $params{page});
# If the page has a link to some other page, it's
# indirectly linked to a page via that page's backlinks.
next if grep {
diff --git a/IkiWiki/Plugin/otl.pm b/IkiWiki/Plugin/otl.pm
index 94a2b80f6..20291d7e5 100644
--- a/IkiWiki/Plugin/otl.pm
+++ b/IkiWiki/Plugin/otl.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::otl;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "filter", id => "otl", call => \&filter);
diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm
index 313ffdff0..2c20ca195 100644
--- a/IkiWiki/Plugin/pagecount.pm
+++ b/IkiWiki/Plugin/pagecount.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::pagecount;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "pagecount", call => \&preprocess);
@@ -21,7 +21,7 @@ sub preprocess (@) { #{{{
return $#pages+1 if $params{pages} eq "*"; # optimisation
my $count=0;
foreach my $page (@pages) {
- $count++ if pagespec_match($page, $params{pages}, $params{page});
+ $count++ if pagespec_match($page, $params{pages}, location => $params{page});
}
return $count;
} # }}}
diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index 1edb39455..f6398c535 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -12,7 +12,7 @@ package IkiWiki::Plugin::pagestats;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
# Names of the HTML classes to use for the tag cloud
our @classes = ('smallestPC', 'smallPC', 'normalPC', 'bigPC', 'biggestPC' );
@@ -33,7 +33,7 @@ sub preprocess (@) { #{{{
my %counts;
my $max = 0;
foreach my $page (keys %links) {
- if (pagespec_match($page, $params{pages}, $params{page})) {
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
use IkiWiki::Render;
my @bl = IkiWiki::backlinks($page);
$counts{$page} = scalar(@bl);
diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm
index e0aa72a19..131b3a43e 100644
--- a/IkiWiki/Plugin/passwordauth.pm
+++ b/IkiWiki/Plugin/passwordauth.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::passwordauth;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "formbuilder_setup", id => "passwordauth",
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm
index 86ed4c840..63c93c62d 100644
--- a/IkiWiki/Plugin/poll.pm
+++ b/IkiWiki/Plugin/poll.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::poll;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "poll", call => \&preprocess);
diff --git a/IkiWiki/Plugin/polygen.pm b/IkiWiki/Plugin/polygen.pm
index 63f6bf5db..5208a44ec 100644
--- a/IkiWiki/Plugin/polygen.pm
+++ b/IkiWiki/Plugin/polygen.pm
@@ -7,7 +7,7 @@ package IkiWiki::Plugin::polygen;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use File::Find;
sub import { #{{{
diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm
index 2bc93088d..e4fe9c154 100644
--- a/IkiWiki/Plugin/postsparkline.pm
+++ b/IkiWiki/Plugin/postsparkline.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::postsparkline;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
IkiWiki::loadplugin('sparkline');
@@ -37,7 +37,7 @@ sub preprocess (@) { #{{{
my @list;
foreach my $page (keys %pagesources) {
next if $page eq $params{page};
- if (pagespec_match($page, $params{pages}, $params{page})) {
+ if (pagespec_match($page, $params{pages}, location => $params{page})) {
push @list, $page;
}
}
diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm
index 11bd69d3f..44ffb719e 100644
--- a/IkiWiki/Plugin/prettydate.pm
+++ b/IkiWiki/Plugin/prettydate.pm
@@ -1,6 +1,6 @@
#!/usr/bin/perl
package IkiWiki::Plugin::prettydate;
-use IkiWiki;
+use IkiWiki 2.00;
use warnings;
no warnings 'redefine';
use strict;
diff --git a/IkiWiki/Plugin/rawhtml.pm b/IkiWiki/Plugin/rawhtml.pm
index 30e971514..011c3a862 100644
--- a/IkiWiki/Plugin/rawhtml.pm
+++ b/IkiWiki/Plugin/rawhtml.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::rawhtml;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
$config{wiki_file_prune_regexps} = [ grep { !m/\\\.x\?html\?\$/ } @{$config{wiki_file_prune_regexps}} ];
diff --git a/IkiWiki/Plugin/rst.pm b/IkiWiki/Plugin/rst.pm
index afd60f668..1f4c8bf9e 100644
--- a/IkiWiki/Plugin/rst.pm
+++ b/IkiWiki/Plugin/rst.pm
@@ -18,7 +18,7 @@ package IkiWiki::Plugin::rst;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use IPC::Open2;
# Simple python script, maybe it should be implemented using an external script.
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 61e9214e6..da818e5cf 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::search;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "getopt", id => "hyperestraier",
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm
index 7b89bf879..28d0c7177 100644
--- a/IkiWiki/Plugin/shortcut.pm
+++ b/IkiWiki/Plugin/shortcut.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::shortcut;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "checkconfig", id => "shortcut", call => \&checkconfig);
diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm
index da1f82b82..f0dd0ca03 100644
--- a/IkiWiki/Plugin/sidebar.pm
+++ b/IkiWiki/Plugin/sidebar.pm
@@ -6,7 +6,7 @@ package IkiWiki::Plugin::sidebar;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "pagetemplate", id => "sidebar", call => \&pagetemplate);
diff --git a/IkiWiki/Plugin/signinedit.pm b/IkiWiki/Plugin/signinedit.pm
index 04532f4dc..08932e2f6 100644
--- a/IkiWiki/Plugin/signinedit.pm
+++ b/IkiWiki/Plugin/signinedit.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::signinedit;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "canedit", id => "signinedit", call => \&canedit,
diff --git a/IkiWiki/Plugin/skeleton.pm b/IkiWiki/Plugin/skeleton.pm
index 8b51b1550..b8c327c9d 100644
--- a/IkiWiki/Plugin/skeleton.pm
+++ b/IkiWiki/Plugin/skeleton.pm
@@ -6,7 +6,7 @@ package IkiWiki::Plugin::skeleton;
use warnings;
use strict;
-use IkiWiki '1.02';
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "getopt", id => "skeleton", call => \&getopt);
diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm
index e85abbb85..1a9833e6e 100644
--- a/IkiWiki/Plugin/smiley.pm
+++ b/IkiWiki/Plugin/smiley.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::smiley;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my %smileys;
my $smiley_regexp;
diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm
index 060368679..69b3512c2 100644
--- a/IkiWiki/Plugin/sparkline.pm
+++ b/IkiWiki/Plugin/sparkline.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::sparkline;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use IPC::Open2;
my $match_num=qr/[-+]?[0-9]+(?:\.[0-9]+)?/;
diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm
index 2ed60ab46..698f9c9b6 100644
--- a/IkiWiki/Plugin/table.pm
+++ b/IkiWiki/Plugin/table.pm
@@ -3,8 +3,7 @@ package IkiWiki::Plugin::table;
use warnings;
use strict;
-
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "preprocess", id => "table", call => \&preprocess);
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index 733d76f4e..48ed1a8f8 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::tag;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
my %tags;
diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 690443558..b169f7e75 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::template;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use HTML::Template;
use Encode;
diff --git a/IkiWiki/Plugin/textile.pm b/IkiWiki/Plugin/textile.pm
index ee8e88ed2..5de71bf6e 100644
--- a/IkiWiki/Plugin/textile.pm
+++ b/IkiWiki/Plugin/textile.pm
@@ -6,7 +6,7 @@ package IkiWiki::Plugin::textile;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "htmlize", id => "txtl", call => \&htmlize);
diff --git a/IkiWiki/Plugin/toc.pm b/IkiWiki/Plugin/toc.pm
index 279eef008..797bfc6bd 100644
--- a/IkiWiki/Plugin/toc.pm
+++ b/IkiWiki/Plugin/toc.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::toc;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
use HTML::Parser;
sub import { #{{{
diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm
index 7318731c5..4a16ef32c 100644
--- a/IkiWiki/Plugin/toggle.pm
+++ b/IkiWiki/Plugin/toggle.pm
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::toggle;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
# Here's the javascript that makes this possible. A key feature is the use
# of css to hide toggleables, to avoid any flashing on page load. The css
diff --git a/IkiWiki/Plugin/typography.pm b/IkiWiki/Plugin/typography.pm
index 682dadab7..3b66ab0d0 100644
--- a/IkiWiki/Plugin/typography.pm
+++ b/IkiWiki/Plugin/typography.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::typography;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
IkiWiki::hook(type => "sanitize", id => "typography", call => \&sanitize);
diff --git a/IkiWiki/Plugin/wikitext.pm b/IkiWiki/Plugin/wikitext.pm
index 586be0874..e1d346ae6 100644
--- a/IkiWiki/Plugin/wikitext.pm
+++ b/IkiWiki/Plugin/wikitext.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::wikitext;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 2.00;
sub import { #{{{
hook(type => "htmlize", id => "wiki", call => \&htmlize);
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index e77379a65..0b7e00d9d 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -365,7 +365,7 @@ sub refresh () { #{{{
foreach my $file (keys %rendered, @del) {
next if $f eq $file;
my $page=pagename($file);
- if (pagespec_match($page, $depends{$p}, $p)) {
+ if (pagespec_match($page, $depends{$p}, location => $p)) {
debug(sprintf(gettext("rendering %s, which depends on %s"), $f, $page));
render($f);
$rendered{$f}=1;
diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm
index 8bd056248..d0ef578c2 100644
--- a/IkiWiki/UserInfo.pm
+++ b/IkiWiki/UserInfo.pm
@@ -92,11 +92,8 @@ sub set_banned_users (@) { #{{{
return userinfo_store($userinfo);
} #}}}
-# Global used to pass information into the PageSpec function.
-our $committer;
-
sub commit_notify_list ($@) { #{{{
- $committer=shift;
+ my $committer=shift;
my @pages = map pagename($_), @_;
my @ret;
@@ -107,7 +104,9 @@ sub commit_notify_list ($@) { #{{{
length $userinfo->{$user}->{subscriptions} &&
exists $userinfo->{$user}->{email} &&
length $userinfo->{$user}->{email} &&
- grep { pagespec_match($_, $userinfo->{$user}->{subscriptions}, "") }
+ grep { pagespec_match($_,
+ $userinfo->{$user}->{subscriptions},
+ user => $committer) }
map pagename($_), @_) {
push @ret, $userinfo->{$user}->{email};
}
@@ -180,13 +179,4 @@ sub send_commit_mails ($$$@) { #{{{
}
} #}}}
-package IkiWiki::PageSpec;
-
-sub match_user ($$$) { #{{{
- shift;
- my $user=shift;
-
- return $user eq $committer;
-} #}}}
-
1