]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - basewiki/pagespec.mdwn
better use gmtime here
[git.ikiwiki.info.git] / basewiki / pagespec.mdwn
1 To select a set of pages, such as pages that are locked, pages
2 whose commit emails you want subscribe to, or pages to combine into a
3 [[blog]], the wiki uses a PageSpec. This is an expression that matches
4 a set of pages.
6 The simplest PageSpec is a simple list of pages. For example, this matches
7 any of the three listed pages:
9         foo or bar or baz
11 More often you will want to match any pages that have a particular thing in
12 their name. You can do this using a glob pattern. "`*`" stands for any part
13 of a page name, and "`?`" for any single letter of a page name. So this
14 matches all pages about music, and any [[SubPage]]s of the SandBox, but does
15 not match the SandBox itself:
17         *music* or SandBox/*
19 You can also prefix an item with "`!`" to skip pages that match it. So to
20 match all pages except for Discussion pages and the SandBox:
22         * and !SandBox and !*/Discussion
24 It's also possible to match pages that link to a given page, by writing
25 "`link(page)`". Or, match pages that a given page links to, by
26 writing "`backlink(page)`". Or match pages created in a given month, year,
27 or day of the month by writing "`creation_month(month)`",
28 "`creation_year(year)`" or "`creation_day(mday)`".
30 For example, to match all pages in a blog that link to the page about music
31 and were written on Mondays in 2005:
33         blog/* and link(music) and creation_year(2005) and creation_day(0)
35 Matches can also be used to limit matching to pages created before or after
36 a given date. 
38 More complex expressions can also be created, by using parentheses for
39 grouping. For example, to match pages in a blog that are tagged with either
40 of two tags, use:
42         blog/* and (link(tag/foo) or link(tag/bar))
44 ## Old syntax
46 The old PageSpec syntax was called a "GlobList", and worked differently in
47 two ways:
49 1. "and" and "or" were not used; any page matching any item from the list
50    matched.
51 2. If an item was prefixed with "`!`", then no page matching that item
52    matched, even if it matched an earlier list item.
54 For example, here is the old way to match all pages except for the SandBox
55 and Discussion pages:
57         * !SandBox !*/Discussion
59 Using this old syntax is still supported. However, the old syntax is
60 deprecated and will be removed at some point, and using the new syntax is
61 recommended.