X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/888ff17819b330de63fa7e73709b0475b12111ca..7ea3bfdb70172514a7c1f5567570685f085a501c:/doc/todo/pagespec_expansions.mdwn?ds=inline diff --git a/doc/todo/pagespec_expansions.mdwn b/doc/todo/pagespec_expansions.mdwn index 3e8abbace..6107f5489 100644 --- a/doc/todo/pagespec_expansions.mdwn +++ b/doc/todo/pagespec_expansions.mdwn @@ -45,6 +45,15 @@ I can see why it might not be much of an improvement. :) --Ethan >> I don't understand.. "a/b/.." matches a/b/c but not a/b/c/d ? That doesn't >> seem natural to me at all. --Ethan +>>> Ah.. in that case, why not use "a/b/* and !a/b/*/*" ? No need for a new +>>> symbol. --[[Joey]] + +>>>> I know it's not necessary, but it would be helpful. --Ethan + +>>>>> I don't see the need for a new syntax since it's only a little long +>>>>> using the old one. And of course even that can now be shortened: +>>>>> "./* and !./*/*" --[[Joey]] + OK, I took a shot at implementing the changes. I was thinking about making pagespecs relative by default but I couldn't decide whether page `foo/bar` inlining `*` should match `foo/bar/*` or `foo/*`. @@ -61,8 +70,7 @@ and you can see it work at > dependency on a pagespec that matches relative to the page. I made this > changes and it seems to work, new pages are noticed in updates. ->> OK, I was kind of flying blind for a lot of those plugins. You would ->> know better than me. +>> OK, word. > * `! $from` fails to match pages named "0" :-) @@ -98,9 +106,46 @@ and you can see it work at >> clothes/pants inlines `./jeans/*` -- probably means clothes/pants/jeans >> vacation/bermuda/blog inlines `./pics/*` -- probably vacation/bermuda/pics +>>> What strikes me about your examples is that the "right thing" is +>>> utterly contect dependent. Unfortunatly, I don't think that using +>>> bestlink inside pagespec is possible. bestlinks change as pages are +>>> added/removed, and dealing with the matches of a pagespec changing when +>>> some page that is added or removed seems Hard. +>>> +>>> Since it seems we have to arbitrarily pick one of the two behaviors, I +>>> prefer the one I picked for two reasons: +>>> 1. The other behavior can be obtained easily from it, for example, +>>> use ./c/* to limit the matches to that subdir. +>>> 2. The common case is a bunch of pages in a single directory, not lots +>>> of deeply nested subdirs. +>>> --[[Joey]] + +>>>> Context-dependence was my conclusion too. My feeling is that inlining +>>>> in a subdirectory of the current page is more common, but I don't +>>>> really know. However, I think the changes as written should work OK +>>>> with my index patch and allowing inlining from a/b/c/, so I'm +>>>> satisfied. --Ethan + > I've committed support for ./ to ikiwiki now, based on your patch. +> [[todo/done]] > --[[Joey]] >> Cool! I haven't played with it yet, but looking over the patch, I see that >> you added another parameter to match_glob, which is an approach that didn't ->> occur to me. I like it, it's more flexible. --Ethan \ No newline at end of file +>> occur to me. I like it, it's more flexible. --Ethan + +One last thing -- could you either change: + + $from=~s!/?[^/]+$!!; + +to + + $from=~s!/?[^/]*$!!; + +Or could you put in: + + $glob =~ s!//!/!g; + +somewhere? Or should I just add this to my index patch? --Ethan + +> If it's specific to your index patch, let's put it in there. --[[Joey]]