From c4d4cad3befbbd444d094cbeb0b6ebba3910a025 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 20 Aug 2010 10:13:14 +0200 Subject: Single dot in pagespec translates to 'current page' --- doc/ikiwiki/pagespec.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/ikiwiki/pagespec.mdwn') diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index c66395f84..7fabff9a4 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -78,3 +78,7 @@ 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". + +If you want to use the name of the page the pagespec is used in, you can use +a single dot. For example, `link(.)` matches all the pages linking to the +current page. -- cgit v1.2.3 From 00a54d1bb7826455609645aa1d0ea66cfec3f468 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 13:37:16 -0400 Subject: finish link(.) support --- debian/changelog | 1 + doc/ikiwiki/pagespec.mdwn | 6 +++--- doc/todo/support_link__40__.__41___in_pagespec.mdwn | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'doc/ikiwiki/pagespec.mdwn') diff --git a/debian/changelog b/debian/changelog index 0d36a7352..eba38c4d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ ikiwiki (3.20100816) UNRELEASED; urgency=low * Danish translation update. Closes: #594673 * highlight: Make location of highlight's files configurable in setup file to allow for nonstandard installations. + * Allow "link(.)" and similar PageSpecs. Thanks, Giuseppe Bilotta. -- Joey Hess Sun, 15 Aug 2010 11:45:48 -0400 diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index 7fabff9a4..6aec561ae 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -79,6 +79,6 @@ filenames of the pages in the wiki, so a pagespec "foo" used on page relative to the directory of the page containing the pagespec, you can use "./". For example, "./foo" on page "a/b" matches page "a/foo". -If you want to use the name of the page the pagespec is used in, you can use -a single dot. For example, `link(.)` matches all the pages linking to the -current page. +To indicate the name of the page the PageSpec is used in, you can +use a single dot. For example, `link(.)` matches all the pages +linking to the page containing the PageSpec. diff --git a/doc/todo/support_link__40__.__41___in_pagespec.mdwn b/doc/todo/support_link__40__.__41___in_pagespec.mdwn index 79809662a..653db1ff2 100644 --- a/doc/todo/support_link__40__.__41___in_pagespec.mdwn +++ b/doc/todo/support_link__40__.__41___in_pagespec.mdwn @@ -11,3 +11,11 @@ IkiWiki.pm is the best way to do it". > I implemented this suggestion in the simplest possible way, [[!taglink patch]] available [[here|http://git.oblomov.eu/ikiwiki/patch/f4a52de556436fdee00fd92ca9a3b46e876450fa]]. > An alternative approach, very similar, would be to make the empty page parameter mean current page (e.g. `link()` would mean pages linking here). The patch would be very similar. > -- GB + +>> Thanks for this, and also for your recent spam-fighting. +>> Huh, I was right about changing derel, didn't realize it would be +>> so obvious a change. :) Oh well, I managed to complicate it +>> some in optimisation pass.. ;) +>> +>> Note that your git-daemon on git.oblomov.eu seems down. +>> I pulled the patch from gitweb, [[done]] --[[Joey]] -- cgit v1.2.3 From 7e8064e9fa8b3f2c3c0bd0aa5458f00552398e06 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 20 Oct 2010 18:53:50 -0400 Subject: add a hint that creation_month takes a number, not a month name --- IkiWiki.pm | 6 +++--- doc/ikiwiki/pagespec.mdwn | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/ikiwiki/pagespec.mdwn') diff --git a/IkiWiki.pm b/IkiWiki.pm index 941ee13c4..1fa89586e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2610,7 +2610,7 @@ sub match_created_after ($$;@) { sub match_creation_day ($$;@) { my $d=shift; if ($d !~ /^\d+$/) { - return IkiWiki::FailReason->new('invalid day'); + return IkiWiki::ErrorReason->new("invalid day $d"); } if ((localtime($IkiWiki::pagectime{shift()}))[3] == shift) { return IkiWiki::SuccessReason->new('creation_day matched'); @@ -2623,7 +2623,7 @@ sub match_creation_day ($$;@) { sub match_creation_month ($$;@) { my $m=shift; if ($m !~ /^\d+$/) { - return IkiWiki::FailReason->new('invalid month'); + return IkiWiki::ErrorReason->new("invalid month $m"); } if ((localtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) { return IkiWiki::SuccessReason->new('creation_month matched'); @@ -2636,7 +2636,7 @@ sub match_creation_month ($$;@) { sub match_creation_year ($$;@) { my $y=shift; if ($y !~ /^\d+$/) { - return IkiWiki::FailReason->new('invalid year'); + return IkiWiki::ErrorReason->new("invalid year $y"); } if ((localtime($IkiWiki::pagectime{shift()}))[5] + 1900 == $y) { return IkiWiki::SuccessReason->new('creation_year matched'); diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index 6aec561ae..fe1af4c15 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -32,6 +32,7 @@ Some more elaborate limits can be added to what matches using these functions: tags matched by a glob) * "`backlink(page)`" - matches only pages that a given page links to * "`creation_month(month)`" - matches only files created on the given month + number * "`creation_day(mday)`" - or day of the month * "`creation_year(year)`" - or year * "`created_after(page)`" - matches only files created after the given page -- cgit v1.2.3