aboutsummaryrefslogtreecommitdiff
path: root/doc/ikiwiki/pagespec
diff options
context:
space:
mode:
authorhttp://smcv.pseudorandom.co.uk/ <smcv@web>2011-08-25 06:42:01 -0400
committeradmin <admin@branchable.com>2011-08-25 06:42:01 -0400
commitb12ed362cb0188b79056aab7eea80592d71f62ec (patch)
treef1d09b4a4ae86d46c2d9b213cdf9b3c524666eb7 /doc/ikiwiki/pagespec
parent1c34fddec5e3161c35b2a93caf875d836b9aaa94 (diff)
downloadikiwiki-b12ed362cb0188b79056aab7eea80592d71f62ec.tar
ikiwiki-b12ed362cb0188b79056aab7eea80592d71f62ec.tar.gz
XPath axis selectors are actually a relatively nice model
Diffstat (limited to 'doc/ikiwiki/pagespec')
-rw-r--r--doc/ikiwiki/pagespec/discussion.mdwn28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/ikiwiki/pagespec/discussion.mdwn b/doc/ikiwiki/pagespec/discussion.mdwn
index b0d44874a..63e38044f 100644
--- a/doc/ikiwiki/pagespec/discussion.mdwn
+++ b/doc/ikiwiki/pagespec/discussion.mdwn
@@ -138,3 +138,31 @@ any ideas?
>> but that could get messy, perhaps a new cmd 'pagetree' or something
>> might be better? --Colin
+
+>>> You could probably do a lot worse than stealing terminology from
+>>> [XPath Axes](http://www.w3.org/TR/xpath/#axes),
+>>> passing the "argument" through `bestlink` if there is one, and
+>>> treating an empty argument as "this page", something like:
+>>>
+>>> * `ancestor(/plugins/contrib/album)` matches `plugins` or
+>>> `plugins/contrib`
+>>> but not `plugins/map` or `plugins/contrib/album`
+>>> (does it match `index`? answers on a postcard)
+>>> * `descendant(/plugins)` is basically `plugins/*`
+>>> * `child(/plugins)` is basically `plugins/* and !plugins/*/*`
+>>> * `self(/plugins)` is just `plugins` but without interpreting
+>>> globs
+>>> * `ancestor-or-self(/plugins)`, `descendant-or-self(/plugins)`
+>>> are syntactic sugar for e.g. `ancestor(/plugins) or self(/plugins)`
+>>> * `self()` always matches the current page (not destpage)
+>>> * `ancestor-or-self()` always matches the current pages and all
+>>> pages that would go in its [[plugins/parentlinks]]
+>>>
+>>> XPath has `following-sibling` and `preceding-sibling` axes for
+>>> siblings, but pagespecs are unordered, so we'd probably want
+>>> to invent `sibling()` - so `sibling(/plugins/map)` matches
+>>> `plugins/inline` but not `plugins/map` or `plugins/contrib/album`.
+>>>
+>>> Then, the requested functionality would be `sibling() or ancestor()`,
+>>> or possibly `sibling() or ancestor() or self()`?
+>>> --[[smcv]]