same dependency problem as plugins/contrib/trail :-(
[ikiwiki.git] / doc / bugs / conditional_preprocess_during_scan.mdwn
1 [[!template id=gitbranch branch=GiuseppeBilotta/scanif author="Giuseppe Bilotta"]]
2
3 When a directive that should be run during scan preprocessing is inside
4 an if directive, it doesn't get called because the if preprocessing does
5 not run during scan.
6
7 I've written a simple [[patch]] to fix the issue, currently hosted on the
8 scanif branch of my repository. The patch also passes the preview option
9 back to the Ikiwiki::preprocess call, making sure that whatever is being
10 reprocessed is done so in the same conditions as the original call.
11
12 > One problem with this is that it has the same dependency-ordering problems
13 > as inline-based or pagespec-based trails with my [[plugins/contrib/trail]]
14 > plugin: `if` takes a pagespec, but pagespecs aren't guaranteed to match
15 > correctly until everything has been scanned (for instance, `link()` might
16 > give the wrong results because a page that added or deleted a link hasn't
17 > been scanned yet). If you have a clever idea for how to fix this, I'd love
18 > to hear it - being able to specify a [[plugins/contrib/trail]] in terms
19 > of a sorted pagespec would be useful. --[[smcv]]