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') 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') 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 fc296d49a01377704443280d9ba2c04e6aff3de0 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" Date: Thu, 23 Sep 2010 10:15:19 +0000 Subject: b00g --- doc/ikiwiki/directive/table/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/ikiwiki/directive/table/discussion.mdwn (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/table/discussion.mdwn b/doc/ikiwiki/directive/table/discussion.mdwn new file mode 100644 index 000000000..87d2e0cd1 --- /dev/null +++ b/doc/ikiwiki/directive/table/discussion.mdwn @@ -0,0 +1 @@ +The problem I have in my tables, is that some fields contain example HTML that needs to be escaped. -- cgit v1.2.3 From 5448a9324e98a8aff32c68bf00ea8093aeb99167 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" Date: Fri, 8 Oct 2010 10:05:07 +0000 Subject: --- doc/ikiwiki/directive/aggregate/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/ikiwiki/directive/aggregate/discussion.mdwn (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/aggregate/discussion.mdwn b/doc/ikiwiki/directive/aggregate/discussion.mdwn new file mode 100644 index 000000000..cf3d2022f --- /dev/null +++ b/doc/ikiwiki/directive/aggregate/discussion.mdwn @@ -0,0 +1,3 @@ +It would be awesome if table could aggregrate remote CSVs too. I want something like: + + !table file="http://cyclehireapp.com/cyclehirelive/cyclehire.csv" -- 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') 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 From d567c8b209e6643f603d04f8f62f2ca67e9154c6 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Sat, 23 Oct 2010 17:35:42 +0000 Subject: expand on using templates outside the wiki source directory --- doc/ikiwiki/directive/template.mdwn | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index 6c50fa32e..9e3ae54df 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -34,11 +34,15 @@ large chunks of marked up text to be embedded into a template: The template is a regular wiki page, located in the `templates/` subdirectory inside the source directory of the wiki. -(Alternatively, templates can be stored in a directory outside the wiki, +Alternatively, templates can be stored in a directory outside the wiki, as files with the extension ".tmpl". -By default, these are searched for in `/usr/share/ikiwiki/templates`; +By default, these are searched for in `/usr/share/ikiwiki/templates`, the `templatedir` setting can be used to make another directory be searched -first.) +first. When referring to templates outside the wiki source directory, the "id" +parameter is not interpreted as a pagespec, and you must include the full filename +of the template page, including the ".tmpl" extension. E.g.: + + \[[!template id=blogpost.tmpl]] The template uses the syntax used by the [[!cpan HTML::Template]] perl module, which allows for some fairly complex things to be done. Consult its -- cgit v1.2.3 From da9e1ea667f82d5fca9168dbed19be08040570ff Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 15 Nov 2010 14:28:05 +0000 Subject: guard templates with the if directive where necessary --- doc/ikiwiki/directive/template.mdwn | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index 9e3ae54df..df391f99e 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -60,22 +60,30 @@ few things: `text`. * To use one block of text if a variable is set and a second if it's not, use `textother text` +* Each template file included in the wiki's source will also generate a regular + wiki page. In many cases you might want to prevent some of your template + being interpreted for the regular page. Use the [[if]] directive with the + `included()` test to guard the template code. Here's a sample template: - - Name: \[[]]
- Age:
- - Favorite color:
- - No favorite color.
-
- -
- -
-
+ \[[!if test="included()" then=""" + + Name: \[[]]
+ Age:
+ + Favorite color:
+ + No favorite color.
+
+ +
+ +
+
+ """ else=""" + This is a template page. + """]] The filled out template will be formatted the same as the rest of the page that contains it, so you can include WikiLinks and all other forms of wiki -- cgit v1.2.3 From 62fc5d0c3cfdde0ae87c5364db6f6ebfa6794b14 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 15 Nov 2010 14:41:40 +0000 Subject: I totally misinterpreted what included() is supposed to be for. This reverts commit da9e1ea667f82d5fca9168dbed19be08040570ff --- doc/ikiwiki/directive/template.mdwn | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index df391f99e..9e3ae54df 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -60,30 +60,22 @@ few things: `text`. * To use one block of text if a variable is set and a second if it's not, use `textother text` -* Each template file included in the wiki's source will also generate a regular - wiki page. In many cases you might want to prevent some of your template - being interpreted for the regular page. Use the [[if]] directive with the - `included()` test to guard the template code. Here's a sample template: - \[[!if test="included()" then=""" - - Name: \[[]]
- Age:
- - Favorite color:
- - No favorite color.
-
- -
- -
-
- """ else=""" - This is a template page. - """]] + + Name: \[[]]
+ Age:
+ + Favorite color:
+ + No favorite color.
+
+ +
+ +
+
The filled out template will be formatted the same as the rest of the page that contains it, so you can include WikiLinks and all other forms of wiki -- cgit v1.2.3 From 84fff62948ad7c7aef664585e8afed86398e7fd4 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 15 Nov 2010 14:46:13 +0000 Subject: note about template inclusion --- doc/ikiwiki/directive/if.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/if.mdwn b/doc/ikiwiki/directive/if.mdwn index 2cbf70cdf..492adf499 100644 --- a/doc/ikiwiki/directive/if.mdwn +++ b/doc/ikiwiki/directive/if.mdwn @@ -43,6 +43,8 @@ with the following additional tests: * included() - Tests whether the page is being included onto another page. + Tests whether the page is being included onto another page, for example + via [[inline]] or [[map]]. Note that pages inserted into other pages + via [[template]] are not matched here. [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From ec6c1269d251c78d2eef68cb789de6cfc6272464 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Nov 2010 15:00:04 -0400 Subject: more: Add pages parameter to limit where the more is displayed. (thanks, dark) --- IkiWiki/Plugin/more.pm | 5 ++++- debian/changelog | 2 ++ doc/ikiwiki/directive/more.mdwn | 5 +++++ doc/todo/selective_more_directive.mdwn | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/ikiwiki') diff --git a/IkiWiki/Plugin/more.pm b/IkiWiki/Plugin/more.pm index 80e339a1b..6880e366d 100644 --- a/IkiWiki/Plugin/more.pm +++ b/IkiWiki/Plugin/more.pm @@ -26,7 +26,10 @@ sub preprocess (@) { $params{linktext} = $linktext unless defined $params{linktext}; - if ($params{page} ne $params{destpage}) { + if ($params{page} ne $params{destpage} && + (! exists $params{pages} || + pagespec_match($params{destpage}, $params{pages}, + location => $params{page}))) { return "\n". htmllink($params{page}, $params{destpage}, $params{page}, linktext => $params{linktext}, diff --git a/debian/changelog b/debian/changelog index 91ff0964b..faabf1993 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (3.20101113) UNRELEASED; urgency=low * websetup: Fix encoding problem when restoring old setup file. + * more: Add pages parameter to limit where the more is displayed. + (thanks, dark) -- Joey Hess Tue, 16 Nov 2010 14:23:47 -0400 diff --git a/doc/ikiwiki/directive/more.mdwn b/doc/ikiwiki/directive/more.mdwn index 506551910..bda1427f3 100644 --- a/doc/ikiwiki/directive/more.mdwn +++ b/doc/ikiwiki/directive/more.mdwn @@ -11,6 +11,11 @@ leads to the full version of the page. Use it like this: If the `linktext` parameter is omitted it defaults to just "more". +An optional `pages` parameter can be used to specify a +[[ikiwiki/PageSpec]], and then the "more" link will only be displayed +when the page is inlined into a page matching that PageSpec, and otherwise +the full content shown. + Note that you can accomplish something similar using a [[toggle]] instead. [[!meta robots="noindex, follow"]] diff --git a/doc/todo/selective_more_directive.mdwn b/doc/todo/selective_more_directive.mdwn index 24e6ab568..2a9998205 100644 --- a/doc/todo/selective_more_directive.mdwn +++ b/doc/todo/selective_more_directive.mdwn @@ -24,3 +24,5 @@ I can now call it as I'm not entirely happy with the design, since I would rather put this information in the inline directive instead of in every story post. Unfortunately I found no way to pass parameters from the inline directive to the inlined page. -- [[dark]] + +> Me neither, but nor do I see a better way, so [[applied|done]]. --[[Joey]] -- cgit v1.2.3 From 937c0629bf3d4629088171d182ada03edad46304 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 Dec 2010 14:15:55 -0400 Subject: response --- doc/ikiwiki/directive/aggregate/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/ikiwiki') diff --git a/doc/ikiwiki/directive/aggregate/discussion.mdwn b/doc/ikiwiki/directive/aggregate/discussion.mdwn index cf3d2022f..ddece9746 100644 --- a/doc/ikiwiki/directive/aggregate/discussion.mdwn +++ b/doc/ikiwiki/directive/aggregate/discussion.mdwn @@ -1,3 +1,10 @@ It would be awesome if table could aggregrate remote CSVs too. I want something like: !table file="http://cyclehireapp.com/cyclehirelive/cyclehire.csv" + +> Ok, but that has nothing to do with the aggregate plugin. File a +> [[todo]]? +> +> Anyway, it seems difficult, how would it know when the remote content +> had changed? Aggregate has its cron job support and has time stamps +> in rss feeds to rely on. --[[Joey]] -- cgit v1.2.3