X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f8a7fb227b59463b37180b1e525c5d19ec0e43cb..0257186f4d75b6e24a2018bde566fb4a589f7741:/doc/plugins/testpagespec.mdwn?ds=inline diff --git a/doc/plugins/testpagespec.mdwn b/doc/plugins/testpagespec.mdwn index 28e5ba7a7..a173f5a96 100644 --- a/doc/plugins/testpagespec.mdwn +++ b/doc/plugins/testpagespec.mdwn @@ -1,12 +1,23 @@ -[[template id=plugin name=testpagespec author="[[Joey]]"]] -[[tag type/useful]] +[[!template id=plugin name=testpagespec author="[[Joey]]"]] +[[!tag type/useful]] -This plugin allows testing a [[PageSpec]] to see if it matches a page, and -if not, why it fails to match. +This plugin allows testing a [[ikiwiki/PageSpec]] to see if it matches a +page, and to see the part that matches, or causes the match to fail. -Example use: +Example uses: - \[[testpagespec pagespec="foopage and barpage" match="foopage"]] + \[[!testpagespec pagespec="foopage and barpage" match="foopage"]] -This will print out something like "barpage does not match foopage", -highlighting which part of the [[PageSpec]] is causing the match to fail. +This will print out something like "no match: barpage does not match +foopage", highlighting which part of the [[ikiwiki/PageSpec]] is causing +the match to fail. + + \[[!testpagespec pagespec="foopage or !bar*" match="barpage"]] + +This will print out something like "no match: bar* matches barpage", since +the part of the [[ikiwiki/PageSpec]] that fails is this negated match. + + \[[!testpagespec pagespec="foopage or barpage" match="barpage"]] + +This will print out something like "match: barpage matches barpage", +indicating the part of the [[ikiwiki/PageSpec]] that caused it to match.