aboutsummaryrefslogtreecommitdiff
path: root/doc/todo/pagespec_aliases.mdwn
diff options
context:
space:
mode:
authorhttp://kerravonsen.dreamwidth.org/ <http://kerravonsen.dreamwidth.org/@web>2011-06-10 08:33:18 +0000
committeradmin <admin@branchable.com>2011-06-10 08:33:18 +0000
commit79e1bbd3cc641fe26df4094456575ee920c93f74 (patch)
tree8f642909cad9d1719095d113797f67379f5d0ce3 /doc/todo/pagespec_aliases.mdwn
parenta80d3edf2ac7da23d6e744aa905775de8fde43bb (diff)
downloadikiwiki-79e1bbd3cc641fe26df4094456575ee920c93f74.tar
ikiwiki-79e1bbd3cc641fe26df4094456575ee920c93f74.tar.gz
now changed the subset plugin interface
Diffstat (limited to 'doc/todo/pagespec_aliases.mdwn')
-rw-r--r--doc/todo/pagespec_aliases.mdwn18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/todo/pagespec_aliases.mdwn b/doc/todo/pagespec_aliases.mdwn
index 09155754c..43714dc50 100644
--- a/doc/todo/pagespec_aliases.mdwn
+++ b/doc/todo/pagespec_aliases.mdwn
@@ -166,3 +166,21 @@ Unfortunately I haven't figured out how to do the dependencies - I'd really appr
> > Cool! I like the caching idea. I'm not sure about the name. I don't like defining
> > stuff in pages, but I appreciate this is a matter of taste, and would be happy with
> > supporting both. — [[Jon]]
+
+>>> I've now gone and completely re-done "subset" so that it is less like an alias, but it a bit clearer and simpler:
+>>> instead of having a separate "match_" function for every alias, I simply have one function, "match_subset"
+>>> which takes the name of the subset. Thus a \[[!subset name="foo"...]] would be called `subset(foo)` rather than `foo()`.
+
+>>> There are a few reasons for this:<br/>
+>>> (a) it's more secure not to be evaluating code on the fly<br/>
+>>> (b) it's simpler<br/>
+>>> (c) (and this was my main reason) it makes it possible to do caching without having to have a separate "subset" argument.
+>>> I've done a bit of a hack for this: basically, the PageSpec is checked to see if the very start of the PageSpec is `subset(foo) and` or if the whole pagespec is just `subset(foo)` and if either of those is true, then it does the subset caching stuff.
+>>> The reason I check for "and" is that if it is "subset(foo) or something" then it would be an error to use the subset cache in that case.
+>>> The reason I just check the start of the PageSpec is because I don't want to have to do complex parsing of the PageSpec.
+
+>>> As for defining subsets in the config rather than on pages, I perfectly understand that desire, and I could probably add that in.
+
+>>> As for the name "subset"... well, it's even less like an alias now, and "alias" is already a reserved name. What other names would you suggest?
+
+>>>--[[KathrynAndersen]]