]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/pagespec__95__match__95__list_can_result_in_excessive_dependencies.mdwn
Merge branch 'ready/templatebody'
[ikiwiki.git] / doc / todo / pagespec__95__match__95__list_can_result_in_excessive_dependencies.mdwn
1 If you say
2
3     pagespec_match_list($page, $spec, list => \@pages)
4
5 with a small list `@pages` and a vague pagespec `$spec`, `$page` ends
6 up depending on (every page that matches) `$spec`. For instance, if you
7 already have a list of subpages of the sandbox, and you want to filter it
8 to only the discussion pages, you can do that like
9
10     pagespec_match_list("sandbox", "*/discussion",
11         list => ["sandbox/discussion", "sandbox/things", "sandbox/stuff"])
12
13 but then a change to *any* discussion page will refresh the sandbox.
14
15 The [[bugs/trails depend on everything]] bug was a particularly bad
16 case of this, with the widest possible pagespec `internal(*)`
17 matched against a small list (the trail).
18
19 In principle it would be nice if `pagespec_match_list` could detect
20 this situation and make sandbox depend on only those subpages instead.
21
22 Perhaps if the `list` parameter is given, `p_m_l` should add a
23 by-name (simple) dependency on each page in that list, instead
24 of a dependency on the pagespec? Or perhaps it should be documented
25 that plugins can pass `deptype => 0` to take responsibility for
26 their own dependency handling, and then do whatever they need?
27
28 Uses of `pagespec_match_list` with a non-trivial list, in-tree,
29 after [[bugs/trails depend on everything]] is fixed:
30
31 * brokenlinks: really does need to depend on the whole pagespec,
32   but that could be done separately
33
34 * inline: the inliner already depends on the inlined pages
35   so no extra dependency is needed
36
37 * pagestats: same as brokenlinks
38
39 My album plugin is in the same situation as inline.
40
41 --[[smcv]]