X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/2794d7ef5abc4fa8fc2eb42d5c85ada197df0767..58141a0ebcdf3313a83af712b83f8acd1c08aa3b:/basewiki/pagespec.mdwn diff --git a/basewiki/pagespec.mdwn b/basewiki/pagespec.mdwn index 318be42f9..53519e7f0 100644 --- a/basewiki/pagespec.mdwn +++ b/basewiki/pagespec.mdwn @@ -1,6 +1,6 @@ To select a set of pages, such as pages that are locked, pages whose commit emails you want subscribe to, or pages to combine into a -[[blog]], the wiki uses a PageSpec. This is an expression that matches +blog, the wiki uses a PageSpec. This is an expression that matches a set of pages. The simplest PageSpec is a simple list of pages. For example, this matches @@ -21,19 +21,23 @@ match all pages except for Discussion pages and the SandBox: * and !SandBox and !*/Discussion -It's also possible to match pages that link to a given page, by writing -"`link(page)`". Or, match pages that a given page links to, by -writing "`backlink(page)`". Or match pages created in a given month, year, -or day of the month by writing "`creation_month(month)`", -"`creation_year(year)`" or "`creation_day(mday)`". +Some more elaborate limits can be added to what matches using any of these +functions: -For example, to match all pages in a blog that link to the page about music -and were written on Mondays in 2005: +* "`link(page)`" - match only pages that link to a given page +* "`backlink(page)`" - match only pages that a given page links to +* "`creation_month(month)`" - match only pages created on the given month +* "`creation_day(mday)`" - or day of the month +* "`creation_year(year)`" - or year +* "`created_after(page)`" - match only pages created after the given page + was created +* "`created_before(page)`" - match only pages created before the given page + was created - blog/* and link(music) and creation_year(2005) and creation_day(0) +For example, to match all pages in a blog that link to the page about music +and were written in 2005: -Matches can also be used to limit matching to pages created before or after -a given date. + blog/* and link(music) and creation_year(2005) More complex expressions can also be created, by using parentheses for grouping. For example, to match pages in a blog that are tagged with either @@ -41,6 +45,12 @@ of two tags, use: blog/* and (link(tag/foo) or link(tag/bar)) +Note that page names in PageSpecs are matched against the absolute +filenames of the pages in the wiki, so a pagespec "foo" used on page +"a/b" will not match a page named "a/foo" or "a/b/foo". To match +relative to the directory of the page containing the pagespec, you can +use "./". For example, "./foo" on page "a/b" matches page "a/foo". + ## Old syntax The old PageSpec syntax was called a "GlobList", and worked differently in