]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn
Merge remote-tracking branch 'remotes/smcv/ready/careful-eval'
[ikiwiki.git] / doc / bugs / nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn
1 In commit aaa72a3a8, Joey noted:
2
3 > bestlink returns '' if no existing page matches a link. This propigated
4 > through inline and other plugins, causing uninitialized value warnings, and
5 > in some cases (when filecheck was enabled) making the whole directive fail.
6 >   
7 > Skipping the empty results fixes that, but this is papering over another
8 > problem: If the missing page is later added, there is not dependency
9 > information to know that the inline needs to be updated. Perhaps smcv will
10 > fix that later.
11
12 Potential ways this could be addressed:
13
14 * Add a presence dependency on everything the reference could match:
15   so if the `inline` is on `a/b/c` and the missing page is `m`,
16   add a `$depends_simple` `$DEPEND_PRESENCE` dependency on `a/b/c/m`,
17   `a/b/m`, `a/m`, `m` and (if configured) `$config{userdir}/m`
18
19 * Make the page names in `\[[!inline pagenames=...]]` count as wikilinks,
20   changing the behaviour of `link()` and backlinks, but causing appropriate
21   rebuilds via the special cases in `IkiWiki::Render`
22
23 * Extend the special cases in `IkiWiki::Render` to consider a superset of
24   wikilinks, to which `pagenames` would add its named pages, without
25   affecting `link()` and backlinks
26
27 (Note that `\[[!inline pages=...]]` cannot count as wikilinks, because
28 pagespecs can contain `link()`, so can't be evaluated until we know what
29 wikilinks exist, at which point it's too late to add more wikilinks.)
30
31 I think the presence dependency is probably the cleanest approach?
32 --[[smcv]]
33
34 > I think it was possibly a mistake to use wikilink style lookup for
35 > `pagenames`. --[[Joey]]
36
37 [[!tag patch]] [[!template id=gitbranch branch=smcv/literal-pagenames author="[[smcv]]"]]
38 >> I used the linking rules to make references to
39 >> "nearby" pages convenient, but if you'd prefer "absolute"
40 >> semantics, my `ready/literal-pagenames` branch does that. For
41 >> my main use-case for `pagenames` ([[plugins/contrib/album]])
42 >> it's fine either way. --[[smcv]]
43
44 >>> Ok, [[merged|done]]. I think it's more consistent this way. --[[Joey]]