]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/testpagespec.mdwn
web commit by AlexandreDupas: Fix typo.
[ikiwiki.git] / doc / plugins / testpagespec.mdwn
1 [[template id=plugin name=testpagespec author="[[Joey]]"]]
2 [[tag type/useful]]
3
4 This plugin allows testing a [[ikiwiki/PageSpec]] to see if it matches a
5 page, and to see the part that matches, or causes the match to fail.
6
7 Example uses:
8
9         \[[testpagespec pagespec="foopage and barpage" match="foopage"]]
10
11 This will print out something like "no match: barpage does not match
12 foopage", highlighting which part of the [[ikiwiki/PageSpec]] is causing
13 the match to fail.
14         
15         \[[testpagespec pagespec="foopage or !bar*" match="barpage"]]
16
17 This will print out something like "no match: bar* matches barpage", since
18 the part of the [[ikiwiki/PageSpec]] that fails is this negated match.
19         
20         \[[testpagespec pagespec="foopage or barpage" match="barpage"]]
21
22 This will print out something like "match: barpage matches barpage",
23 indicating the part of the [[ikiwiki/PageSpec]] that caused it to match.