]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/testpagespec.mdwn
sidebar: Add global_sidebars setting.
[ikiwiki.git] / doc / ikiwiki / directive / testpagespec.mdwn
1 The `testpagespec` directive is supplied by the [[!iki plugins/testpagespec desc=testpagespec]] plugin.
2
3 This directive allows testing a [[ikiwiki/PageSpec]] to see if it matches a
4 page, and to see the part that matches, or causes the match to fail.
5
6 Example uses:
7
8         \[[!testpagespec pagespec="foopage and barpage" match="foopage"]]
9
10 This will print out something like "no match: barpage does not match
11 foopage", highlighting which part of the [[ikiwiki/PageSpec]] is causing
12 the match to fail.
13         
14         \[[!testpagespec pagespec="foopage or !bar*" match="barpage"]]
15
16 This will print out something like "no match: bar* matches barpage", since
17 the part of the [[ikiwiki/PageSpec]] that fails is this negated match.
18         
19         \[[!testpagespec pagespec="foopage or barpage" match="barpage"]]
20
21 This will print out something like "match: barpage matches barpage",
22 indicating the part of the [[ikiwiki/PageSpec]] that caused it to match.
23
24 [[!meta robots="noindex, follow"]]