Also, this fixes 2 bugs in dependency info.
$params{pages}="*" unless defined $params{pages};
# Needs to update whenever the links on a page change.
- add_depends($params{page}, $params{pages}, links => 1);
+ add_depends($params{page}, $params{pages}, deptype("links"));
my @broken;
foreach my $link (keys %IkiWiki::brokenlinks) {
linktext => " $monthname ");
}
add_depends($params{page}, "$archivebase/$year/".sprintf("%02d", $month),
- presence => 1);
+ deptype("presence"));
if (exists $cache{$pagespec}{"$pyear/$pmonth"}) {
$purl = htmllink($params{page}, $params{destpage},
"$archivebase/$pyear/" . sprintf("%02d", $pmonth),
linktext => " $pmonthname ");
}
add_depends($params{page}, "$archivebase/$pyear/".sprintf("%02d", $pmonth),
- presence => 1);
+ deptype("presence"));
if (exists $cache{$pagespec}{"$nyear/$nmonth"}) {
$nurl = htmllink($params{page}, $params{destpage},
"$archivebase/$nyear/" . sprintf("%02d", $nmonth),
linktext => " $nmonthname ");
}
add_depends($params{page}, "$archivebase/$nyear/".sprintf("%02d", $nmonth),
- presence => 1);
+ deptype("presence"));
# Start producing the month calendar
$calendar=<<EOF;
# Add dependencies to update the calendar whenever pages
# matching the pagespec are added or removed.
- add_depends($params{page}, $params{pages}, presence => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence"));
return $calendar;
}
"$archivebase/$year",
linktext => "$year");
}
- add_depends($params{page}, "$archivebase/$year", presence => 1);
+ add_depends($params{page}, "$archivebase/$year", deptype("presence");
if (exists $cache{$pagespec}{"$pyear"}) {
$purl = htmllink($params{page}, $params{destpage},
"$archivebase/$pyear",
linktext => "\←");
}
- add_depends($params{page}, "$archivebase/$pyear", presence => 1);
+ add_depends($params{page}, "$archivebase/$pyear", deptype("presence"));
if (exists $cache{$pagespec}{"$nyear"}) {
$nurl = htmllink($params{page}, $params{destpage},
"$archivebase/$nyear",
linktext => "\→");
}
- add_depends($params{page}, "$archivebase/$nyear", presence => 1);
+ add_depends($params{page}, "$archivebase/$nyear", deptype("presence"));
# Start producing the year calendar
$calendar=<<EOF;
else {
$calendar.=qq{\t<td class="$tag">$monthabbr</td>\n};
}
- add_depends($params{page}, "$archivebase/$year/$mtag", presence => 1);
+ add_depends($params{page}, "$archivebase/$year/$mtag",
+ deptype("presence"));
$calendar.=qq{\t</tr>\n} if ($month % $params{months_per_row} == 0);
}
$pagestate{$params{page}}{edittemplate}{$params{match}}=$link;
return "" if ($params{silent} && IkiWiki::yesno($params{silent}));
- add_depends($params{page}, $link, presence => 1);
+ add_depends($params{page}, $link, deptype("presence"));
return sprintf(gettext("edittemplate %s registered for %s"),
htmllink($params{page}, $params{destpage}, $link),
$params{match});
@list = map { bestlink($params{page}, $_) }
split ' ', $params{pagenames};
+
+ foreach my $p (@list) {
+ add_depends($params{page}, $p, deptype($quick ? "presence" : "content"));
+ }
}
else {
- add_depends($params{page}, $params{pages}, presence => $quick);
+ add_depends($params{page}, $params{pages},
+ deptype($quick ? "presence" : "content"));
@list = pagespec_match_list(
[ grep { $_ ne $params{page} } keys %pagesources ],
# Needs to update whenever a relevant page is added, or removed, or
# its links change.
- add_depends($params{page}, $params{pages}, presence => 1, links => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence", "links"));
# Can't just return the linkmap here, since the htmlscrubber
# scrubs out all <object> tags (with good reason!)
foreach my $plugin (@pluginlist) {
$result .= '<li class="listdirectives">';
my $link=linkpage($config{directive_description_dir}."/".$plugin);
- add_depends($params{page}, $link, presence => 1);
+ add_depends($params{page}, $link, deptype("presence"));
$result .= htmllink($params{page}, $params{destpage}, $link);
$result .= '</li>';
}
# Needs to update whenever a page is added or removed (or in some
# cases, when its content changes, if show= is specified), so
# register a dependency.
- add_depends($params{page}, $params{pages}, presence => ! exists $params{show});
+ add_depends($params{page}, $params{pages},
+ deptype(exists $params{show} ? "content" : "presence");
# Create the map.
my $parent="";
if (! length $link) {
error gettext("redir page not found")
}
- add_depends($page, $link, presence => 1);
+ add_depends($page, $link, deptype("presence"));
$value=urlto($link, $page);
$value.='#'.$redir_anchor if defined $redir_anchor;
# Needs to update whenever a link changes, on any page
# since any page could link to one of the pages we're
# considering as orphans.
- add_depends($params{page}, "*", links => 1);
+ add_depends($params{page}, "*", deptype("links"));
# Also needs to update whenever potential orphans are added or
# removed.
- add_depends($params{page}, $params{pages}, presence => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence"));
my @orphans;
foreach my $page (pagespec_match_list(
# Needs to update count whenever a page is added or removed, so
# register a presence dependency.
- add_depends($params{page}, $params{pages}, presence => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence"));
my @pages;
if ($params{pages} eq "*") {
my $style = ($params{style} or 'cloud');
# Needs to update whenever a page is added or removed.
- add_depends($params{page}, $params{pages}, exists => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence"));
# Also needs to update when any page with links changes,
# in case the links point to our displayed pages.
# (Among limits this further.)
add_depends($params{page}, exists $params{among} ? $params{among} : "*",
- links => 1);
+ deptype("links"));
my %counts;
my $max = 0;
error gettext("unknown formula");
}
- add_depends($params{page}, $params{pages}, presence => 1);
+ add_depends($params{page}, $params{pages}, deptype("presence"));
my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} }
pagespec_match_list(
$fill.="%";
}
elsif (defined $params{totalpages} and defined $params{donepages}) {
- add_depends($params{page}, $params{totalpages}, presence => 1);
- add_depends($params{page}, $params{donepages}, presence => 1);
+ add_depends($params{page}, $params{totalpages}, deptype("presence"));
+ add_depends($params{page}, $params{donepages}, deptype("presence"));
my @pages=keys %pagesources;
my $totalcount=0;