1 [[!meta robots="noindex, follow"]]
2 To select a set of pages, such as pages that are locked, pages
3 whose commit emails you want subscribe to, or pages to combine into a
4 blog, the wiki uses a PageSpec. This is an expression that matches
7 The simplest PageSpec is a simple list of pages. For example, this matches
8 any of the three listed pages:
12 More often you will want to match any pages that have a particular thing in
13 their name. You can do this using a glob pattern. "`*`" stands for any part
14 of a page name, and "`?`" for any single letter of a page name. So this
15 matches all pages about music, and any [[SubPage]]s of the SandBox, but does
16 not match the SandBox itself:
20 You can also prefix an item with "`!`" to skip pages that match it. So to
21 match all pages except for Discussion pages and the SandBox:
23 * and !SandBox and !*/Discussion
25 Some more elaborate limits can be added to what matches using these functions:
27 * "`link(page)`" - matches only pages that link to a given page (or glob)
28 * "`tagged(tag)`" - matches pages that are tagged or link to the given tag (or
29 tags matched by a glob)
30 * "`backlink(page)`" - matches only pages that a given page links to
31 * "`creation_month(month)`" - matches only pages created on the given month
32 * "`creation_day(mday)`" - or day of the month
33 * "`creation_year(year)`" - or year
34 * "`created_after(page)`" - matches only pages created after the given page
36 * "`created_before(page)`" - matches only pages created before the given page
38 * "`glob(someglob)`" - matches pages that match the given glob. Just writing
39 the glob by itself is actually a shorthand for this function.
40 * "`internal(glob)`" - like `glob()`, but matches even internal-use
41 pages that globs do not usually match.
42 * "`title(glob)`", "`author(glob)`", "`authorurl(glob)`",
43 "`license(glob)`", "`copyright(glob)`" - match pages that have the given
44 metadata, matching the specified glob.
45 * "`user(username)`" - tests whether a modification is being made by a
46 user with the specified username. If openid is enabled, an openid can also
47 be put here. Glob patterns can be used in the username. For example,
48 to match all openid users, use `user(*://*)`
49 * "`admin()`" - tests whether a modification is being made by one of the
51 * "`ip(address)`" - tests whether a modification is being made from the
53 * "`postcomment(glob)`" - matches only when comments are being
54 posted to a page matching the specified glob
55 * "`typedlink(type glob)`" - matches pages that link to a given page (or glob)
56 with a given link type. Plugins can create links with a specific type:
57 for instance, the tag plugin creates links of type `tag`.
59 For example, to match all pages in a blog that link to the page about music
60 and were written in 2005:
62 blog/* and link(music) and creation_year(2005)
64 Note the use of "and" in the above example, that means that only pages that
65 match each of the three expressions match the whole. Use "and" when you
66 want to combine expression like that; "or" when it's enough for a page to
67 match one expression. Note that it doesn't make sense to say "index and
68 SandBox", since no page can match both expressions.
70 More complex expressions can also be created, by using parentheses for
71 grouping. For example, to match pages in a blog that are tagged with either
74 blog/* and (tagged(foo) or tagged(bar))
76 Note that page names in PageSpecs are matched against the absolute
77 filenames of the pages in the wiki, so a pagespec "foo" used on page
78 "a/b" will not match a page named "a/foo" or "a/b/foo". To match
79 relative to the directory of the page containing the pagespec, you can
80 use "./". For example, "./foo" on page "a/b" matches page "a/foo".