From 3f39e69b13851d3bed8e1cae0525d6ad8ac768cf Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 1 Aug 2009 12:31:34 +0100 Subject: Document the getsource plugin --- doc/plugins/getsource.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/plugins/getsource.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/getsource.mdwn b/doc/plugins/getsource.mdwn new file mode 100644 index 000000000..4fbf4be98 --- /dev/null +++ b/doc/plugins/getsource.mdwn @@ -0,0 +1,13 @@ +[[!template id=plugin name=getsource author="[[Will_Uther|Will]]"]] + +This plugin adds a `getsource` action to the IkiWiki CGI, and a "Source" link +that uses it to display pages' source. + +Configuration for this plugin in the setup file: + +* `getsource_mimetype => "text/plain; charset=utf-8"` + + Sets the MIME type used when page source is requested. The default is + usually appropriate, but you could set this to `application/octet-stream` + to encourage browsers to download the source to a file rather than showing + it in the browser. -- cgit v1.2.3 From cf3ab205e8104035bdea74d380bd6c5670fb0036 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 3 Aug 2009 02:56:42 -0400 Subject: note Perl module dependencies --- doc/plugins/contrib/cvs.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 1ff71d274..727c3524a 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -10,6 +10,7 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions Sy * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook, * configures the wrapper itself as a post-commit hook in `CVSROOT/loginfo`. * [`cvsps`](http://www.cobite.com/cvsps/) is required (`rcs_recentchanges()` and `rcs_diff()` need it to work). +* [[!cpan IPC::Cmd]] and [[!cpan String::ShellQuote]] are required (to safely keep `cvs` quiet and to safely escape commit messages, respectively). * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It might be possible to solve this problem with scripts like `commit_prep` and `log_accum` from CVS contrib. * Due to the name of CVS's metadata directories, it's impossible to create `.../CVS/foo.mdwn`. On case-insensitive filesystems it's also impossible to create `.../cvs/foo.mdwn`. * No testing or special-casing has been done with [[attachments|plugins/attachment]], but they'll probably need `cvs add -kb`. -- cgit v1.2.3 From 9468c553e1ee8d484e896bef4c5abbeda775cabf Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 3 Aug 2009 03:23:42 -0400 Subject: maybe prevent trying to create .../CVS/whatever.mdwn --- doc/plugins/contrib/cvs.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 727c3524a..fc5afebfd 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -12,7 +12,7 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions Sy * [`cvsps`](http://www.cobite.com/cvsps/) is required (`rcs_recentchanges()` and `rcs_diff()` need it to work). * [[!cpan IPC::Cmd]] and [[!cpan String::ShellQuote]] are required (to safely keep `cvs` quiet and to safely escape commit messages, respectively). * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It might be possible to solve this problem with scripts like `commit_prep` and `log_accum` from CVS contrib. -* Due to the name of CVS's metadata directories, it's impossible to create `.../CVS/foo.mdwn`. On case-insensitive filesystems it's also impossible to create `.../cvs/foo.mdwn`. +* Due to the name of CVS's metadata directories, it's impossible to create `.../CVS/foo.mdwn`. On case-insensitive filesystems it's also impossible to create `.../cvs/foo.mdwn`. Since the failure can have confusing effects on one's CVS checkout, perhaps the web interface should prevent the attempt. * No testing or special-casing has been done with [[attachments|plugins/attachment]], but they'll probably need `cvs add -kb`. Having a `$HOME/.cvsrc` isn't necessary. Sure does make using CVS more livable, though. Here's a good general-purpose one: -- cgit v1.2.3 From 34e5f5eba3411855c9d3c733b6f11aa935f3d435 Mon Sep 17 00:00:00 2001 From: Jogo Date: Thu, 6 Aug 2009 08:43:45 -0400 Subject: --- doc/plugins/contrib/linguas.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/linguas.mdwn b/doc/plugins/contrib/linguas.mdwn index bf502606e..84ece042e 100644 --- a/doc/plugins/contrib/linguas.mdwn +++ b/doc/plugins/contrib/linguas.mdwn @@ -10,7 +10,7 @@ Download: [linguas.pm](http://ettin.org/pub/ikiwiki/linguas.pm) (2006-08-21). Note that even though it is still available for download, this plugin is no longer actively maintained. If you are interested in multilingual wiki pages, you -can also take a look at other approaches such as [[todo/l10n]], [[plugins/contrib/po]], +can also take a look at other approaches such as [[todo/l10n]], [[plugins/po]], or Lars Wirzenius's [Static website, with translations, using IkiWiki](http://liw.iki.fi/liw/log/2007-05.html#20070528b). -- cgit v1.2.3 From 0b2100727b3e9288ff9c6587924ff5390c61f19a Mon Sep 17 00:00:00 2001 From: Jogo Date: Thu, 6 Aug 2009 09:42:56 -0400 Subject: --- doc/plugins/contrib/navbar/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/plugins/contrib/navbar/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/navbar/discussion.mdwn b/doc/plugins/contrib/navbar/discussion.mdwn new file mode 100644 index 000000000..0bbec743c --- /dev/null +++ b/doc/plugins/contrib/navbar/discussion.mdwn @@ -0,0 +1,2 @@ +Where can I download this plugin ? +-- [[jogo]] -- cgit v1.2.3 From 4a331d8afc75f9c9fbfb1ef8d592fa1bfb4e2874 Mon Sep 17 00:00:00 2001 From: Jogo Date: Thu, 6 Aug 2009 13:07:22 -0400 Subject: --- doc/plugins/contrib/unixrelpagespec.mdwn | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 doc/plugins/contrib/unixrelpagespec.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/unixrelpagespec.mdwn b/doc/plugins/contrib/unixrelpagespec.mdwn new file mode 100644 index 000000000..a35f76c30 --- /dev/null +++ b/doc/plugins/contrib/unixrelpagespec.mdwn @@ -0,0 +1,42 @@ +[[!template id=plugin name=unixrelpagespec core=0 author="[[Jogo]]"]] + +I don't understand why `./*` correspond to siblings and not subpages. +This is probably only meaningfull with [[plugins/autoindex]] turned on. + +Here is a small plugin wich follow usual Unix convention : + +- `./*` expand to subpages +- `../*` expand to siblings + +--- + #!/usr/bin/perl + # UnixRelPageSpec plugin. + # by Joseph Boudou + + package IkiWiki::Plugin::unixrelpagespec; + + use warnings; + use strict; + use IkiWiki 3.00; + + sub import { + inject( + name => 'IkiWiki::PageSpec::derel', + call => \&unix_derel + ); + } + + sub unix_derel ($$) { + my $path = shift; + my $from = shift; + + if ($path =~ m!^\.{1,2}/!) { + $from =~ s#/?[^/]+$## if (defined $from and $path =~ m/^\.{2}/); + $path =~ s#^\.{1,2}/##; + $path = "$from/$path" if length $from; + } + + return $path; + } + + 1; -- cgit v1.2.3 From c7ad7482f4357c43729214acc04901fa7fcf501e Mon Sep 17 00:00:00 2001 From: "http://bob-bernstein.myopenid.com/" Date: Thu, 6 Aug 2009 22:20:15 -0400 Subject: --- doc/plugins/htmlscrubber/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/plugins/htmlscrubber/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/htmlscrubber/discussion.mdwn b/doc/plugins/htmlscrubber/discussion.mdwn new file mode 100644 index 000000000..46697f6bd --- /dev/null +++ b/doc/plugins/htmlscrubber/discussion.mdwn @@ -0,0 +1,7 @@ +**Ok, I have yet to post a big dummy wiki-noobie question around here, so here goes:** + +Yes, I want to play around with *gulp* Google Ads on an ikiwiki blog, namely, in the *sidebar*. + +No, I do not want to turn htmlscrubber off, but apart from that I have not been able to allow <script> elements as required by Google. + +Thoughts? -- cgit v1.2.3 From 69d26eb5739fac2bac81554e3c31288011a57a48 Mon Sep 17 00:00:00 2001 From: "http://bob-bernstein.myopenid.com/" Date: Fri, 7 Aug 2009 01:09:03 -0400 Subject: --- doc/plugins/htmlscrubber/discussion.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/htmlscrubber/discussion.mdwn b/doc/plugins/htmlscrubber/discussion.mdwn index 46697f6bd..5e8b637b7 100644 --- a/doc/plugins/htmlscrubber/discussion.mdwn +++ b/doc/plugins/htmlscrubber/discussion.mdwn @@ -5,3 +5,14 @@ Yes, I want to play around with *gulp* Google Ads on an ikiwiki blog, namely, in No, I do not want to turn htmlscrubber off, but apart from that I have not been able to allow <script> elements as required by Google. Thoughts? + +--- + +***Fixed!*** + +Did some more reading, did some searching on the wiki, and found, under *embed*, these + + htmlscrubber_skip => '!*/Discussion', + locked_pages => '!*/Discussion', + +Thanks! -- cgit v1.2.3 From c0c1e05daba09ce9c73c6c2f1ceca02b488613ba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Aug 2009 12:32:39 -0400 Subject: finish merging getsource --- debian/copyright | 2 +- doc/plugins/getsource.mdwn | 4 ++-- doc/todo/source_link.mdwn | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/debian/copyright b/debian/copyright index 762f9f445..b06d27f19 100644 --- a/debian/copyright +++ b/debian/copyright @@ -136,7 +136,7 @@ Files: 404.pm Copyright: © 2009 Simon McVittie License: GPL-2+ -Files: wmd.pm +Files: wmd.pm, getsource.pm Copyright: © 2009 William Uther License: GPL-2+ diff --git a/doc/plugins/getsource.mdwn b/doc/plugins/getsource.mdwn index 4fbf4be98..20040ccee 100644 --- a/doc/plugins/getsource.mdwn +++ b/doc/plugins/getsource.mdwn @@ -1,7 +1,7 @@ [[!template id=plugin name=getsource author="[[Will_Uther|Will]]"]] -This plugin adds a `getsource` action to the IkiWiki CGI, and a "Source" link -that uses it to display pages' source. +This plugin adds a "Source" link to the top of each page that uses +the CGI to display the page's source. Configuration for this plugin in the setup file: diff --git a/doc/todo/source_link.mdwn b/doc/todo/source_link.mdwn index 0c639a314..dfc2766cc 100644 --- a/doc/todo/source_link.mdwn +++ b/doc/todo/source_link.mdwn @@ -13,6 +13,7 @@ All of this code is licensed under the GPLv2+. -- [[Will]] [[!template id=gitbranch branch=smcv/ready/getsource author="[[Will]]/[[smcv]]"]] +[[done]] >> I've applied the patch below in a git branch, fixed my earlier criticism, >> and also fixed a couple of other issues I noticed: -- cgit v1.2.3 From 255835660b91e601b250bffe5a00751767b43f87 Mon Sep 17 00:00:00 2001 From: bremner Date: Sat, 8 Aug 2009 16:48:00 -0400 Subject: question (for joeyh?) about IkiWiki::refresh() --- doc/plugins/contrib/postal/discussion.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/plugins/contrib/postal/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/postal/discussion.mdwn b/doc/plugins/contrib/postal/discussion.mdwn new file mode 100644 index 000000000..90113eb41 --- /dev/null +++ b/doc/plugins/contrib/postal/discussion.mdwn @@ -0,0 +1,15 @@ +It seems like the filter 'postal-accept.pl' I wrote doesn't refresh thoroughly enough. When a comment is added it calls + + IkiWiki::add_depends($page,$comments_page); + +And then after adding the actual comment, it ends with + + IkiWiki::refresh(); + IkiWiki::saveindex(); + +Sure enough, the page being commented on is refreshed, but not any inline pages (e.g. tags pages, blog top level) that contain it. +Is there a way to recursively refresh? Or should it work that way by default. I guess it is some part of the api that I don't understand, +since I think not many people grub about in the internals of ikiwiki this way. +It would be nice to figure this out, doing a full rebuild every time I get a blog comment is not that fun. + +[[DavidBremner]] -- cgit v1.2.3 From eb5e6b2bb63a7e1096e6f16ecc9d5bf881b23983 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Aug 2009 17:01:10 -0400 Subject: response --- doc/plugins/contrib/postal/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/postal/discussion.mdwn b/doc/plugins/contrib/postal/discussion.mdwn index 90113eb41..3e6d056e2 100644 --- a/doc/plugins/contrib/postal/discussion.mdwn +++ b/doc/plugins/contrib/postal/discussion.mdwn @@ -13,3 +13,10 @@ since I think not many people grub about in the internals of ikiwiki this way. It would be nice to figure this out, doing a full rebuild every time I get a blog comment is not that fun. [[DavidBremner]] + +> Ikiwiki currently doesn't have support for transitive dependencies. +> This is discussed deep inside [[todo/tracking_bugs_with_dependencies]] +> and in [[todo/inlines_inheriting_links]]. +> +> FYI, the [[plugins/comments]] plugin avoids this problem by only showing the +> comments on the page, and not on pages that inline it. --[[Joey]] -- cgit v1.2.3 From 3c1ebd20f84f1ec654105340a1d7c28dd3748557 Mon Sep 17 00:00:00 2001 From: bremner Date: Sat, 8 Aug 2009 17:19:07 -0400 Subject: ok, thanks. I'll probably do the same. --- doc/plugins/contrib/postal/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/postal/discussion.mdwn b/doc/plugins/contrib/postal/discussion.mdwn index 3e6d056e2..4eaacc044 100644 --- a/doc/plugins/contrib/postal/discussion.mdwn +++ b/doc/plugins/contrib/postal/discussion.mdwn @@ -20,3 +20,5 @@ It would be nice to figure this out, doing a full rebuild every time I get a blo > > FYI, the [[plugins/comments]] plugin avoids this problem by only showing the > comments on the page, and not on pages that inline it. --[[Joey]] +>> Ok, thanks for the speedy response. I guess I should do the same thing. +>> [[DavidBremner]] -- cgit v1.2.3 From c86842711ffd76b1ce52ce9a5fc21bfae136aebb Mon Sep 17 00:00:00 2001 From: "http://certifi.ca/lunix" Date: Sat, 8 Aug 2009 19:19:32 -0400 Subject: centos question --- doc/plugins/highlight/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/highlight/discussion.mdwn b/doc/plugins/highlight/discussion.mdwn index 7d3cabea9..51d70bcf9 100644 --- a/doc/plugins/highlight/discussion.mdwn +++ b/doc/plugins/highlight/discussion.mdwn @@ -10,3 +10,7 @@ if you want to implement it I won't complain :-). [[DavidBremner]] > of, but if there are multiple options, giving each its own nane would > word better for websetup than would putting all the options in a > sub-hash. --[[Joey]] + + +Has anyone got this running with CentOS/RHEL ? +Having trouble working out where to get the perl bindings for highlight. --[Mick](http://www.lunix.com.au) -- cgit v1.2.3 From a0ace62664dd767a3894c1a708b8ed49e380c368 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Aug 2009 20:27:50 -0400 Subject: point out where to get highlight perl bindings --- doc/plugins/highlight.mdwn | 6 ++++-- doc/plugins/highlight/discussion.mdwn | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/highlight.mdwn b/doc/plugins/highlight.mdwn index 44ced80f7..5f04fda52 100644 --- a/doc/plugins/highlight.mdwn +++ b/doc/plugins/highlight.mdwn @@ -8,8 +8,10 @@ languages and file formats. ## prerequisites You will need to install the perl bindings to the -[highlight library](http://www.andre-simon.de/), which in Debian -are in the [[!debpkg libhighlight-perl]] package. +[highlight library](http://www.andre-simon.de/). In Debian +they are in the [[!debpkg libhighlight-perl]] package. If +your distribution does not have them, look in `examples/swig` +in highlight's source. ## embedding highlighted code diff --git a/doc/plugins/highlight/discussion.mdwn b/doc/plugins/highlight/discussion.mdwn index 51d70bcf9..0c9e654c1 100644 --- a/doc/plugins/highlight/discussion.mdwn +++ b/doc/plugins/highlight/discussion.mdwn @@ -14,3 +14,6 @@ if you want to implement it I won't complain :-). [[DavidBremner]] Has anyone got this running with CentOS/RHEL ? Having trouble working out where to get the perl bindings for highlight. --[Mick](http://www.lunix.com.au) + +> The perl bindings are hidden in `examples/swig` in highlight's source. +> --[[Joey]] -- cgit v1.2.3 From 4e387bc6b65c4d56027ac93498e9782dbaba94d7 Mon Sep 17 00:00:00 2001 From: "http://certifi.ca/lunix" Date: Sat, 8 Aug 2009 21:11:03 -0400 Subject: reponse about highlight plugin --- doc/plugins/highlight/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/highlight/discussion.mdwn b/doc/plugins/highlight/discussion.mdwn index 0c9e654c1..3ae6149bf 100644 --- a/doc/plugins/highlight/discussion.mdwn +++ b/doc/plugins/highlight/discussion.mdwn @@ -17,3 +17,5 @@ Having trouble working out where to get the perl bindings for highlight. --[Mick > The perl bindings are hidden in `examples/swig` in highlight's source. > --[[Joey]] + +Thanks for prompt reply. Now just need to work out how to get it to work with inline code. I can not find the 'format' plugin to enable it. --[Mick](http://www.lunix.com.au) -- cgit v1.2.3 From c430c5ebd08e92f38975faa3ac99b0c68015099b Mon Sep 17 00:00:00 2001 From: "http://certifi.ca/lunix" Date: Sun, 9 Aug 2009 01:34:11 -0400 Subject: add my response --- doc/plugins/highlight/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/highlight/discussion.mdwn b/doc/plugins/highlight/discussion.mdwn index 3ae6149bf..556b04145 100644 --- a/doc/plugins/highlight/discussion.mdwn +++ b/doc/plugins/highlight/discussion.mdwn @@ -18,4 +18,4 @@ Having trouble working out where to get the perl bindings for highlight. --[Mick > The perl bindings are hidden in `examples/swig` in highlight's source. > --[[Joey]] -Thanks for prompt reply. Now just need to work out how to get it to work with inline code. I can not find the 'format' plugin to enable it. --[Mick](http://www.lunix.com.au) +Thanks for prompt reply.All working. I will post on my site tonight and link here what I did on CentOS to make this work. --[Mick](http://www.lunix.com.au) -- cgit v1.2.3 From 792026fe97c47a3da4f941dc615ebf3bd428ad37 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Sun, 9 Aug 2009 22:06:02 -0400 Subject: add install and usage directions, to-do list --- doc/plugins/contrib/cvs.mdwn | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index fc5afebfd..db9cde98b 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -2,20 +2,16 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. -* Diffs are against [[3.14159|news/version_3.14159]]. `cvs.pm` started life as a copy of `svn.pm`. -* `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. -* [[ikiwiki-makerepo]]: - * creates a repository, - * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), - * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook, - * configures the wrapper itself as a post-commit hook in `CVSROOT/loginfo`. -* [`cvsps`](http://www.cobite.com/cvsps/) is required (`rcs_recentchanges()` and `rcs_diff()` need it to work). -* [[!cpan IPC::Cmd]] and [[!cpan String::ShellQuote]] are required (to safely keep `cvs` quiet and to safely escape commit messages, respectively). -* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It might be possible to solve this problem with scripts like `commit_prep` and `log_accum` from CVS contrib. -* Due to the name of CVS's metadata directories, it's impossible to create `.../CVS/foo.mdwn`. On case-insensitive filesystems it's also impossible to create `.../cvs/foo.mdwn`. Since the failure can have confusing effects on one's CVS checkout, perhaps the web interface should prevent the attempt. -* No testing or special-casing has been done with [[attachments|plugins/attachment]], but they'll probably need `cvs add -kb`. +### Installation and usage +7. Apply patches to [`IkiWiki.pm`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-IkiWiki.pm.diff) +and [`ikiwiki-makerepo`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-ikiwiki-makerepo.diff). +7. Rebuild and install ikiwiki. +7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan IPC::Cmd]], [[!cpan String::ShellQuote]], and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. +7. Download [`cvs.pm`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs.pm) into a suitable `$libdir/IkiWiki/Plugin`. +7. While setting up a wiki [[by hand|setup/byhand]], also specify `--libdir` until you get to the point where you have a setup file. (This ensures the CVS plugin is found and its settings stanza included.) +7. Adjust CVS-related parameters in your setup file. -Having a `$HOME/.cvsrc` isn't necessary. Sure does make using CVS more livable, though. Here's a good general-purpose one: +Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn't need it, but you yourself might. Here's a good general-purpose one: cvs -q checkout -P @@ -23,10 +19,19 @@ Having a `$HOME/.cvsrc` isn't necessary. Sure does make using CVS more livable, diff -u rdiff -u -Not knowing how the tests get set up, I blindly attempted to add subversion-like tests to `t/file_pruned.t`. They fail. But the plugin definitely works. :-) +### Implementation details +* Diffs are against [[3.14159|news/version_3.14159]]. `cvs.pm` started life as a copy of `svn.pm`. +* `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. +* [[ikiwiki-makerepo]]: + * creates a repository, + * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), + * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook, + * configures the wrapper itself as a post-commit hook in `CVSROOT/loginfo`. +* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum`scripts (see below). -### Code -* [`cvs.pm`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs.pm) -* [`cvs-IkiWiki.pm.diff`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-IkiWiki.pm.diff) -* [`cvs-ikiwiki-makerepo.diff`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-ikiwiki-makerepo.diff) -* [`cvs-t-file_pruned.t.diff`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-t-file_pruned.t.diff) +### To do +* Add automated tests. ([Blindly adding svn-like tests to `t/file_pruned.t`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-t-file_pruned.t.diff) doesn't do the trick.) +* If the argument to `cvs add` smells like a binary file, `cvs add -kb` it (for [[plugins/attachment]] support). +* Don't slurp the entire `cvsps` output into memory (!). +* Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. +* Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. -- cgit v1.2.3 From af29201c3ce1099fbc3f8e6986d098fac6cef249 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Sun, 9 Aug 2009 22:09:42 -0400 Subject: the post-commit wrapper wrapper also avoids cvs deadlock --- doc/plugins/contrib/cvs.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index db9cde98b..f466b9399 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -25,9 +25,9 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), - * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook, + * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook (and avoid `cvs` locking against itself), * configures the wrapper itself as a post-commit hook in `CVSROOT/loginfo`. -* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum`scripts (see below). +* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). ### To do * Add automated tests. ([Blindly adding svn-like tests to `t/file_pruned.t`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-t-file_pruned.t.diff) doesn't do the trick.) -- cgit v1.2.3 From 83480665c256a344900fc817bcb4618f8db9aeee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Aug 2009 15:59:32 -0400 Subject: po: Fix copy of po file from underlay when editing When first editing a page that was in the underlay, avoid losing the translation by copying the po file over from the underlay. --- IkiWiki/Plugin/po.pm | 15 +++++++++++++++ doc/plugins/po.mdwn | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 0ae4adcfc..e9dc9dd8c 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -827,6 +827,21 @@ sub refreshpofiles ($@) { foreach my $pofile (@pofiles) { IkiWiki::prep_writefile(basename($pofile),dirname($pofile)); + + if (! -e $pofile) { + # If the po file exists in an underlay, copy it + # from there. + my ($pobase)=$pofile=~/^\Q$config{srcdir}\E\/?(.*)$/; + foreach my $dir (@{$config{underlaydirs}}) { + if (-e "$dir/$pobase") { + File::Copy::syscopy("$dir/$pobase",$pofile) + or error("po(refreshpofiles) ". + sprintf(gettext("failed to copy underlay PO file to %s"), + $pofile)); + } + } + } + if (-e $pofile) { system("msgmerge", "--previous", "-q", "-U", "--backup=none", $pofile, $potfile) == 0 or error("po(refreshpofiles) ". diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 0c8110563..2fbf67016 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -277,17 +277,6 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] -Bug when editing underlay file ------------------------------- - -While I've gotten translated underlays working, there is a bug -if the wiki is currently using a page from the underlay, and the master -language version is edited. This causes the edited page to be saved -to srcdir.. and all the translations get set to 0% and their -po files have the translated strings "emptied". What's really going on -is that these are entirely new po files not based on the old ones -in the basewiki, and thus lacking translations. --[[Joey]] - Documentation ------------- -- cgit v1.2.3 From 8ba32abaf27110d86a52720bcb738402bf90fadb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 17:55:01 -0400 Subject: review: question --- doc/plugins/contrib/cvs/discussion | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/plugins/contrib/cvs/discussion (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion b/doc/plugins/contrib/cvs/discussion new file mode 100644 index 000000000..e2411af63 --- /dev/null +++ b/doc/plugins/contrib/cvs/discussion @@ -0,0 +1,5 @@ +I've started reviewing this, and the main thing I don't like is the +post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. +That just seems unnecessarily complicated. Why can't ikiwiki itself detect +the "cvs add " call and avoid doing anything in that case? +--[[Joey]] -- cgit v1.2.3 From 3401dc6110ac785c1df3f447d2f1de017be92538 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 18:12:28 -0400 Subject: fix name --- doc/plugins/contrib/cvs/discussion | 5 ----- doc/plugins/contrib/cvs/discussion.mdwn | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 doc/plugins/contrib/cvs/discussion create mode 100644 doc/plugins/contrib/cvs/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion b/doc/plugins/contrib/cvs/discussion deleted file mode 100644 index e2411af63..000000000 --- a/doc/plugins/contrib/cvs/discussion +++ /dev/null @@ -1,5 +0,0 @@ -I've started reviewing this, and the main thing I don't like is the -post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. -That just seems unnecessarily complicated. Why can't ikiwiki itself detect -the "cvs add " call and avoid doing anything in that case? ---[[Joey]] diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn new file mode 100644 index 000000000..e2411af63 --- /dev/null +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -0,0 +1,5 @@ +I've started reviewing this, and the main thing I don't like is the +post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. +That just seems unnecessarily complicated. Why can't ikiwiki itself detect +the "cvs add " call and avoid doing anything in that case? +--[[Joey]] -- cgit v1.2.3 From d13c07dec1a5516b7fa595004e16021f2a182bb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 15:20:46 -0400 Subject: noticed a problem --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2fbf67016..4e1bf20bb 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -277,6 +277,15 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] +Name of toplevel index page +--------------------------- + +Normally at the top index page of a wiki, you see the wiki name at +the top. However, at the top *translated* index page, you see something +like "index.da". + + + Documentation ------------- -- cgit v1.2.3 From 1b63a0e4fae5396014ed222647ae9c3c88a35de5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 16:15:36 -0400 Subject: another problem --- doc/plugins/po.mdwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 4e1bf20bb..5016f1037 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -282,9 +282,17 @@ Name of toplevel index page Normally at the top index page of a wiki, you see the wiki name at the top. However, at the top *translated* index page, you see something -like "index.da". +like "index.da". --[[Joey]] +Pagespecs +--------- +I was suprised that, when using the map directive, a pagespec of "*" +listed all the translated pages as well as regular pages. That can +make a big difference to an existing wiki when po is turned on, +and seems generally not wanted. +(OTOH, you do want to match translated pages by +default when locking pages.) --[[Joey]] Documentation ------------- -- cgit v1.2.3 From 43e895ec78a00a53aca31a5b38c18e8ef4ab6842 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 17:29:05 -0400 Subject: another problem --- doc/plugins/po.mdwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 5016f1037..f738d61de 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -248,7 +248,7 @@ ea753782b222bf4ba2fb4683b6363afdd9055b64, which should be reverted once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` -and `meta` branches, and thus has thise additional features. +and `meta` branches, and thus has this additional features. Self links ---------- @@ -294,6 +294,18 @@ and seems generally not wanted. (OTOH, you do want to match translated pages by default when locking pages.) --[[Joey]] +Edit links on untranslated pages +-------------------------------- + +If a page is not translated yet, the "translated" version of it +displays wikilinks to other, existing (but not yet translated?) +pages as edit links, as if those pages do not exist. + +That's really confusing, especially as clicking such a link +brings up an edit form to create a new, english page. + +This is with po_link_to=current. With default, it doesn't happen.. + Documentation ------------- -- cgit v1.2.3 From 7d901b9a5412e94ab127fcc447536e391eba0399 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 19:16:22 -0400 Subject: another problem.. --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f738d61de..f6409aae5 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -306,6 +306,20 @@ brings up an edit form to create a new, english page. This is with po_link_to=current. With default, it doesn't happen.. +Double commits of po files +-------------------------- + +When adding a new english page, the po files are created, committed, +and then committed again. The second commit makes this change: + + -"Content-Type: text/plain; charset=utf-8\n" + -"Content-Transfer-Encoding: ENCODING" + +"Content-Type: text/plain; charset=UTF-8\n" + +"Content-Transfer-Encoding: ENCODING\n" + +Same thing happens when a change to an existing page triggers a po file +update. + Documentation ------------- -- cgit v1.2.3 From 7ea1f9692687310fb434a7cc6e6f84b57b9f4ef8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 19:39:51 -0400 Subject: apache config details --- doc/plugins/po.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f6409aae5..30f2e158e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -114,7 +114,8 @@ Apache Using Apache `mod_negotiation` makes it really easy to have Apache serve any page in the client's preferred language, if available. -This is the default Debian Apache configuration. + +Add 'Options MultiViews' to the wiki directory's configuration in Apache. When `usedirs` is enabled, one has to set `DirectoryIndex index` for the wiki context. @@ -123,6 +124,8 @@ Setting `DefaultLanguage LL` (replace `LL` with your default MIME language code) for the wiki context can help to ensure `bla/page/index.en.html` is served as `Content-Language: LL`. +For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html). + lighttpd -------- -- cgit v1.2.3 From 0e4f67842a449d4f25b79836078a352007ea27b9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 21:00:27 -0400 Subject: update --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 30f2e158e..684593bf3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -307,7 +307,7 @@ pages as edit links, as if those pages do not exist. That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. -This is with po_link_to=current. With default, it doesn't happen.. +This is with po_link_to=current or negotiated. With default, it doesn't happen.. Double commits of po files -------------------------- -- cgit v1.2.3 From 4ff3e2a540d154d49dfc70fb89dcc8422f2047e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 22:18:05 -0400 Subject: po: Better fix for missing underlay translation problem. If a page is taken from the underlay, and one of the specified languages does not have po files in the underlay, it would create a broken link to the translated version of the page for that language. With this change, there's no broken link. --- IkiWiki/Plugin/po.pm | 4 ++-- doc/plugins/po.mdwn | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index ce32aab05..aa3d72b90 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -891,7 +891,7 @@ sub percenttranslated ($) { my $page=shift; $page=~s/^\///; - return gettext("0") unless istranslation($page); + return gettext("N/A") unless istranslation($page); my $file=srcfile($pagesources{$page}); my $masterfile = srcfile($pagesources{masterpage($page)}); my %options = ( @@ -934,7 +934,7 @@ sub otherlanguagesloop ($) { master => 1, }; } - else { + elsif (istranslation($otherpage)) { push @ret, { url => urlto_with_orig_beautiful_urlpath($otherpage, $page), code => $lang, diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 684593bf3..3766ad295 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -307,7 +307,8 @@ pages as edit links, as if those pages do not exist. That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. -This is with po_link_to=current or negotiated. With default, it doesn't happen.. +This is with po_link_to=current or negotiated. With default, it doesn't +happen.. --[[Joey]] Double commits of po files -------------------------- @@ -321,7 +322,7 @@ and then committed again. The second commit makes this change: +"Content-Transfer-Encoding: ENCODING\n" Same thing happens when a change to an existing page triggers a po file -update. +update. --[[Joey]] Documentation ------------- -- cgit v1.2.3 From 216f5b5b203ca3ea9ddb3f6d8c2e03dae35aeb7e Mon Sep 17 00:00:00 2001 From: PaulePanter Date: Sun, 16 Aug 2009 08:34:57 -0400 Subject: Add sentence to clarify how to get feeds for the RecentChanges page. --- doc/plugins/recentchanges.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn index 4ab2cd078..9375296a4 100644 --- a/doc/plugins/recentchanges.mdwn +++ b/doc/plugins/recentchanges.mdwn @@ -24,3 +24,6 @@ Here's an example of how to show only changes that Joey didn't make. \[[!inline pages="internal(recentchanges/change_*) and !author(joey) and !author(http://joey.kitenet.net*)" template=recentchanges show=0]] + +If you want to generate feeds for the RecentChanges page, you have to use +[[`rss`_or_`atom`_in_the_setup_file|/todo/minor adjustment to setup documentation for recentchanges feeds]]. -- cgit v1.2.3 From b5576b556027e8f9b9ad52e02b383b8644adfb33 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 16 Aug 2009 11:58:28 -0400 Subject: Life is simpler on a git branch. --- doc/plugins/contrib/cvs.mdwn | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index f466b9399..23e00201f 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -1,14 +1,11 @@ [[!template id=plugin name=cvs core=0 author="[[schmonz]]"]] +[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] + This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. -### Installation and usage -7. Apply patches to [`IkiWiki.pm`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-IkiWiki.pm.diff) -and [`ikiwiki-makerepo`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-ikiwiki-makerepo.diff). -7. Rebuild and install ikiwiki. +### Usage 7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan IPC::Cmd]], [[!cpan String::ShellQuote]], and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. -7. Download [`cvs.pm`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs.pm) into a suitable `$libdir/IkiWiki/Plugin`. -7. While setting up a wiki [[by hand|setup/byhand]], also specify `--libdir` until you get to the point where you have a setup file. (This ensures the CVS plugin is found and its settings stanza included.) 7. Adjust CVS-related parameters in your setup file. Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn't need it, but you yourself might. Here's a good general-purpose one: @@ -20,7 +17,7 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn rdiff -u ### Implementation details -* Diffs are against [[3.14159|news/version_3.14159]]. `cvs.pm` started life as a copy of `svn.pm`. +* `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. * `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. * [[ikiwiki-makerepo]]: * creates a repository, @@ -30,7 +27,7 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). ### To do -* Add automated tests. ([Blindly adding svn-like tests to `t/file_pruned.t`](http://www.netbsd.org/~schmonz/ikiwiki-cvs/cvs-t-file_pruned.t.diff) doesn't do the trick.) +* Add automated tests. (Blindly adding svn-like tests to `t/file_pruned.t` doesn't do the trick.) * If the argument to `cvs add` smells like a binary file, `cvs add -kb` it (for [[plugins/attachment]] support). * Don't slurp the entire `cvsps` output into memory (!). * Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. -- cgit v1.2.3 From db041b8854d2d3f7137367e11e960ac4f6cdb6c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 Aug 2009 13:53:44 -0400 Subject: minor problem --- doc/plugins/po.mdwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3766ad295..3f91775f1 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -308,7 +308,19 @@ That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. This is with po_link_to=current or negotiated. With default, it doesn't -happen.. --[[Joey]] +happen.. + +Also, this may only happen if the page being linked to is coming from an +underlay, and the underlays lack translation to a given language. +--[[Joey]] + +recentchanges links to po files +------------------------------- + +When a po file is changed, the recentchanges page shows a link such as +"sandbox.es". But, clicking on it goes to the English (or negotiated +language) version of the page. It would be better in this one case if +the link went direct to the translated version of the page. --[[Joey]] Double commits of po files -------------------------- -- cgit v1.2.3 From f712ffa66df2edc119d34a09a76b0c4d82563543 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Aug 2009 14:12:37 -0400 Subject: another issue --- doc/plugins/po.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3f91775f1..dca2f5d66 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -336,6 +336,11 @@ and then committed again. The second commit makes this change: Same thing happens when a change to an existing page triggers a po file update. --[[Joey]] +Ugly messages with empty files +------------------------------ + +If there are empty .mdwn files, the po plugin displays some ugly messages. + Documentation ------------- -- cgit v1.2.3 From 24d43bea075354ecd8546131529a064140b9039c Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Thu, 20 Aug 2009 16:10:56 -0400 Subject: response --- doc/plugins/contrib/cvs/discussion.mdwn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index e2411af63..847d0f92a 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -3,3 +3,33 @@ post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. That just seems unnecessarily complicated. Why can't ikiwiki itself detect the "cvs add " call and avoid doing anything in that case? --[[Joey]] + +> The wrapper wrapper does three things: +> +> 7. It ignores `cvs add `, since this is a weird CVS +> behavior that ikiwiki gets confused by and doesn't need to act on. +> 7. It prevents `cvs` locking against itself: `cvs commit` takes a +> write lock and runs the post-commit hook, which runs `cvs update`, +> which wants a read lock and sleeps forever -- unless the post-commit +> hook runs in the background so the commit can "finish". +> 7. It fails silently if the ikiwiki post-commit hook is missing. +> CVS doesn't have any magic post-commit filenames, so hooks have to +> be configured explicitly. I don't think a commit will actually fail +> if a configured post-commit hook is missing (though I can't test +> this at the moment). +> +> Thing 1 can probably be handled within ikiwiki, if that seems less +> gross to you. +> +> Thing 2 I'm less sure of. (I'd like to see the web UI return +> immediately on save anyway, to a temporary "rebuilding, please wait +> if you feel like knowing when it's done" page, but this problem +> with CVS happens with any kind of commit, and could conceivably +> happen with some other VCS.) +> +> Thing 3 I think I did in order to squelch the error messages that +> were bollixing up the CGI. It was easy to do this in the wrapper +> wrapper, but if that's going away, it can be done just as easily +> with output redirection in `CVSROOT/loginfo`. +> +> --[[schmonz]] -- cgit v1.2.3 From 73e562edc865c6357cc1b4c8436e0a44957800e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Aug 2009 16:09:26 -0400 Subject: response --- doc/plugins/contrib/cvs/discussion.mdwn | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 847d0f92a..ed6cf506e 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -20,16 +20,34 @@ the "cvs add " call and avoid doing anything in that case? > > Thing 1 can probably be handled within ikiwiki, if that seems less > gross to you. -> + +>> It seems like it might be. You can use a `getopt` hook to check +>> `@ARGV` to see how it was called. --[[Joey]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem > with CVS happens with any kind of commit, and could conceivably > happen with some other VCS.) -> + +>> None of the other VCSes let a write lock block a read lock, apparently. +>> +>> Anyway, re the backgrounding, when committing via the web, the +>> post-commit hook doesn't run anyway; the rendering is done via the +>> ikiwiki CGI. It would certianly be nice if it popped up a quick "working" +>> page and replaced it with the updated page when done, but that's +>> unrelated; the post-commit +>> hook only does rendering when committing using the VCS directly. The +>> backgrounding you do actually seems safe enough -- but tacking +>> on a " &" to the ikiwiki wrapper call doesn't need a wrapper script, +>> does it? --[[Joey]] + > Thing 3 I think I did in order to squelch the error messages that > were bollixing up the CGI. It was easy to do this in the wrapper > wrapper, but if that's going away, it can be done just as easily > with output redirection in `CVSROOT/loginfo`. > > --[[schmonz]] + +>> If the error messages screw up the CGI they must go to stdout. +>> I thought we had stderr even in the the CVS dark ages. ;-) --[[Joey]] -- cgit v1.2.3 From 7849d675a3cf3792a271a2fa9fc9172b394b3f25 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sat, 22 Aug 2009 02:02:34 -0400 Subject: response --- doc/plugins/contrib/cvs/discussion.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index ed6cf506e..65b6befd1 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -24,6 +24,13 @@ the "cvs add " call and avoid doing anything in that case? >> It seems like it might be. You can use a `getopt` hook to check >> `@ARGV` to see how it was called. --[[Joey]] +>>> This does the trick iff the post-commit wrapper passes its args +>>> along. Committed on my branch. This seems potentially dangerous, +>>> since the args passed to ikiwiki are influenced by web commits. +>>> I don't see an exploit, but for paranoia's sake, maybe the wrapper +>>> should only be built with execv() if the cvs plugin is loaded? +>>> --[[schmonz]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem @@ -42,6 +49,9 @@ the "cvs add " call and avoid doing anything in that case? >> on a " &" to the ikiwiki wrapper call doesn't need a wrapper script, >> does it? --[[Joey]] +>>> Nope, it works fine to append it to the `CVSROOT/loginfo` line. +>>> Fixed on my branch. --[[schmonz]] + > Thing 3 I think I did in order to squelch the error messages that > were bollixing up the CGI. It was easy to do this in the wrapper > wrapper, but if that's going away, it can be done just as easily @@ -51,3 +61,10 @@ the "cvs add " call and avoid doing anything in that case? >> If the error messages screw up the CGI they must go to stdout. >> I thought we had stderr even in the the CVS dark ages. ;-) --[[Joey]] + +>>> Some messages go to stderr, but definitely not all. That's why +>>> I wound up reaching for IPC::Cmd, to execute the command line +>>> safely while shutting CVS up. Anyway, I've tested what happens +>>> if a configured post-commit hook is missing, and it seems fine, +>>> probably also thanks to IPC::Cmd. +>>> --[[schmonz]] -- cgit v1.2.3 From 2acc71849d78d1dde7ac237e8ebc54d33548e9e7 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sat, 22 Aug 2009 03:52:45 -0400 Subject: no more wrapper wrapper --- doc/plugins/contrib/cvs.mdwn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 23e00201f..6b600eef7 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -22,8 +22,7 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), - * creates a small post-commit wrapper to prevent `cvs add ` from being seen by ikiwiki's [[post-commit]] hook (and avoid `cvs` locking against itself), - * configures the wrapper itself as a post-commit hook in `CVSROOT/loginfo`. + * configures the post-commit hook in `CVSROOT/loginfo`. * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). ### To do -- cgit v1.2.3 From 59527de76708616bc8966d0ced3577573c3062b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 22 Aug 2009 14:29:18 -0400 Subject: uh oh --- doc/plugins/contrib/cvs/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 65b6befd1..b063a53c2 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -31,6 +31,11 @@ the "cvs add " call and avoid doing anything in that case? >>> should only be built with execv() if the cvs plugin is loaded? >>> --[[schmonz]] +>>>> Hadn't considered that. While in wrapper mode the normal getopt is not +>>>> done, plugin getopt still runs, and so any unsafe options that +>>>> other plugins support could be a problem if another user runs +>>>> the setuid wrapper and passes those options through. --[[Joey]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem -- cgit v1.2.3 From 0d5a8bc3f060a26069df4c20880888303ff41d55 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 23 Aug 2009 15:41:29 -0400 Subject: new rsync plugin --- doc/plugins/contrib/rsync.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/plugins/contrib/rsync.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync.mdwn b/doc/plugins/contrib/rsync.mdwn new file mode 100644 index 000000000..71cd63947 --- /dev/null +++ b/doc/plugins/contrib/rsync.mdwn @@ -0,0 +1,21 @@ +[[!template id=plugin name=rsync core=0 author="[[schmonz]]"]] + +[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] + +This plugin allows ikiwiki to push generated pages to another host +by running a command such as `rsync`. + +### Usage +7. Enable automated SSH key exchange between ikiwiki and the remote + host. [keychain](http://www.gentoo.org/proj/en/keychain/) makes + it easy to use a passphrase-protected key for this purpose. It's + also a good idea to specify the exact command line to be permitted + in the remote host's `$HOME/.ssh/authorized_keys`. +7. Set `rsync_command` in your setup file. If you're using a + passphrase-protected key, then set `rsync_command` to a shell + script which reads `keychain`'s current state before calling + `rsync`. + +### Implementation details +* The plugin relies on a new "postrefresh" hook called at the very end of + `IkiWiki/Render.pm:refresh()`. -- cgit v1.2.3 From 18a7b65094ca761fea0785a81f3c0923ea66b018 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 23 Aug 2009 18:15:56 -0400 Subject: response --- doc/plugins/contrib/cvs/discussion.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index b063a53c2..2de938fb7 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -36,6 +36,19 @@ the "cvs add " call and avoid doing anything in that case? >>>> other plugins support could be a problem if another user runs >>>> the setuid wrapper and passes those options through. --[[Joey]] +>>>>> I've tried compiling the argument check into the wrapper as +>>>>> the first thing main() does, and was surprised to find that +>>>>> this doesn't prevent the `cvs add ` deadlock in a web +>>>>> commit. I was convinced this'd be a reasonable solution, +>>>>> especially if conditionalized on the cvs plugin being loaded, +>>>>> but it doesn't work. And I stuck debug printfs at the beginning +>>>>> of all the rcs_foo() subs, and whatever `cvs add ` is +>>>>> doing to ikiwiki isn't visible to my plugin, because none of +>>>>> those subs are getting called. Nuts. Can you think of anything +>>>>> else that might solve the problem, or should I go back to +>>>>> generating a minimal wrapper wrapper that checks for just +>>>>> this one thing? --[[schmonz]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem -- cgit v1.2.3 From 80ca685385cd827f19718eaea5fb772782f68d3b Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 23 Aug 2009 23:27:53 -0400 Subject: why I needed this, in case it's useful to someone else --- doc/plugins/contrib/rsync/discussion.mdwn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/plugins/contrib/rsync/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn new file mode 100644 index 000000000..a2c2eb725 --- /dev/null +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -0,0 +1,27 @@ +## A use case + +Why I needed this plugin: I have two web servers available to me +for a project. Neither does everything I need, but together they +do. (This is a bit like the [Amazon S3 +scenario](http://kitenet.net/~joey/blog/entry/running_a_wiki_on_Amazon_S3/).) + +Server (1) is a university web server. It provides plentiful space +and bandwidth, easy authentication for people editing the wiki, and +a well-known stable URL. The wiki really wants to live here and +very easily could except that the server doesn't allow arbitrary +CGIs. + +Server (2) is provided by a generous alumnus's paid [[tips/DreamHost]] +account. Disk and particularly network usage need to be minimized +because over some threshold it costs him. CGI, etc. are available. + +My plan was to host the wiki on server (1) by taking advantage of +server (2) to store the repository, source checkout, and generated +pages, to host the repository browser, and to handle ikiwiki's CGI +operations. In order for this to work, web edits on (2) would need +to automatically push any changed pages to (1). + +As a proof of concept, I added an rsync post-commit hook after +ikiwiki's usual. It worked, just not for web edits, which is how +the wiki will be used. So I wrote this plugin to finish the job. +The wiki now lives on (1), and clicking "edit" just works. -- cgit v1.2.3 From a27861c512bcf5808c59d9bc2b38c80b559d6d69 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Mon, 24 Aug 2009 03:13:25 -0400 Subject: Comment on another possible solution to the use case. --- doc/plugins/contrib/rsync/discussion.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn index a2c2eb725..b2d21e6d5 100644 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -25,3 +25,14 @@ As a proof of concept, I added an rsync post-commit hook after ikiwiki's usual. It worked, just not for web edits, which is how the wiki will be used. So I wrote this plugin to finish the job. The wiki now lives on (1), and clicking "edit" just works. + +> Just out of interest, why use `rsync` and not `git push`. i.e. a +> different setup to solve the same problem would be to run a +> normal ikiwiki setup on the universities server with its git +> repository available over ssh (same security setup your using +> for rsync should work for git over ssh). On the cgi-capable server, +> when it would rsync, make it git push. It would seem that git +> has enough information that it should be able to be more +> network efficient. It also means that corruption at one end +> wouldn't be propagated to the other end. -- [[Will]] + -- cgit v1.2.3 From 8d504e6b3dcacd333c0b07387e7acd3bf8a65d9c Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 24 Aug 2009 04:20:31 -0400 Subject: response --- doc/plugins/contrib/rsync/discussion.mdwn | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn index b2d21e6d5..20c04af0f 100644 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -24,7 +24,7 @@ to automatically push any changed pages to (1). As a proof of concept, I added an rsync post-commit hook after ikiwiki's usual. It worked, just not for web edits, which is how the wiki will be used. So I wrote this plugin to finish the job. -The wiki now lives on (1), and clicking "edit" just works. +The wiki now lives on (1), and clicking "edit" just works. --[[schmonz]] > Just out of interest, why use `rsync` and not `git push`. i.e. a > different setup to solve the same problem would be to run a @@ -36,3 +36,13 @@ The wiki now lives on (1), and clicking "edit" just works. > network efficient. It also means that corruption at one end > wouldn't be propagated to the other end. -- [[Will]] +>> Hey, that's a nice solution. (The site was in svn to begin with, +>> but it's in git now.) One advantage of my approach in this particular +>> case: server (1) doesn't have `git` installed, but does have `rsync`, +>> so (1)'s environment can remain completely untweaked other than the +>> SSH arrangement. I kind of like that all the sysadmin effort is +>> contained on one host. +>> +>> This plugin is definitely still useful for projects not able to use +>> a DVCS (of which I've got at least one other), and possibly for +>> other uses not yet imagined. ;-) --[[schmonz]] -- cgit v1.2.3 From 43db8269a002daf00ac6195d4bd70018b4b68b75 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 24 Aug 2009 15:47:24 -0400 Subject: response --- doc/plugins/contrib/cvs/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 2de938fb7..e1fa6e428 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -49,6 +49,9 @@ the "cvs add " call and avoid doing anything in that case? >>>>> generating a minimal wrapper wrapper that checks for just >>>>> this one thing? --[[schmonz]] +>>>>>> I don't see how there could possibly be a difference between +>>>>>> ikiwiki's C wrapper and your shell wrapper wrapper here. --[[Joey]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem -- cgit v1.2.3 From 145d89a6fc03936cc36d70946a8471da9bfe468a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 01:05:07 -0400 Subject: po: maybe fixed self links --- doc/plugins/po.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index dca2f5d66..b4c8b135e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -260,7 +260,9 @@ If a page contains a WikiLink to itself, ikiwiki does not normally turn that into a hyperlink. However, if a translated page contains a WikiLink to itself, a hyperlink is inserted, at least with the default `po_link_to` the link points to the English version of the page. Is there a -good reason for that to be done? --[[Joey]] +good reason for that to be done? --[[Joey]] + +> The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] Language display order ---------------------- -- cgit v1.2.3 From 7bd7e78e4a7d31c460909776057687e0e29dba12 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 01:41:55 -0400 Subject: po: commenting some TODO items --- doc/plugins/po.mdwn | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index b4c8b135e..45630d763 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -282,12 +282,23 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] +> It would replace it. The only problematic case is when another +> plugin has its own reasons, in its `scan` hook, to add a page +> that is already there to `$links{$page}`. This other plugin's +> effect might then be changed by po's `scan` hook... which could +> be either good (better overall l10n) or bad (break the other +> plugin's goal). --[[intrigeri]] + Name of toplevel index page --------------------------- Normally at the top index page of a wiki, you see the wiki name at the top. However, at the top *translated* index page, you see something -like "index.da". --[[Joey]] +like "index.da". --[[Joey]] + +> I suggest changing `Render.pm`, line 115, to replace the `$page eq 'index'` +> test with a predicate call such as isindexpage($page). Such a predicate +> function could then be overriden by the po plugin. --[[intrigeri]] Pagespecs --------- -- cgit v1.2.3 From d5a04b2de9ce027c0e4cd47c9342bcd3db7f9f27 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 02:00:48 -0400 Subject: po: more TODO items comments and patches --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 45630d763..079a36633 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -335,6 +335,10 @@ When a po file is changed, the recentchanges page shows a link such as language) version of the page. It would be better in this one case if the link went direct to the translated version of the page. --[[Joey]] +> The (untested) commit 496e8523c670 in my po branch might fix this... +> or at least, I believe, put someone on the right track. +> --[[intrigeri]] + Double commits of po files -------------------------- -- cgit v1.2.3 From 4ce93af516360a223016681961481f51a3ce81f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Aug 2009 13:09:43 -0400 Subject: translation of directives --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 079a36633..9273da399 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -358,6 +358,15 @@ Ugly messages with empty files If there are empty .mdwn files, the po plugin displays some ugly messages. +Translation of directives +------------------------- + +If a translated page contains a directive, it may expand to some english +text, or text in whatever single language ikiwiki is configured to "speak". + +Maybe there could be a way to switch ikiwiki to speaking another language +when building a non-english page? Then the directives would get translated. + Documentation ------------- -- cgit v1.2.3 From 18fc71f033cf0ff9ccd6ef16212ce3b4e34ac725 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 12:56:24 -0400 Subject: unsure if this patch is enough --- doc/plugins/po.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9273da399..b77c545d9 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -264,6 +264,11 @@ good reason for that to be done? --[[Joey]] > The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] +>> It may fix it in passing, but shouldn't it also be fixed for the other +>> `po_link_to` styles? (Also, if `mybestlink` is going to always +>> just return `bestlink` in this case, there seems no reason to inject +>> it.) --[[Joey]] + Language display order ---------------------- -- cgit v1.2.3 From e1acb707db3f204708f88648ed80762689a15425 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 12:57:04 -0400 Subject: cherry-picked fix for recentchanges links --- doc/plugins/po.mdwn | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index b77c545d9..2e32d78fd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -332,18 +332,6 @@ Also, this may only happen if the page being linked to is coming from an underlay, and the underlays lack translation to a given language. --[[Joey]] -recentchanges links to po files -------------------------------- - -When a po file is changed, the recentchanges page shows a link such as -"sandbox.es". But, clicking on it goes to the English (or negotiated -language) version of the page. It would be better in this one case if -the link went direct to the translated version of the page. --[[Joey]] - -> The (untested) commit 496e8523c670 in my po branch might fix this... -> or at least, I believe, put someone on the right track. -> --[[intrigeri]] - Double commits of po files -------------------------- -- cgit v1.2.3 From 5e515b493c00c70095aeb8bad1e0b7757ed943db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 13:10:31 -0400 Subject: followups --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2e32d78fd..65573b877 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -294,6 +294,12 @@ that po might be replacing the only link on a page, in error? > be either good (better overall l10n) or bad (break the other > plugin's goal). --[[intrigeri]] +>> Right.. well, the cases where links are added is very small. +>> Grepping for `add_link`, it's just done by link, camelcase, meta, and +>> tag. All of these are supposed to work just link regular links +>> so I'd think that is ok. We could probably remove the currently scary +>> comment about only wanting to change the first link. --[[Joey]] + Name of toplevel index page --------------------------- @@ -305,6 +311,14 @@ like "index.da". --[[Joey]] > test with a predicate call such as isindexpage($page). Such a predicate > function could then be overriden by the po plugin. --[[intrigeri]] +>> Could do that, but if you have such a function it's natural to want to +>> use it elsewhere. Not clear to me it would make sense for po to override +>> such a function if it were used in some of the other places that compare +>> to index. +>> +>> The other option would be for po to override the template setting. +>> --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 7d35d17f956740a310465d5162b9313e120694a3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:01:24 +0200 Subject: doc/po: follow-up Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 65573b877..2c230d409 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -300,6 +300,8 @@ that po might be replacing the only link on a page, in error? >> so I'd think that is ok. We could probably remove the currently scary >> comment about only wanting to change the first link. --[[Joey]] +>>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] + Name of toplevel index page --------------------------- -- cgit v1.2.3 From 6bc3206af16f4910e49478319a8e81d74c7de342 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:21:16 +0200 Subject: doc/po: follow-up --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2c230d409..1d343e0f8 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -321,6 +321,8 @@ like "index.da". --[[Joey]] >> The other option would be for po to override the template setting. >> --[[Joey]] +>>> Great idea. Commit 6c0f9c691c3df3a in my po branch does it. --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From eaa782a1856cff50df68f1135955d58dc97bb833 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:38:36 +0200 Subject: doc/po(self-links): follow-ups Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 1d343e0f8..673bbf406 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -265,9 +265,20 @@ good reason for that to be done? --[[Joey]] > The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] >> It may fix it in passing, but shouldn't it also be fixed for the other ->> `po_link_to` styles? (Also, if `mybestlink` is going to always ->> just return `bestlink` in this case, there seems no reason to inject ->> it.) --[[Joey]] +>> `po_link_to` styles? + +>>> Other `po_link_to` styles already work ok: say there is +>>> a \[[dest]] link on a page called `dest`. When rendering +>>> `dest.LL`, `mybestlink` returns `dest.LL`, and `htmllink` is then +>>> able to detect, and manage correctly, that it is a self-link. +>>> --[[intrigeri]] + +>> (Also, if `mybestlink` is going to always just return `bestlink` in +>> this case, there seems no reason to inject it.) --[[Joey]] + +>>> Right. Commit cdc3576c8d1efb2 in my po branch prevents +>>> `mybestlink` to be injected when `po_link_to` is +>>> `default`. --[[intrigeri]] Language display order ---------------------- -- cgit v1.2.3 From ffcd97ce52edd73f092d15aae89bbacad99b38b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:49:12 -0400 Subject: change cherry-picked; move to discussion --- doc/plugins/po.mdwn | 24 ------------------------ doc/plugins/po/discussion.mdwn | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 673bbf406..9c4d8ffbd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -289,30 +289,6 @@ order, as `po_slave_languages` is a hash. It would need to be converted to an array to support this. (If twere done, twere best done quickly.) --[[Joey]] -Duplicate %links ? ------------------- - -I notice code in the scan hook that seems to assume -that %links will accumulate duplicate links for a page. -That used to be so, but the bug was fixed. Does this mean -that po might be replacing the only link on a page, in error? ---[[Joey]] - -> It would replace it. The only problematic case is when another -> plugin has its own reasons, in its `scan` hook, to add a page -> that is already there to `$links{$page}`. This other plugin's -> effect might then be changed by po's `scan` hook... which could -> be either good (better overall l10n) or bad (break the other -> plugin's goal). --[[intrigeri]] - ->> Right.. well, the cases where links are added is very small. ->> Grepping for `add_link`, it's just done by link, camelcase, meta, and ->> tag. All of these are supposed to work just link regular links ->> so I'd think that is ok. We could probably remove the currently scary ->> comment about only wanting to change the first link. --[[Joey]] - ->>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] - Name of toplevel index page --------------------------- diff --git a/doc/plugins/po/discussion.mdwn b/doc/plugins/po/discussion.mdwn index 1c3f0e752..ab822e76c 100644 --- a/doc/plugins/po/discussion.mdwn +++ b/doc/plugins/po/discussion.mdwn @@ -699,3 +699,28 @@ and via CGI, have been tested. * general test with `indexpages` enabled: **not OK** * general test with `po_link_to=default` with `userdirs` enabled: **OK** * general test with `po_link_to=default` with `userdirs` disabled: **OK** + +Duplicate %links ? +------------------ + +I notice code in the scan hook that seems to assume +that %links will accumulate duplicate links for a page. +That used to be so, but the bug was fixed. Does this mean +that po might be replacing the only link on a page, in error? +--[[Joey]] + +> It would replace it. The only problematic case is when another +> plugin has its own reasons, in its `scan` hook, to add a page +> that is already there to `$links{$page}`. This other plugin's +> effect might then be changed by po's `scan` hook... which could +> be either good (better overall l10n) or bad (break the other +> plugin's goal). --[[intrigeri]] + +>> Right.. well, the cases where links are added is very small. +>> Grepping for `add_link`, it's just done by link, camelcase, meta, and +>> tag. All of these are supposed to work just link regular links +>> so I'd think that is ok. We could probably remove the currently scary +>> comment about only wanting to change the first link. --[[Joey]] + +>>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] +>>>> Cherry-picked --[[Joey]] -- cgit v1.2.3 From f8ad1bfec4e12944482d5f58a0961b0c476602c9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:50:43 -0400 Subject: fix cherry-picked --- debian/changelog | 1 + doc/plugins/po.mdwn | 21 --------------------- 2 files changed, 1 insertion(+), 21 deletions(-) (limited to 'doc/plugins') diff --git a/debian/changelog b/debian/changelog index 69e197e37..9f10c2913 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,7 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low * Rebuild wikis on upgrade to this version to fix bloat caused by the dependency bug. * htmltidy: Print a warning message if tidy fails. Closes: #543722 + * po: Fix name of translated toplevel index page. (intrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9c4d8ffbd..f020adac2 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -289,27 +289,6 @@ order, as `po_slave_languages` is a hash. It would need to be converted to an array to support this. (If twere done, twere best done quickly.) --[[Joey]] -Name of toplevel index page ---------------------------- - -Normally at the top index page of a wiki, you see the wiki name at -the top. However, at the top *translated* index page, you see something -like "index.da". --[[Joey]] - -> I suggest changing `Render.pm`, line 115, to replace the `$page eq 'index'` -> test with a predicate call such as isindexpage($page). Such a predicate -> function could then be overriden by the po plugin. --[[intrigeri]] - ->> Could do that, but if you have such a function it's natural to want to ->> use it elsewhere. Not clear to me it would make sense for po to override ->> such a function if it were used in some of the other places that compare ->> to index. ->> ->> The other option would be for po to override the template setting. ->> --[[Joey]] - ->>> Great idea. Commit 6c0f9c691c3df3a in my po branch does it. --[[intrigeri]] - Pagespecs --------- -- cgit v1.2.3 From 18e4fa65399f2a21bd943b0e62b81a100f941d44 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:54:44 -0400 Subject: fix merged --- debian/changelog | 1 + doc/plugins/po.mdwn | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) (limited to 'doc/plugins') diff --git a/debian/changelog b/debian/changelog index 9f10c2913..b4169c576 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low by the dependency bug. * htmltidy: Print a warning message if tidy fails. Closes: #543722 * po: Fix name of translated toplevel index page. (intrigeri) + * po: Fix display of links from a translated page to itself (ntrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f020adac2..57459c1ef 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -253,33 +253,6 @@ once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` and `meta` branches, and thus has this additional features. -Self links ----------- - -If a page contains a WikiLink to itself, ikiwiki does not normally -turn that into a hyperlink. However, if a translated page contains a -WikiLink to itself, a hyperlink is inserted, at least with the default -`po_link_to` the link points to the English version of the page. Is there a -good reason for that to be done? --[[Joey]] - -> The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] - ->> It may fix it in passing, but shouldn't it also be fixed for the other ->> `po_link_to` styles? - ->>> Other `po_link_to` styles already work ok: say there is ->>> a \[[dest]] link on a page called `dest`. When rendering ->>> `dest.LL`, `mybestlink` returns `dest.LL`, and `htmllink` is then ->>> able to detect, and manage correctly, that it is a self-link. ->>> --[[intrigeri]] - ->> (Also, if `mybestlink` is going to always just return `bestlink` in ->> this case, there seems no reason to inject it.) --[[Joey]] - ->>> Right. Commit cdc3576c8d1efb2 in my po branch prevents ->>> `mybestlink` to be injected when `po_link_to` is ->>> `default`. --[[intrigeri]] - Language display order ---------------------- -- cgit v1.2.3 From 8064acf87fb7e708a03e47dd82457dec237e886e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 13:19:48 +0200 Subject: doc/po: reported bug + patches wrt. created page type Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 57459c1ef..3b152586e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,6 +317,19 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. +Created page type +----------------- + +The interdiction to create pages of type po was broken by the new +`page_types` code. This is fixed in my po branch by +commit 1914ae2fd24e1e802. + +While I was there, I also added some code to set a new default value +to the type select field in case it was previously set to "po". +This code favors the type of the linking page's masterpage on page +creation (when `from=page.LL`). This is commit c9301d2c296f682. +--[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From cc6000f0b9b82b19ea4635edcace2f6ba164adf1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 07:34:09 -0400 Subject: both changes picked --- debian/changelog | 3 +++ doc/plugins/po.mdwn | 2 ++ 2 files changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/debian/changelog b/debian/changelog index 045f27540..d10bc36cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,9 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low * po: Fix name of translated toplevel index page. (intrigeri) * po: Fix display of links from a translated page to itself (ntrigeri) * Add Czech basewiki translation from Miroslav Kure. + * po: fix interdiction to create pages of type po (intrigeri) + * po: po: favor the type of linking page's masterpage on page creation + (intrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3b152586e..fdef41e45 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -330,6 +330,8 @@ This code favors the type of the linking page's masterpage on page creation (when `from=page.LL`). This is commit c9301d2c296f682. --[[intrigeri]] +> Both cherry picked. --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From e3b5d7013717af732b36efd9e4abe1f14d0f3175 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 14:41:32 +0200 Subject: doc/po: bug report + patch proposal wrt. inline's post form's rootpage Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index fdef41e45..39b237c73 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -332,6 +332,17 @@ creation (when `from=page.LL`). This is commit c9301d2c296f682. > Both cherry picked. --[[Joey]] +inline's post form's rootpage +----------------------------- + +When a translatable page (say it is called "bugs") contains an +[[inline directive|ikiwiki/directive/inline]] with `postform` enabled, +the rootpage is l10n'd on translations pages (e.g. "bugs.fr" gets +a `rootpage` value of `bugs.fr`). This is usually not what's expected, +as translation pages are not supposed to have subpages. My po branch +has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes +this. --[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From 6be874612539d3148d288fc6a4c47743a7c0c8fc Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 16:38:13 +0200 Subject: doc/po: report problem with link() + propose patch Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 39b237c73..031188a67 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -343,6 +343,15 @@ as translation pages are not supposed to have subpages. My po branch has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes this. --[[intrigeri]] +link() pagespec on translation pages +------------------------------------ + +The `link()` pagespec, on translation pages, currently tests whether +a given page links to the *current translation page*, rather than +whether it links to its master page. I believe the later is generally +expected. Commit 646c9a4c95a480 in my po branch fixes this. +--[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From 2ba54735ce78a80d9577bef068f674559dddf57b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 18:22:11 -0400 Subject: po test suite failure --- doc/plugins/po.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 031188a67..4fecaeb53 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -352,6 +352,12 @@ whether it links to its master page. I believe the later is generally expected. Commit 646c9a4c95a480 in my po branch fixes this. --[[intrigeri]] +2 test suite failures +-------------------- + +t/po is currently failing tests 57 and 59 (and I would like to release +soon..) --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From 94727e7fcfff204030bec64509ecedacb0abd6dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 19:49:22 -0400 Subject: merged --- doc/plugins/po.mdwn | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 4fecaeb53..04420c115 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,41 +317,6 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. -Created page type ------------------ - -The interdiction to create pages of type po was broken by the new -`page_types` code. This is fixed in my po branch by -commit 1914ae2fd24e1e802. - -While I was there, I also added some code to set a new default value -to the type select field in case it was previously set to "po". -This code favors the type of the linking page's masterpage on page -creation (when `from=page.LL`). This is commit c9301d2c296f682. ---[[intrigeri]] - -> Both cherry picked. --[[Joey]] - -inline's post form's rootpage ------------------------------ - -When a translatable page (say it is called "bugs") contains an -[[inline directive|ikiwiki/directive/inline]] with `postform` enabled, -the rootpage is l10n'd on translations pages (e.g. "bugs.fr" gets -a `rootpage` value of `bugs.fr`). This is usually not what's expected, -as translation pages are not supposed to have subpages. My po branch -has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes -this. --[[intrigeri]] - -link() pagespec on translation pages ------------------------------------- - -The `link()` pagespec, on translation pages, currently tests whether -a given page links to the *current translation page*, rather than -whether it links to its master page. I believe the later is generally -expected. Commit 646c9a4c95a480 in my po branch fixes this. ---[[intrigeri]] - 2 test suite failures -------------------- -- cgit v1.2.3 From ef69cb34c355e184b01999cf445793cebc16f0c4 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 29 Aug 2009 16:32:48 +0200 Subject: doc/po(test suite failures): follow-up Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 04420c115..9f4cf5564 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -323,6 +323,20 @@ when building a non-english page? Then the directives would get translated. t/po is currently failing tests 57 and 59 (and I would like to release soon..) --[[Joey]] +> They are failing because of commit cdc3576c8d1e (po: do not inject +> custom bestlink function when `po_link_to` eq `default`). The test +> suite changes `$config{po_link_to}`, but the `checkconfig` hook is +> not re-run. I could manually run it when needed in the test-suite, +> but this would lead to this function being injected several times, +> and then `$origsubs{'bestlink'}` to be sometimes set to a wrong +> value, which would break other parts of the test-suite. The best +> solution I can think of (apart of reverting this commit or disabling +> these two tests) is to split the test-suite into 3 parts, depending +> on the `$config{po_link_to}` setting, either in 3 different `.t` +> files, or inside the existing one and completely reset the IkiWiki +> environment at the start of these parts... which I did not manage to +> achieve in the last 2 hours :/ --[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From 6962b3459725a921714b4d777cab6288711f4990 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sat, 29 Aug 2009 22:17:40 -0400 Subject: This is in my git branch now, no need for a copy of the code here. --- doc/plugins/contrib/unixauth.mdwn | 204 +------------------------------------- 1 file changed, 2 insertions(+), 202 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/unixauth.mdwn b/doc/plugins/contrib/unixauth.mdwn index 6108ebfae..137195139 100644 --- a/doc/plugins/contrib/unixauth.mdwn +++ b/doc/plugins/contrib/unixauth.mdwn @@ -1,6 +1,8 @@ [[!template id=plugin name=unixauth core=0 author="[[schmonz]]"]] [[!tag type/auth]] +[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] + This plugin authenticates users against the Unix user database. It presents a similar UI to [[plugins/passwordauth]], but simpler, as there's no need to be able to register or change one's password. To authenticate, either [checkpassword](http://cr.yp.to/checkpwd.html) or [pwauth](http://www.unixpapa.com/pwauth/) must be installed and configured. `checkpassword` is strongly preferred. If your web server runs as an unprivileged user -- as it darn well should! -- then `checkpassword` needs to be setuid root. (Or your ikiwiki CGI wrapper, I guess, but don't do that.) Other checkpassword implementations are available, notably [checkpassword-pam](http://checkpasswd-pam.sourceforge.net/). @@ -17,205 +19,3 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u `unixauth` needs the `HTTPS` environment variable, available in ikiwiki 2.67 or later (fixed in #[502047](http://bugs.debian.org/502047)), without which it fails closed. The plugin has not been tested with newer versions of ikiwiki. [[schmonz]] hopes to have time to polish this plugin soon. - -[[!toggle id="code" text="unixauth.pm"]] - -[[!toggleable id="code" text=""" - - #!/usr/bin/perl - # Ikiwiki unixauth authentication. - package IkiWiki::Plugin::unixauth; - - use warnings; - use strict; - use IkiWiki 2.00; - - sub import { - hook(type => "getsetup", id => "unixauth", call => \&getsetup); - hook(type => "formbuilder_setup", id => "unixauth", - call => \&formbuilder_setup); - hook(type => "formbuilder", id => "unixauth", - call => \&formbuilder); - hook(type => "sessioncgi", id => "unixauth", call => \&sessioncgi); - } - - sub getsetup () { - return - unixauth_type => { - type => "string", - example => "checkpassword", - description => "type of authenticator; can be 'checkpassword' or 'pwauth'", - safe => 0, - rebuild => 1, - }, - unixauth_command => { - type => "string", - example => "/path/to/checkpassword", - description => "full path and any arguments", - safe => 0, - rebuild => 1, - }, - unixauth_requiressl => { - type => "boolean", - example => "1", - description => "require SSL? strongly recommended", - safe => 0, - rebuild => 1, - }, - plugin => { - description => "Unix user authentication", - safe => 0, - rebuild => 1, - }, - } - - # Checks if a string matches a user's password, and returns true or false. - sub checkpassword ($$;$) { - my $user=shift; - my $password=shift; - my $field=shift || "password"; - - # It's very important that the user not be allowed to log in with - # an empty password! - if (! length $password) { - return 0; - } - - my $ret=0; - if (! exists $config{unixauth_type}) { - # admin needs to carefully think over his configuration - return 0; - } - elsif ($config{unixauth_type} eq "checkpassword") { - open UNIXAUTH, "|$config{unixauth_command} true 3<&0" or die("Could not run $config{unixauth_type}"); - print UNIXAUTH "$user\0$password\0Y123456\0"; - close UNIXAUTH; - $ret=!($?>>8); - } - elsif ($config{unixauth_type} eq "pwauth") { - open UNIXAUTH, "|$config{unixauth_command}" or die("Could not run $config{unixauth_type}"); - print UNIXAUTH "$user\n$password\n"; - close UNIXAUTH; - $ret=!($?>>8); - } - else { - # no such authentication type - return 0; - } - - if ($ret) { - my $userinfo=IkiWiki::userinfo_retrieve(); - if (! length $user || ! defined $userinfo || - ! exists $userinfo->{$user} || ! ref $userinfo->{$user}) { - IkiWiki::userinfo_setall($user, { - 'email' => '', - 'regdate' => time, - }); - } - } - - return $ret; - } - - sub formbuilder_setup (@) { - my %params=@_; - - my $form=$params{form}; - my $session=$params{session}; - my $cgi=$params{cgi}; - - # if not under SSL, die before even showing a login form, - # unless the admin explicitly says it's fine - if (! exists $config{unixauth_requiressl}) { - $config{unixauth_requiressl} = 1; - } - if ($config{unixauth_requiressl}) { - if ((! $config{sslcookie}) || (! exists $ENV{'HTTPS'})) { - die("SSL required to login. Contact your administrator.
"); - } - } - - if ($form->title eq "signin") { - $form->field(name => "name", required => 0); - $form->field(name => "password", type => "password", required => 0); - - if ($form->submitted) { - my $submittype=$form->submitted; - # Set required fields based on how form was submitted. - my %required=( - "Login" => [qw(name password)], - ); - foreach my $opt (@{$required{$submittype}}) { - $form->field(name => $opt, required => 1); - } - - # Validate password against name for Login. - if ($submittype eq "Login") { - $form->field( - name => "password", - validate => sub { - checkpassword($form->field("name"), shift); - }, - ); - } - - # XXX is this reachable? looks like no - elsif ($submittype eq "Login") { - $form->field( - name => "name", - validate => sub { - my $name=shift; - length $name && - IkiWiki::userinfo_get($name, "regdate"); - }, - ); - } - } - else { - # First time settings. - $form->field(name => "name"); - if ($session->param("name")) { - $form->field(name => "name", value => $session->param("name")); - } - } - } - elsif ($form->title eq "preferences") { - $form->field(name => "name", disabled => 1, - value => $session->param("name"), force => 1, - fieldset => "login"); - $form->field(name => "password", disabled => 1, type => "password", - fieldset => "login"), - } - } - - sub formbuilder (@) { - my %params=@_; - - my $form=$params{form}; - my $session=$params{session}; - my $cgi=$params{cgi}; - my $buttons=$params{buttons}; - - if ($form->title eq "signin") { - if ($form->submitted && $form->validate) { - if ($form->submitted eq 'Login') { - $session->param("name", $form->field("name")); - IkiWiki::cgi_postsignin($cgi, $session); - } - } - } - elsif ($form->title eq "preferences") { - if ($form->submitted eq "Save Preferences" && $form->validate) { - my $user_name=$form->field('name'); - } - } - } - - sub sessioncgi ($$) { - my $q=shift; - my $session=shift; - } - - 1 - -"""]] -- cgit v1.2.3 From 0721363a7adfc0f993a485a45222482a8a854a19 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 30 Aug 2009 01:26:57 -0400 Subject: bug fixed, to-dos done --- doc/plugins/contrib/cvs.mdwn | 2 -- doc/plugins/contrib/cvs/discussion.mdwn | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 6b600eef7..afef98c74 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -27,7 +27,5 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn ### To do * Add automated tests. (Blindly adding svn-like tests to `t/file_pruned.t` doesn't do the trick.) -* If the argument to `cvs add` smells like a binary file, `cvs add -kb` it (for [[plugins/attachment]] support). -* Don't slurp the entire `cvsps` output into memory (!). * Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. * Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index e1fa6e428..e142452d0 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -52,6 +52,10 @@ the "cvs add " call and avoid doing anything in that case? >>>>>> I don't see how there could possibly be a difference between >>>>>> ikiwiki's C wrapper and your shell wrapper wrapper here. --[[Joey]] +>>>>>>> I was comparing strings overly precisely. Fixed on my branch. +>>>>>>> I've also knocked off the two most pressing to-do items. I +>>>>>>> think the plugin's ready for prime time. --[[schmonz]] + > Thing 2 I'm less sure of. (I'd like to see the web UI return > immediately on save anyway, to a temporary "rebuilding, please wait > if you feel like knowing when it's done" page, but this problem -- cgit v1.2.3 From 558873131f10c52ecbc0b97544db6556964f172a Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 30 Aug 2009 01:31:15 -0400 Subject: also need File::ReadBackwards now --- doc/plugins/contrib/cvs.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index afef98c74..4cd7dcc7d 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -5,7 +5,9 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. ### Usage -7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan IPC::Cmd]], [[!cpan String::ShellQuote]], and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. +7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan IPC::Cmd]], +[[!cpan String::ShellQuote]], [[!cpan File::ReadBackwards]], and +[cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. 7. Adjust CVS-related parameters in your setup file. Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn't need it, but you yourself might. Here's a good general-purpose one: -- cgit v1.2.3 From 58cef9c3cf6da1b614c0a24ebef15a0d8ecea335 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sun, 30 Aug 2009 02:35:38 -0400 Subject: describe the wrapper change --- doc/plugins/contrib/cvs.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 4cd7dcc7d..1c43fb272 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -20,7 +20,11 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn ### Implementation details * `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. -* `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. +* `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata +into `$DESTDIR`. +* `IkiWiki/Wrapper.pm` avoids calling ikiwiki from post-commit if it's a +directory being `cvs add`ed (this check is only compiled into the wrapper +iff the configured VCS is "cvs"). * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), -- cgit v1.2.3 From d678147410fd5b1a7c6ca595f651b4da154229a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Aug 2009 14:49:53 -0400 Subject: Revert "po: do not inject custom bestlink function when po_link_to eq default" This reverts commit cdc3576c8d1efb2593cac2d9da3f2393a2afe26e. Conflicts: IkiWiki/Plugin/po.pm This change broke the test suite and is not strictly necessary. --- IkiWiki/Plugin/po.pm | 12 +++++------- doc/plugins/po.mdwn | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 792d84261..5d0d9e79d 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -51,6 +51,8 @@ sub import { hook(type => "formbuilder_setup", id => "po", call => \&formbuilder_setup, last => 1); hook(type => "formbuilder", id => "po", call => \&formbuilder); + $origsubs{'bestlink'}=\&IkiWiki::bestlink; + inject(name => "IkiWiki::bestlink", call => \&mybestlink); $origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); $origsubs{'targetpage'}=\&IkiWiki::targetpage; @@ -153,12 +155,6 @@ sub checkconfig () { warn(gettext('po_link_to=negotiated requires usedirs to be enabled, falling back to po_link_to=default')); $config{po_link_to}='default'; } - unless ($config{po_link_to} eq 'default') { - if (! exists $origsubs{'bestlink'}) { - $origsubs{'bestlink'}=\&IkiWiki::bestlink; - inject(name => "IkiWiki::bestlink", call => \&mybestlink); - } - } push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; @@ -562,11 +558,13 @@ sub formbuilder (@) { # `---- # Implement po_link_to 'current' and 'negotiated' settings. -# Not injected otherwise. sub mybestlink ($$) { my $page=shift; my $link=shift; + return $origsubs{'bestlink'}->($page, $link) + if $config{po_link_to} eq "default"; + my $res=$origsubs{'bestlink'}->(masterpage($page), $link); my @caller = caller(1); if (length $res diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9f4cf5564..38b6b12cd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -337,6 +337,8 @@ soon..) --[[Joey]] > environment at the start of these parts... which I did not manage to > achieve in the last 2 hours :/ --[[intrigeri]] +>> I've reverted it. --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From a86de9b1f6e6ae867a5a2f7ede5b52a04f306c58 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Aug 2009 19:17:45 -0400 Subject: update for Text::MultiMarkdown split --- doc/plugins/mdwn.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/mdwn.mdwn b/doc/plugins/mdwn.mdwn index 6ad1fb229..af0531059 100644 --- a/doc/plugins/mdwn.mdwn +++ b/doc/plugins/mdwn.mdwn @@ -12,9 +12,9 @@ this plugin. The [original version of markdown](http://daringfireball.net/projects/markdown/) can be used, or the [[!cpan Text::Markdown]] perl module. -[[!cpan Text::Markdown]] also includes a markdown variant called -[multimarkdown](http://fletcherpenney.net/MultiMarkdown/), which supports -tables, footnotes, and other new features. Multimarkdown is not enabled by -default, but can be turned on via the `multimarkdown` option in the setup -file. Note that multimarkdown's metadata and wikilinks features are -disabled when it's used with ikiwiki. +[[!cpan Text::MultiMarkdown]] can be used in order to use tables, footnotes, +and other new features from the markdown variant called +multimarkdown](http://fletcherpenney.net/MultiMarkdown/). Multimarkdown is +not enabled by default, but can be turned on via the `multimarkdown` option +in the setup file. Note that multimarkdown's metadata and wikilinks +features are disabled when it's used with ikiwiki. -- cgit v1.2.3 From 9492bf315832df1e92277dcb75f95de50abe3e9c Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 31 Aug 2009 11:03:20 -0400 Subject: fixed link --- doc/plugins/mdwn.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/mdwn.mdwn b/doc/plugins/mdwn.mdwn index af0531059..756462aa1 100644 --- a/doc/plugins/mdwn.mdwn +++ b/doc/plugins/mdwn.mdwn @@ -14,7 +14,7 @@ markdown](http://daringfireball.net/projects/markdown/) can be used, or the [[!cpan Text::MultiMarkdown]] can be used in order to use tables, footnotes, and other new features from the markdown variant called -multimarkdown](http://fletcherpenney.net/MultiMarkdown/). Multimarkdown is +[multimarkdown](http://fletcherpenney.net/MultiMarkdown/). Multimarkdown is not enabled by default, but can be turned on via the `multimarkdown` option in the setup file. Note that multimarkdown's metadata and wikilinks features are disabled when it's used with ikiwiki. -- cgit v1.2.3 From 9e195018a2a7ba315ee947bd367fca33b704ef2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Aug 2009 19:30:31 -0400 Subject: remove ^P's --- doc/plugins/mdwn.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/mdwn.mdwn b/doc/plugins/mdwn.mdwn index 756462aa1..ce1b6097a 100644 --- a/doc/plugins/mdwn.mdwn +++ b/doc/plugins/mdwn.mdwn @@ -14,7 +14,7 @@ markdown](http://daringfireball.net/projects/markdown/) can be used, or the [[!cpan Text::MultiMarkdown]] can be used in order to use tables, footnotes, and other new features from the markdown variant called -[multimarkdown](http://fletcherpenney.net/MultiMarkdown/). Multimarkdown is +[multimarkdown](http://fletcherpenney.net/MultiMarkdown/). Multimarkdown is not enabled by default, but can be turned on via the `multimarkdown` option in the setup file. Note that multimarkdown's metadata and wikilinks features are disabled when it's used with ikiwiki. -- cgit v1.2.3 From 6fe3c6bb5f34dca6fc23ba910a9d9a583da9f4c9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Sep 2009 16:10:57 -0400 Subject: ruther review --- doc/plugins/contrib/cvs/discussion.mdwn | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index e142452d0..b5f03ac6f 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -93,3 +93,32 @@ the "cvs add " call and avoid doing anything in that case? >>> if a configured post-commit hook is missing, and it seems fine, >>> probably also thanks to IPC::Cmd. >>> --[[schmonz]] + +---- + + +Further review.. --[[Joey]] + +I don't understand what `cvs_shquote_commit` is +trying to do with the test message, but it seems +highly likely to be insecure; I never trust anything +that relies on safely quoting user input passed to the shell. + +(As an aside, `shell_quote` can die on certian inputs.) + +Seems to me that, if `IPC::Cmd` exposes input to the shell +(which I have not verified but its docs don't specify; a bad sign) +you chose the wrong tool and ended up doing down the wrong +route, dragging in shell quoting problems and fixes. Since you +chose to use `IPC::Cmd` just because you wanted to shut +up CVS stderr, my suggestion would be to use plain `system` +to run the command, with stderr temporarily sent to /dev/null: + + open(my $savederr, ">&STDERR"); + open(STDERR, ">", "/dev/null"); + my $ret=system("cvs", "-Q", @_); + open(STDERR, ">$savederr"); + +`cvs_runcvs` should not take an array reference. It's +usual for this type of function to take a list of parameters +to pass to the command. -- cgit v1.2.3 From f582457ea04a6ce66a2c54ec0731e2569aa30d3f Mon Sep 17 00:00:00 2001 From: bremner Date: Thu, 3 Sep 2009 08:18:27 -0400 Subject: --- doc/plugins/contrib/mailbox/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/mailbox/discussion.mdwn b/doc/plugins/contrib/mailbox/discussion.mdwn index 00fb0c05f..9520fdd70 100644 --- a/doc/plugins/contrib/mailbox/discussion.mdwn +++ b/doc/plugins/contrib/mailbox/discussion.mdwn @@ -3,3 +3,6 @@ For some reason, `git fetch` from http://pivot.cs.unb.ca/git/ikimailbox.git/ didn't work very smoothly for me: it hung, and I had to restart it 3 times before the download was complete. I'm writing this just to let you know that there might be some problems with such connections to your http-server. --Ivan Z. +> I can't replicate this (two months later!) +> I can suggest trying the git:// url for download if you can. +> Also, if you really want to get my attention, send me email [[DavidBremner]] -- cgit v1.2.3 From 127ed4d6c7a7d2cc518102757b7b4be49d20fce8 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Fri, 4 Sep 2009 15:08:48 -0500 Subject: no more IPC::Cmd or String::ShellQuote, huzzah --- doc/plugins/contrib/cvs.mdwn | 4 ++-- doc/plugins/contrib/cvs/discussion.mdwn | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 1c43fb272..fcf5b936f 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -5,8 +5,8 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. ### Usage -7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan IPC::Cmd]], -[[!cpan String::ShellQuote]], [[!cpan File::ReadBackwards]], and +7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan +File::ReadBackwards]], and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. 7. Adjust CVS-related parameters in your setup file. diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index b5f03ac6f..1f0ce0102 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -122,3 +122,6 @@ to run the command, with stderr temporarily sent to /dev/null: `cvs_runcvs` should not take an array reference. It's usual for this type of function to take a list of parameters to pass to the command. + +> Thanks for reading carefully. I've tested your suggestions and +> applied them on my branch. --[[schmonz]] -- cgit v1.2.3 From 8691bc006e16f17450423ef793f1e1a2626e2fe8 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" Date: Mon, 7 Sep 2009 05:53:50 -0400 Subject: Can't markup [[!table Error: ]] --- doc/plugins/table.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index 7b080acda..eb19323e6 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -6,3 +6,5 @@ It can build HTML tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format. It needs the perl module [[!cpan Text::CSV]] for the CSV data. + +If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. -- cgit v1.2.3 From e95386504500492b55b9e00937f896334b13e240 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 7 Sep 2009 12:51:56 -0400 Subject: revert previous; with pkgsrc you'd need textproc/p5-Text-CSV, but let's not proliferate that sort of thing here --- doc/plugins/table.mdwn | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index eb19323e6..7b080acda 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -6,5 +6,3 @@ It can build HTML tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format. It needs the perl module [[!cpan Text::CSV]] for the CSV data. - -If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. -- cgit v1.2.3 From ca329047207dd17c984ee975d51bcec7d079ff26 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 7 Sep 2009 12:54:24 -0400 Subject: move apt-get comment here --- doc/plugins/table/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/table/discussion.mdwn b/doc/plugins/table/discussion.mdwn index 16e5a5a56..99c7e059b 100644 --- a/doc/plugins/table/discussion.mdwn +++ b/doc/plugins/table/discussion.mdwn @@ -64,3 +64,7 @@ Do you like it? Can you implement the same in Ikiwiki? :) --[[Paweł|ptecza]] >> was written rather for simple usage. However cell alignment is very >> helpful feature, so I think the plugin should be able to do it. >> --[[Paweł|ptecza]] + +----- + +If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. -- cgit v1.2.3 From 3813632a8fe8940622f9cb40d94dbbab7e3f4194 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Sep 2009 13:47:34 -0400 Subject: comment --- doc/plugins/table/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/table/discussion.mdwn b/doc/plugins/table/discussion.mdwn index 99c7e059b..86572c935 100644 --- a/doc/plugins/table/discussion.mdwn +++ b/doc/plugins/table/discussion.mdwn @@ -68,3 +68,6 @@ Do you like it? Can you implement the same in Ikiwiki? :) --[[Paweł|ptecza]] ----- If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. + +> Perhaps more helpfully, ikiwiki 3.1415926 fixes display of such errors to +> actualy include the error message. --[[Joey]] -- cgit v1.2.3 From c1c933ca658d3babc50da4ade20eb083f1a9c122 Mon Sep 17 00:00:00 2001 From: WikiJeanHawkins Date: Tue, 8 Sep 2009 14:21:49 -0400 Subject: --- doc/plugins/openid.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 91fc7cddc..02b611eb0 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -25,3 +25,5 @@ url. This plugin is enabled by default, but can be turned off if you want to only use some other form of authentication, such as [[passwordauth]]. + +For plugin dissertation or any other related [dissertation](http://www.bestdissertation.com), you may visit this page. -- cgit v1.2.3 From 6d170066e987137e5f6ff49849c452822df86cf4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:27:51 -0400 Subject: Revert spam This reverts commit c1c933ca658d3babc50da4ade20eb083f1a9c122. --- doc/plugins/openid.mdwn | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 02b611eb0..91fc7cddc 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -25,5 +25,3 @@ url. This plugin is enabled by default, but can be turned off if you want to only use some other form of authentication, such as [[passwordauth]]. - -For plugin dissertation or any other related [dissertation](http://www.bestdissertation.com), you may visit this page. -- cgit v1.2.3 From 1f828d280a5085f2d9b0c69cbc0d6b4b1a40a105 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:38:57 -0400 Subject: update --- doc/plugins/po.mdwn | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 38b6b12cd..f3b70b5f7 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,27 +317,8 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. -2 test suite failures --------------------- - -t/po is currently failing tests 57 and 59 (and I would like to release -soon..) --[[Joey]] - -> They are failing because of commit cdc3576c8d1e (po: do not inject -> custom bestlink function when `po_link_to` eq `default`). The test -> suite changes `$config{po_link_to}`, but the `checkconfig` hook is -> not re-run. I could manually run it when needed in the test-suite, -> but this would lead to this function being injected several times, -> and then `$origsubs{'bestlink'}` to be sometimes set to a wrong -> value, which would break other parts of the test-suite. The best -> solution I can think of (apart of reverting this commit or disabling -> these two tests) is to split the test-suite into 3 parts, depending -> on the `$config{po_link_to}` setting, either in 3 different `.t` -> files, or inside the existing one and completely reset the IkiWiki -> environment at the start of these parts... which I did not manage to -> achieve in the last 2 hours :/ --[[intrigeri]] - ->> I've reverted it. --[[Joey]] +(We also will need this in order to use translated templates, when they are +available.) Documentation ------------- -- cgit v1.2.3 From 2a99ebf2766a08f8d68a82255d1518ecac73ec84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 17:27:37 -0400 Subject: underlay: Also allow configuring additional directories to search for template files in. --- IkiWiki.pm | 10 +++++++++- IkiWiki/Plugin/underlay.pm | 11 +++++++++-- debian/changelog | 2 ++ doc/plugins/underlay.mdwn | 8 +++++++- 4 files changed, 27 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 01898936f..2f11069c6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -150,6 +150,13 @@ sub getsetup () { safe => 0, # path rebuild => 1, }, + templatedirs => { + type => "internal", + default => [], + description => "additional directories containing template files", + safe => 0, + rebuild => 0, + }, underlaydir => { type => "string", default => "$installdir/share/ikiwiki/basewiki", @@ -1610,7 +1617,8 @@ sub saveindex () { sub template_file ($) { my $template=shift; - foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { + foreach my $dir ($config{templatedir}, @{$config{templatedirs}}, + "$installdir/share/ikiwiki/templates") { return "$dir/$template" if -e "$dir/$template"; } return; diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index 380d418fb..c59935672 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -27,14 +27,21 @@ sub getsetup () { safe => 0, rebuild => 1, }, + add_templates => { + type => "string", + default => [], + description => "extra template directories to add", + advanced => 1, + safe => 0, + rebuild => 1, + }, } sub checkconfig () { - return unless exists $config{add_underlays}; - foreach my $dir (@{$config{add_underlays}}) { add_underlay($dir); } + push @{$config{templatedirs}}, @{$config{add_templates}}; } 1; diff --git a/debian/changelog b/debian/changelog index 86e8513f7..de165e4ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.14159265) UNRELEASED; urgency=low including Philippe Batailler, Alexandre Dupas, and Steve Petruzzello. * Expand banned_users; it can now include PageSpecs, which allows banning by IP address. + * underlay: Also allow configuring additional directories to search + for template files in. -- Joey Hess Wed, 02 Sep 2009 15:01:27 -0400 diff --git a/doc/plugins/underlay.mdwn b/doc/plugins/underlay.mdwn index 09d096a6e..f7eafee7c 100644 --- a/doc/plugins/underlay.mdwn +++ b/doc/plugins/underlay.mdwn @@ -1,7 +1,7 @@ [[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]] [[!tag type/useful]] -This plugin adds an `add_underlays` option to the `.setup` file. +This plugin adds an `add_underlays` option to the setup file. Its value is a list of underlay directories whose content is added to the wiki. Multiple underlays are normally set up automatically by other plugins (for @@ -12,3 +12,9 @@ like photos or software releases. Directories in `add_underlays` should usually be absolute. If relative, they're interpreted as relative to the parent directory of the basewiki underlay, which is probably not particularly useful in this context. + +-- + +This plugin also adds an `add_templates` option to the setup file. +Its value is a list of template directories to look for template files in, +if they are not present in the `templatedir`. -- cgit v1.2.3 From 1b4c3fb551754cc70abd7a18871a79d79ac3cb5b Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 22:36:23 -0400 Subject: note refactored wrapper tweakulation --- doc/plugins/contrib/cvs/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 1f0ce0102..155a2289d 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -125,3 +125,19 @@ to pass to the command. > Thanks for reading carefully. I've tested your suggestions and > applied them on my branch. --[[schmonz]] + +---- + +I've abstracted out CVS's involvement in the wrapper, adding a new +"wrapperargcheck" hook to examine `argc/argv` and return success or +failure (failure causes the wrapper to terminate) and implementing +this hook in the plugin. In the non-CVS case, the check immediately +returns success, so the added overhead is just a function call. + +Given how rarely anything should need to reach in and modify the +wrapper -- I'd go so far as to say we shouldn't make it too easy +-- I don't think it's worth the effort to try and design a more +general-purpose way to do so. If and when some other problem thinks +it wants to be solved by a new wrapper hook, it's easy enough to add +one. Until then, I'd say it's more important to keep the wrapper as +short and clear as possible. --[[schmonz]] -- cgit v1.2.3 From b7415543c1ee1ee6ee0404cf781e89043de26fb7 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 22:42:47 -0400 Subject: describe current state of wrapper modification --- doc/plugins/contrib/cvs.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index fcf5b936f..3d72255fe 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -22,9 +22,9 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. * `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. -* `IkiWiki/Wrapper.pm` avoids calling ikiwiki from post-commit if it's a -directory being `cvs add`ed (this check is only compiled into the wrapper -iff the configured VCS is "cvs"). +* `IkiWiki/Wrapper.pm` provides a new "wrapperargcheck" hook, which +the plugin implements to avoid calling ikiwiki from post-commit +(and locking against itself) if it's a directory being `cvs add`ed. * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), -- cgit v1.2.3 From 689106ad3a24850543c7855b8531a1bf8dcfdb63 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 23:17:15 -0400 Subject: automated tests added (and they highlight that the plugin should probably restore the caller's working directory) --- doc/plugins/contrib/cvs.mdwn | 1 - 1 file changed, 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 3d72255fe..947fa7268 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -32,6 +32,5 @@ the plugin implements to avoid calling ikiwiki from post-commit * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). ### To do -* Add automated tests. (Blindly adding svn-like tests to `t/file_pruned.t` doesn't do the trick.) * Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. * Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. -- cgit v1.2.3 From d2b57ae20fa1800d142adad5b3e43dddb97e9466 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Thu, 10 Sep 2009 00:59:05 -0400 Subject: File::chdir is needed now --- doc/plugins/contrib/cvs.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 947fa7268..d45992300 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -5,8 +5,8 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. ### Usage -7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan -File::ReadBackwards]], and +7. Install [[!cpan File::chdir]], [[!cpan File::ReadBackwards]], +[cvsps](http://www.cobite.com/cvsps/), and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. 7. Adjust CVS-related parameters in your setup file. -- cgit v1.2.3 From 3ebd4e0b45a8a6bd4c12604a3bb683dcb3a60eb8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Sep 2009 14:04:46 -0400 Subject: Add genwrapper hook, that can be used to add code into the C wrapper. --- IkiWiki/Plugin/skeleton.pm.example | 5 +++++ IkiWiki/Wrapper.pm | 8 ++++---- debian/changelog | 1 + doc/plugins/write.mdwn | 7 +++++++ 4 files changed, 17 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index 573510191..ddf2996d6 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -39,6 +39,7 @@ sub import { hook(type => "renamepage", id => "skeleton", call => \&renamepage); hook(type => "rename", id => "skeleton", call => \&rename); hook(type => "savestate", id => "skeleton", call => \&savestate); + hook(type => "genwrapper", id => "skeleton", call => \&genwrapper); } sub getopt () { @@ -239,4 +240,8 @@ sub savestate () { debug("skeleton plugin running in savestate"); } +sub genwrapper () { + debug("skeleton plugin running in genwrapper"); +} + 1 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 6555fe625..cf85738d6 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -38,11 +38,12 @@ sub gen_wrapper () { EOF } - my $test_receive=""; if ($config{test_receive}) { require IkiWiki::Receive; - $test_receive=IkiWiki::Receive::gen_wrapper(); } + + my @wrapper_hooks; + run_hooks(genwrapper => sub { push @wrapper_hooks, shift->() }); my $check_commit_hook=""; my $pre_exec=""; @@ -120,7 +121,7 @@ int main (int argc, char **argv) { char *s; $check_commit_hook -$test_receive +@wrapper_hooks $envsave newenviron[i++]="HOME=$ENV{HOME}"; newenviron[i++]="WRAPPED_OPTIONS=$configstring"; @@ -144,7 +145,6 @@ $pre_exec exit(1); } EOF - close OUT; my $cc=exists $ENV{CC} ? possibly_foolish_untaint($ENV{CC}) : 'cc'; if (system($cc, "$wrapper.c", "-o", "$wrapper.new") != 0) { diff --git a/debian/changelog b/debian/changelog index 2e1781713..488aef866 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.14159265) UNRELEASED; urgency=low * underlay: Also allow configuring additional directories to search for template files in. * Fix parsing web commits from ipv6 addresses. + * Add genwrapper hook, that can be used to add code into the C wrapper. -- Joey Hess Wed, 02 Sep 2009 15:01:27 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 3976f9adf..668f8d8b6 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -496,6 +496,13 @@ describes the plugin as a whole. For example: and undef if a rebuild could be needed in some circumstances, but is not strictly required. +### genwrapper + + hook(type => "genwrapper", id => "foo", call => \&genwrapper); + +This hook is used to inject C code (which it returns) into the `main` +function of the ikiwiki wrapper when it is being generated. + ## Plugin interface To import the ikiwiki plugin interface: -- cgit v1.2.3 From 525d4cd037b1da19f4d54cf113212cbe452be417 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Sep 2009 14:06:30 -0400 Subject: new hook --- doc/plugins/contrib/cvs/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 155a2289d..ace455d06 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -141,3 +141,7 @@ general-purpose way to do so. If and when some other problem thinks it wants to be solved by a new wrapper hook, it's easy enough to add one. Until then, I'd say it's more important to keep the wrapper as short and clear as possible. --[[schmonz]] + +> I've committed a slightly different hook, which should be general enough +> that `IkiWiki::Receive` can also use it, so please adapt your code to +> that. --[[Joey]] -- cgit v1.2.3 From 5ee980d77a614865747101615a6a795bec6f272f Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Thu, 10 Sep 2009 15:17:28 -0400 Subject: catch up to genwrapper --- doc/plugins/contrib/cvs.mdwn | 3 --- doc/plugins/contrib/cvs/discussion.mdwn | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index d45992300..b75929139 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -22,9 +22,6 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. * `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. -* `IkiWiki/Wrapper.pm` provides a new "wrapperargcheck" hook, which -the plugin implements to avoid calling ikiwiki from post-commit -(and locking against itself) if it's a directory being `cvs add`ed. * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index ace455d06..645b2388b 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -145,3 +145,5 @@ short and clear as possible. --[[schmonz]] > I've committed a slightly different hook, which should be general enough > that `IkiWiki::Receive` can also use it, so please adapt your code to > that. --[[Joey]] + +>> Done. --[[schmonz]]. -- cgit v1.2.3 From e5d9d3cc52598c68fc91903a5ca5fd43c7d1cf21 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Sep 2009 16:31:58 -0400 Subject: add rcs/cvs --- doc/plugins/contrib/cvs.mdwn | 33 ------- doc/plugins/contrib/cvs/discussion.mdwn | 149 -------------------------------- doc/rcs/cvs.mdwn | 27 ++++++ doc/rcs/cvs/discussion.mdwn | 149 ++++++++++++++++++++++++++++++++ doc/rcs/details.mdwn | 2 + 5 files changed, 178 insertions(+), 182 deletions(-) delete mode 100644 doc/plugins/contrib/cvs.mdwn delete mode 100644 doc/plugins/contrib/cvs/discussion.mdwn create mode 100644 doc/rcs/cvs.mdwn create mode 100644 doc/rcs/cvs/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn deleted file mode 100644 index b75929139..000000000 --- a/doc/plugins/contrib/cvs.mdwn +++ /dev/null @@ -1,33 +0,0 @@ -[[!template id=plugin name=cvs core=0 author="[[schmonz]]"]] - -[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] - -This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. - -### Usage -7. Install [[!cpan File::chdir]], [[!cpan File::ReadBackwards]], -[cvsps](http://www.cobite.com/cvsps/), and -[cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. -7. Adjust CVS-related parameters in your setup file. - -Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn't need it, but you yourself might. Here's a good general-purpose one: - - cvs -q - checkout -P - update -dP - diff -u - rdiff -u - -### Implementation details -* `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. -* `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata -into `$DESTDIR`. -* [[ikiwiki-makerepo]]: - * creates a repository, - * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), - * configures the post-commit hook in `CVSROOT/loginfo`. -* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). - -### To do -* Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. -* Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn deleted file mode 100644 index 645b2388b..000000000 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ /dev/null @@ -1,149 +0,0 @@ -I've started reviewing this, and the main thing I don't like is the -post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. -That just seems unnecessarily complicated. Why can't ikiwiki itself detect -the "cvs add " call and avoid doing anything in that case? ---[[Joey]] - -> The wrapper wrapper does three things: -> -> 7. It ignores `cvs add `, since this is a weird CVS -> behavior that ikiwiki gets confused by and doesn't need to act on. -> 7. It prevents `cvs` locking against itself: `cvs commit` takes a -> write lock and runs the post-commit hook, which runs `cvs update`, -> which wants a read lock and sleeps forever -- unless the post-commit -> hook runs in the background so the commit can "finish". -> 7. It fails silently if the ikiwiki post-commit hook is missing. -> CVS doesn't have any magic post-commit filenames, so hooks have to -> be configured explicitly. I don't think a commit will actually fail -> if a configured post-commit hook is missing (though I can't test -> this at the moment). -> -> Thing 1 can probably be handled within ikiwiki, if that seems less -> gross to you. - ->> It seems like it might be. You can use a `getopt` hook to check ->> `@ARGV` to see how it was called. --[[Joey]] - ->>> This does the trick iff the post-commit wrapper passes its args ->>> along. Committed on my branch. This seems potentially dangerous, ->>> since the args passed to ikiwiki are influenced by web commits. ->>> I don't see an exploit, but for paranoia's sake, maybe the wrapper ->>> should only be built with execv() if the cvs plugin is loaded? ->>> --[[schmonz]] - ->>>> Hadn't considered that. While in wrapper mode the normal getopt is not ->>>> done, plugin getopt still runs, and so any unsafe options that ->>>> other plugins support could be a problem if another user runs ->>>> the setuid wrapper and passes those options through. --[[Joey]] - ->>>>> I've tried compiling the argument check into the wrapper as ->>>>> the first thing main() does, and was surprised to find that ->>>>> this doesn't prevent the `cvs add ` deadlock in a web ->>>>> commit. I was convinced this'd be a reasonable solution, ->>>>> especially if conditionalized on the cvs plugin being loaded, ->>>>> but it doesn't work. And I stuck debug printfs at the beginning ->>>>> of all the rcs_foo() subs, and whatever `cvs add ` is ->>>>> doing to ikiwiki isn't visible to my plugin, because none of ->>>>> those subs are getting called. Nuts. Can you think of anything ->>>>> else that might solve the problem, or should I go back to ->>>>> generating a minimal wrapper wrapper that checks for just ->>>>> this one thing? --[[schmonz]] - ->>>>>> I don't see how there could possibly be a difference between ->>>>>> ikiwiki's C wrapper and your shell wrapper wrapper here. --[[Joey]] - ->>>>>>> I was comparing strings overly precisely. Fixed on my branch. ->>>>>>> I've also knocked off the two most pressing to-do items. I ->>>>>>> think the plugin's ready for prime time. --[[schmonz]] - -> Thing 2 I'm less sure of. (I'd like to see the web UI return -> immediately on save anyway, to a temporary "rebuilding, please wait -> if you feel like knowing when it's done" page, but this problem -> with CVS happens with any kind of commit, and could conceivably -> happen with some other VCS.) - ->> None of the other VCSes let a write lock block a read lock, apparently. ->> ->> Anyway, re the backgrounding, when committing via the web, the ->> post-commit hook doesn't run anyway; the rendering is done via the ->> ikiwiki CGI. It would certianly be nice if it popped up a quick "working" ->> page and replaced it with the updated page when done, but that's ->> unrelated; the post-commit ->> hook only does rendering when committing using the VCS directly. The ->> backgrounding you do actually seems safe enough -- but tacking ->> on a " &" to the ikiwiki wrapper call doesn't need a wrapper script, ->> does it? --[[Joey]] - ->>> Nope, it works fine to append it to the `CVSROOT/loginfo` line. ->>> Fixed on my branch. --[[schmonz]] - -> Thing 3 I think I did in order to squelch the error messages that -> were bollixing up the CGI. It was easy to do this in the wrapper -> wrapper, but if that's going away, it can be done just as easily -> with output redirection in `CVSROOT/loginfo`. -> -> --[[schmonz]] - ->> If the error messages screw up the CGI they must go to stdout. ->> I thought we had stderr even in the the CVS dark ages. ;-) --[[Joey]] - ->>> Some messages go to stderr, but definitely not all. That's why ->>> I wound up reaching for IPC::Cmd, to execute the command line ->>> safely while shutting CVS up. Anyway, I've tested what happens ->>> if a configured post-commit hook is missing, and it seems fine, ->>> probably also thanks to IPC::Cmd. ->>> --[[schmonz]] - ----- - - -Further review.. --[[Joey]] - -I don't understand what `cvs_shquote_commit` is -trying to do with the test message, but it seems -highly likely to be insecure; I never trust anything -that relies on safely quoting user input passed to the shell. - -(As an aside, `shell_quote` can die on certian inputs.) - -Seems to me that, if `IPC::Cmd` exposes input to the shell -(which I have not verified but its docs don't specify; a bad sign) -you chose the wrong tool and ended up doing down the wrong -route, dragging in shell quoting problems and fixes. Since you -chose to use `IPC::Cmd` just because you wanted to shut -up CVS stderr, my suggestion would be to use plain `system` -to run the command, with stderr temporarily sent to /dev/null: - - open(my $savederr, ">&STDERR"); - open(STDERR, ">", "/dev/null"); - my $ret=system("cvs", "-Q", @_); - open(STDERR, ">$savederr"); - -`cvs_runcvs` should not take an array reference. It's -usual for this type of function to take a list of parameters -to pass to the command. - -> Thanks for reading carefully. I've tested your suggestions and -> applied them on my branch. --[[schmonz]] - ----- - -I've abstracted out CVS's involvement in the wrapper, adding a new -"wrapperargcheck" hook to examine `argc/argv` and return success or -failure (failure causes the wrapper to terminate) and implementing -this hook in the plugin. In the non-CVS case, the check immediately -returns success, so the added overhead is just a function call. - -Given how rarely anything should need to reach in and modify the -wrapper -- I'd go so far as to say we shouldn't make it too easy --- I don't think it's worth the effort to try and design a more -general-purpose way to do so. If and when some other problem thinks -it wants to be solved by a new wrapper hook, it's easy enough to add -one. Until then, I'd say it's more important to keep the wrapper as -short and clear as possible. --[[schmonz]] - -> I've committed a slightly different hook, which should be general enough -> that `IkiWiki::Receive` can also use it, so please adapt your code to -> that. --[[Joey]] - ->> Done. --[[schmonz]]. diff --git a/doc/rcs/cvs.mdwn b/doc/rcs/cvs.mdwn new file mode 100644 index 000000000..f0bd0f6f0 --- /dev/null +++ b/doc/rcs/cvs.mdwn @@ -0,0 +1,27 @@ +If you really need to, you can use [[!wikipedia desc="CVS" Concurrent Versions System]] +with ikiwiki. + +### Usage +7. Install [[!cpan File::chdir]], [[!cpan File::ReadBackwards]], +[cvsps](http://www.cobite.com/cvsps/), and +[cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. +7. Adjust CVS-related parameters in your setup file. + +Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn't need it, but you yourself might. Here's a good general-purpose one: + + cvs -q + checkout -P + update -dP + diff -u + rdiff -u + +### Implementation details +* [[ikiwiki-makerepo]]: + * creates a repository, + * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), + * configures the post-commit hook in `CVSROOT/loginfo`. +* CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). + +### To do +* Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. +* Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. diff --git a/doc/rcs/cvs/discussion.mdwn b/doc/rcs/cvs/discussion.mdwn new file mode 100644 index 000000000..645b2388b --- /dev/null +++ b/doc/rcs/cvs/discussion.mdwn @@ -0,0 +1,149 @@ +I've started reviewing this, and the main thing I don't like is the +post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. +That just seems unnecessarily complicated. Why can't ikiwiki itself detect +the "cvs add " call and avoid doing anything in that case? +--[[Joey]] + +> The wrapper wrapper does three things: +> +> 7. It ignores `cvs add `, since this is a weird CVS +> behavior that ikiwiki gets confused by and doesn't need to act on. +> 7. It prevents `cvs` locking against itself: `cvs commit` takes a +> write lock and runs the post-commit hook, which runs `cvs update`, +> which wants a read lock and sleeps forever -- unless the post-commit +> hook runs in the background so the commit can "finish". +> 7. It fails silently if the ikiwiki post-commit hook is missing. +> CVS doesn't have any magic post-commit filenames, so hooks have to +> be configured explicitly. I don't think a commit will actually fail +> if a configured post-commit hook is missing (though I can't test +> this at the moment). +> +> Thing 1 can probably be handled within ikiwiki, if that seems less +> gross to you. + +>> It seems like it might be. You can use a `getopt` hook to check +>> `@ARGV` to see how it was called. --[[Joey]] + +>>> This does the trick iff the post-commit wrapper passes its args +>>> along. Committed on my branch. This seems potentially dangerous, +>>> since the args passed to ikiwiki are influenced by web commits. +>>> I don't see an exploit, but for paranoia's sake, maybe the wrapper +>>> should only be built with execv() if the cvs plugin is loaded? +>>> --[[schmonz]] + +>>>> Hadn't considered that. While in wrapper mode the normal getopt is not +>>>> done, plugin getopt still runs, and so any unsafe options that +>>>> other plugins support could be a problem if another user runs +>>>> the setuid wrapper and passes those options through. --[[Joey]] + +>>>>> I've tried compiling the argument check into the wrapper as +>>>>> the first thing main() does, and was surprised to find that +>>>>> this doesn't prevent the `cvs add ` deadlock in a web +>>>>> commit. I was convinced this'd be a reasonable solution, +>>>>> especially if conditionalized on the cvs plugin being loaded, +>>>>> but it doesn't work. And I stuck debug printfs at the beginning +>>>>> of all the rcs_foo() subs, and whatever `cvs add ` is +>>>>> doing to ikiwiki isn't visible to my plugin, because none of +>>>>> those subs are getting called. Nuts. Can you think of anything +>>>>> else that might solve the problem, or should I go back to +>>>>> generating a minimal wrapper wrapper that checks for just +>>>>> this one thing? --[[schmonz]] + +>>>>>> I don't see how there could possibly be a difference between +>>>>>> ikiwiki's C wrapper and your shell wrapper wrapper here. --[[Joey]] + +>>>>>>> I was comparing strings overly precisely. Fixed on my branch. +>>>>>>> I've also knocked off the two most pressing to-do items. I +>>>>>>> think the plugin's ready for prime time. --[[schmonz]] + +> Thing 2 I'm less sure of. (I'd like to see the web UI return +> immediately on save anyway, to a temporary "rebuilding, please wait +> if you feel like knowing when it's done" page, but this problem +> with CVS happens with any kind of commit, and could conceivably +> happen with some other VCS.) + +>> None of the other VCSes let a write lock block a read lock, apparently. +>> +>> Anyway, re the backgrounding, when committing via the web, the +>> post-commit hook doesn't run anyway; the rendering is done via the +>> ikiwiki CGI. It would certianly be nice if it popped up a quick "working" +>> page and replaced it with the updated page when done, but that's +>> unrelated; the post-commit +>> hook only does rendering when committing using the VCS directly. The +>> backgrounding you do actually seems safe enough -- but tacking +>> on a " &" to the ikiwiki wrapper call doesn't need a wrapper script, +>> does it? --[[Joey]] + +>>> Nope, it works fine to append it to the `CVSROOT/loginfo` line. +>>> Fixed on my branch. --[[schmonz]] + +> Thing 3 I think I did in order to squelch the error messages that +> were bollixing up the CGI. It was easy to do this in the wrapper +> wrapper, but if that's going away, it can be done just as easily +> with output redirection in `CVSROOT/loginfo`. +> +> --[[schmonz]] + +>> If the error messages screw up the CGI they must go to stdout. +>> I thought we had stderr even in the the CVS dark ages. ;-) --[[Joey]] + +>>> Some messages go to stderr, but definitely not all. That's why +>>> I wound up reaching for IPC::Cmd, to execute the command line +>>> safely while shutting CVS up. Anyway, I've tested what happens +>>> if a configured post-commit hook is missing, and it seems fine, +>>> probably also thanks to IPC::Cmd. +>>> --[[schmonz]] + +---- + + +Further review.. --[[Joey]] + +I don't understand what `cvs_shquote_commit` is +trying to do with the test message, but it seems +highly likely to be insecure; I never trust anything +that relies on safely quoting user input passed to the shell. + +(As an aside, `shell_quote` can die on certian inputs.) + +Seems to me that, if `IPC::Cmd` exposes input to the shell +(which I have not verified but its docs don't specify; a bad sign) +you chose the wrong tool and ended up doing down the wrong +route, dragging in shell quoting problems and fixes. Since you +chose to use `IPC::Cmd` just because you wanted to shut +up CVS stderr, my suggestion would be to use plain `system` +to run the command, with stderr temporarily sent to /dev/null: + + open(my $savederr, ">&STDERR"); + open(STDERR, ">", "/dev/null"); + my $ret=system("cvs", "-Q", @_); + open(STDERR, ">$savederr"); + +`cvs_runcvs` should not take an array reference. It's +usual for this type of function to take a list of parameters +to pass to the command. + +> Thanks for reading carefully. I've tested your suggestions and +> applied them on my branch. --[[schmonz]] + +---- + +I've abstracted out CVS's involvement in the wrapper, adding a new +"wrapperargcheck" hook to examine `argc/argv` and return success or +failure (failure causes the wrapper to terminate) and implementing +this hook in the plugin. In the non-CVS case, the check immediately +returns success, so the added overhead is just a function call. + +Given how rarely anything should need to reach in and modify the +wrapper -- I'd go so far as to say we shouldn't make it too easy +-- I don't think it's worth the effort to try and design a more +general-purpose way to do so. If and when some other problem thinks +it wants to be solved by a new wrapper hook, it's easy enough to add +one. Until then, I'd say it's more important to keep the wrapper as +short and clear as possible. --[[schmonz]] + +> I've committed a slightly different hook, which should be general enough +> that `IkiWiki::Receive` can also use it, so please adapt your code to +> that. --[[Joey]] + +>> Done. --[[schmonz]]. diff --git a/doc/rcs/details.mdwn b/doc/rcs/details.mdwn index 6492cf38c..013ddb745 100644 --- a/doc/rcs/details.mdwn +++ b/doc/rcs/details.mdwn @@ -288,3 +288,5 @@ user for cleanup. This is less neat than it could be, in that a conflict marked revision gets committed to the repository. ## [[bzr]] + +## [[cvs]] -- cgit v1.2.3 From 412a4dd62ade18f5e057ff3324321188245a542e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Sep 2009 14:44:32 -0400 Subject: review --- doc/plugins/contrib/rsync/discussion.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn index 20c04af0f..9b4184e5f 100644 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -46,3 +46,17 @@ The wiki now lives on (1), and clicking "edit" just works. --[[schmonz]] >> This plugin is definitely still useful for projects not able to use >> a DVCS (of which I've got at least one other), and possibly for >> other uses not yet imagined. ;-) --[[schmonz]] + +---- + +Revew: --[[Joey]] + +* I think it should not throw an error if no command is set. Just don't do anything. +* If the rsync fails, it currently errors out, which will probably also leave + the wiki in a broken state, since ikiwiki will not get a chance to save + its state. This seems fragile; what if the laptop is offline, or the + server is down, etc. Maybe it should just warn if the rsync fails? +* Is a new hook really needed? The savestate hook runs at a similar time; + only issue with it is that it is run even when ikiwiki has not + rendered any updated pages. Bah, I think you do need the new hook, how + annoying.. -- cgit v1.2.3 From 544cedaa1903c6314ed7ba98d96965a4017944ec Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Fri, 11 Sep 2009 17:34:47 -0400 Subject: response --- doc/plugins/contrib/rsync/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn index 9b4184e5f..b162fbd6b 100644 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -60,3 +60,9 @@ Revew: --[[Joey]] only issue with it is that it is run even when ikiwiki has not rendered any updated pages. Bah, I think you do need the new hook, how annoying.. + +> * Depends whether the plugin would be on by default. If yes, then yes. +> If the admin has to enable it, I'd think they'd want the error. +> * Changed the other errors to warnings. +> * The name might be wrong: there isn't anything rsync-specific about the +> plugin, that's just the command I personally need to run. --[[schmonz]] -- cgit v1.2.3 From a7d7acc0f761fff16637e427f30d365b54be1a33 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Sep 2009 17:47:31 -0400 Subject: resp --- doc/plugins/contrib/rsync/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn index b162fbd6b..6bf7a3826 100644 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ b/doc/plugins/contrib/rsync/discussion.mdwn @@ -66,3 +66,12 @@ Revew: --[[Joey]] > * Changed the other errors to warnings. > * The name might be wrong: there isn't anything rsync-specific about the > plugin, that's just the command I personally need to run. --[[schmonz]] + +>> One problem with the error is that it prevents dumping a new setup file with +>> the plugin enabled, and then editing it to configure. ie: + + joey@gnu:~>ikiwiki -setup .ikiwiki/joeywiki.setup -plugin rsync -dumpsetup new.setup + Must specify rsync_command + +> rsync seems by far the most likely command, though someone might use something +> to push via ftp instead. I think calling it rsync is ok. --[[Joey]] -- cgit v1.2.3 From 5b818c9f2ac9c9a2d953f29194913036ab26c225 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Sep 2009 18:28:35 -0400 Subject: doc update, add --exclude ikiwiki.cgi to examples --- IkiWiki/Plugin/rsync.pm | 2 +- doc/plugins/contrib/rsync.mdwn | 21 --------- doc/plugins/contrib/rsync/discussion.mdwn | 77 ------------------------------- doc/plugins/rsync.mdwn | 17 +++++++ doc/plugins/rsync/discussion.mdwn | 77 +++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 99 deletions(-) delete mode 100644 doc/plugins/contrib/rsync.mdwn delete mode 100644 doc/plugins/contrib/rsync/discussion.mdwn create mode 100644 doc/plugins/rsync.mdwn create mode 100644 doc/plugins/rsync/discussion.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/rsync.pm b/IkiWiki/Plugin/rsync.pm index a62347a44..f14989ff8 100644 --- a/IkiWiki/Plugin/rsync.pm +++ b/IkiWiki/Plugin/rsync.pm @@ -18,7 +18,7 @@ sub getsetup () { }, rsync_command => { type => "string", - example => "rsync -qa --delete . user\@host:/path/to/docroot/", + example => "rsync -qa --delete . user\@host:/path/to/docroot/ --exclude ikiwiki.cgi", description => "command to run to sync updated pages", safe => 0, rebuild => 0, diff --git a/doc/plugins/contrib/rsync.mdwn b/doc/plugins/contrib/rsync.mdwn deleted file mode 100644 index 71cd63947..000000000 --- a/doc/plugins/contrib/rsync.mdwn +++ /dev/null @@ -1,21 +0,0 @@ -[[!template id=plugin name=rsync core=0 author="[[schmonz]]"]] - -[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] - -This plugin allows ikiwiki to push generated pages to another host -by running a command such as `rsync`. - -### Usage -7. Enable automated SSH key exchange between ikiwiki and the remote - host. [keychain](http://www.gentoo.org/proj/en/keychain/) makes - it easy to use a passphrase-protected key for this purpose. It's - also a good idea to specify the exact command line to be permitted - in the remote host's `$HOME/.ssh/authorized_keys`. -7. Set `rsync_command` in your setup file. If you're using a - passphrase-protected key, then set `rsync_command` to a shell - script which reads `keychain`'s current state before calling - `rsync`. - -### Implementation details -* The plugin relies on a new "postrefresh" hook called at the very end of - `IkiWiki/Render.pm:refresh()`. diff --git a/doc/plugins/contrib/rsync/discussion.mdwn b/doc/plugins/contrib/rsync/discussion.mdwn deleted file mode 100644 index 6bf7a3826..000000000 --- a/doc/plugins/contrib/rsync/discussion.mdwn +++ /dev/null @@ -1,77 +0,0 @@ -## A use case - -Why I needed this plugin: I have two web servers available to me -for a project. Neither does everything I need, but together they -do. (This is a bit like the [Amazon S3 -scenario](http://kitenet.net/~joey/blog/entry/running_a_wiki_on_Amazon_S3/).) - -Server (1) is a university web server. It provides plentiful space -and bandwidth, easy authentication for people editing the wiki, and -a well-known stable URL. The wiki really wants to live here and -very easily could except that the server doesn't allow arbitrary -CGIs. - -Server (2) is provided by a generous alumnus's paid [[tips/DreamHost]] -account. Disk and particularly network usage need to be minimized -because over some threshold it costs him. CGI, etc. are available. - -My plan was to host the wiki on server (1) by taking advantage of -server (2) to store the repository, source checkout, and generated -pages, to host the repository browser, and to handle ikiwiki's CGI -operations. In order for this to work, web edits on (2) would need -to automatically push any changed pages to (1). - -As a proof of concept, I added an rsync post-commit hook after -ikiwiki's usual. It worked, just not for web edits, which is how -the wiki will be used. So I wrote this plugin to finish the job. -The wiki now lives on (1), and clicking "edit" just works. --[[schmonz]] - -> Just out of interest, why use `rsync` and not `git push`. i.e. a -> different setup to solve the same problem would be to run a -> normal ikiwiki setup on the universities server with its git -> repository available over ssh (same security setup your using -> for rsync should work for git over ssh). On the cgi-capable server, -> when it would rsync, make it git push. It would seem that git -> has enough information that it should be able to be more -> network efficient. It also means that corruption at one end -> wouldn't be propagated to the other end. -- [[Will]] - ->> Hey, that's a nice solution. (The site was in svn to begin with, ->> but it's in git now.) One advantage of my approach in this particular ->> case: server (1) doesn't have `git` installed, but does have `rsync`, ->> so (1)'s environment can remain completely untweaked other than the ->> SSH arrangement. I kind of like that all the sysadmin effort is ->> contained on one host. ->> ->> This plugin is definitely still useful for projects not able to use ->> a DVCS (of which I've got at least one other), and possibly for ->> other uses not yet imagined. ;-) --[[schmonz]] - ----- - -Revew: --[[Joey]] - -* I think it should not throw an error if no command is set. Just don't do anything. -* If the rsync fails, it currently errors out, which will probably also leave - the wiki in a broken state, since ikiwiki will not get a chance to save - its state. This seems fragile; what if the laptop is offline, or the - server is down, etc. Maybe it should just warn if the rsync fails? -* Is a new hook really needed? The savestate hook runs at a similar time; - only issue with it is that it is run even when ikiwiki has not - rendered any updated pages. Bah, I think you do need the new hook, how - annoying.. - -> * Depends whether the plugin would be on by default. If yes, then yes. -> If the admin has to enable it, I'd think they'd want the error. -> * Changed the other errors to warnings. -> * The name might be wrong: there isn't anything rsync-specific about the -> plugin, that's just the command I personally need to run. --[[schmonz]] - ->> One problem with the error is that it prevents dumping a new setup file with ->> the plugin enabled, and then editing it to configure. ie: - - joey@gnu:~>ikiwiki -setup .ikiwiki/joeywiki.setup -plugin rsync -dumpsetup new.setup - Must specify rsync_command - -> rsync seems by far the most likely command, though someone might use something -> to push via ftp instead. I think calling it rsync is ok. --[[Joey]] diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn new file mode 100644 index 000000000..0ab3872d9 --- /dev/null +++ b/doc/plugins/rsync.mdwn @@ -0,0 +1,17 @@ +[[!template id=plugin name=rsync author="[[schmonz]]"]] + +This plugin allows ikiwiki to push generated pages to another host +by running a command such as `rsync`. + +The command to run is specified by setting `rsync_command` in your setup +file. The command will be run in your destdir, so something like this +is a typical command: + + rsync -qa --delete . user\@host:/path/to/docroot/ --exclude ikiwiki.cgi + +If using rsync over ssh, you will need to enable noninteractive ssh login +to the remote host. It's also a good idea to specify the exact command line +to be permitted in the remote host's `$HOME/.ssh/authorized_keys`. + +Be sure to exclude the `ikiwiki.cgi` wrapper from being sent to the remote +host. diff --git a/doc/plugins/rsync/discussion.mdwn b/doc/plugins/rsync/discussion.mdwn new file mode 100644 index 000000000..6bf7a3826 --- /dev/null +++ b/doc/plugins/rsync/discussion.mdwn @@ -0,0 +1,77 @@ +## A use case + +Why I needed this plugin: I have two web servers available to me +for a project. Neither does everything I need, but together they +do. (This is a bit like the [Amazon S3 +scenario](http://kitenet.net/~joey/blog/entry/running_a_wiki_on_Amazon_S3/).) + +Server (1) is a university web server. It provides plentiful space +and bandwidth, easy authentication for people editing the wiki, and +a well-known stable URL. The wiki really wants to live here and +very easily could except that the server doesn't allow arbitrary +CGIs. + +Server (2) is provided by a generous alumnus's paid [[tips/DreamHost]] +account. Disk and particularly network usage need to be minimized +because over some threshold it costs him. CGI, etc. are available. + +My plan was to host the wiki on server (1) by taking advantage of +server (2) to store the repository, source checkout, and generated +pages, to host the repository browser, and to handle ikiwiki's CGI +operations. In order for this to work, web edits on (2) would need +to automatically push any changed pages to (1). + +As a proof of concept, I added an rsync post-commit hook after +ikiwiki's usual. It worked, just not for web edits, which is how +the wiki will be used. So I wrote this plugin to finish the job. +The wiki now lives on (1), and clicking "edit" just works. --[[schmonz]] + +> Just out of interest, why use `rsync` and not `git push`. i.e. a +> different setup to solve the same problem would be to run a +> normal ikiwiki setup on the universities server with its git +> repository available over ssh (same security setup your using +> for rsync should work for git over ssh). On the cgi-capable server, +> when it would rsync, make it git push. It would seem that git +> has enough information that it should be able to be more +> network efficient. It also means that corruption at one end +> wouldn't be propagated to the other end. -- [[Will]] + +>> Hey, that's a nice solution. (The site was in svn to begin with, +>> but it's in git now.) One advantage of my approach in this particular +>> case: server (1) doesn't have `git` installed, but does have `rsync`, +>> so (1)'s environment can remain completely untweaked other than the +>> SSH arrangement. I kind of like that all the sysadmin effort is +>> contained on one host. +>> +>> This plugin is definitely still useful for projects not able to use +>> a DVCS (of which I've got at least one other), and possibly for +>> other uses not yet imagined. ;-) --[[schmonz]] + +---- + +Revew: --[[Joey]] + +* I think it should not throw an error if no command is set. Just don't do anything. +* If the rsync fails, it currently errors out, which will probably also leave + the wiki in a broken state, since ikiwiki will not get a chance to save + its state. This seems fragile; what if the laptop is offline, or the + server is down, etc. Maybe it should just warn if the rsync fails? +* Is a new hook really needed? The savestate hook runs at a similar time; + only issue with it is that it is run even when ikiwiki has not + rendered any updated pages. Bah, I think you do need the new hook, how + annoying.. + +> * Depends whether the plugin would be on by default. If yes, then yes. +> If the admin has to enable it, I'd think they'd want the error. +> * Changed the other errors to warnings. +> * The name might be wrong: there isn't anything rsync-specific about the +> plugin, that's just the command I personally need to run. --[[schmonz]] + +>> One problem with the error is that it prevents dumping a new setup file with +>> the plugin enabled, and then editing it to configure. ie: + + joey@gnu:~>ikiwiki -setup .ikiwiki/joeywiki.setup -plugin rsync -dumpsetup new.setup + Must specify rsync_command + +> rsync seems by far the most likely command, though someone might use something +> to push via ftp instead. I think calling it rsync is ok. --[[Joey]] -- cgit v1.2.3 From 9042a86f367654c4f872a8dcf6f78f3f0df57421 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Sep 2009 18:37:42 -0400 Subject: update --- doc/plugins/rsync.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn index 0ab3872d9..9bfe7303e 100644 --- a/doc/plugins/rsync.mdwn +++ b/doc/plugins/rsync.mdwn @@ -7,11 +7,11 @@ The command to run is specified by setting `rsync_command` in your setup file. The command will be run in your destdir, so something like this is a typical command: - rsync -qa --delete . user\@host:/path/to/docroot/ --exclude ikiwiki.cgi + rsync => 'rsync -qa --delete . user@host:/path/to/docroot/ --exclude ikiwiki.cgi', If using rsync over ssh, you will need to enable noninteractive ssh login to the remote host. It's also a good idea to specify the exact command line to be permitted in the remote host's `$HOME/.ssh/authorized_keys`. Be sure to exclude the `ikiwiki.cgi` wrapper from being sent to the remote -host. +host, as in the above example. -- cgit v1.2.3 From f1999df705f22638a6d9d44c728c4282e674b982 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Sep 2009 00:24:57 -0400 Subject: remove cgi exclusion Note that a typical use of this plugin is for a static site, w/o cgi support enabled. --- IkiWiki/Plugin/rsync.pm | 2 +- doc/plugins/rsync.mdwn | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/rsync.pm b/IkiWiki/Plugin/rsync.pm index 45bff19bd..e38801e4a 100644 --- a/IkiWiki/Plugin/rsync.pm +++ b/IkiWiki/Plugin/rsync.pm @@ -19,7 +19,7 @@ sub getsetup () { }, rsync_command => { type => "string", - example => "rsync -qa --delete . user\@host:/path/to/docroot/ --exclude ikiwiki.cgi", + example => "rsync -qa --delete . user\@host:/path/to/docroot/", description => "command to run to sync updated pages", safe => 0, rebuild => 0, diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn index 9bfe7303e..e0ab96d14 100644 --- a/doc/plugins/rsync.mdwn +++ b/doc/plugins/rsync.mdwn @@ -7,11 +7,12 @@ The command to run is specified by setting `rsync_command` in your setup file. The command will be run in your destdir, so something like this is a typical command: - rsync => 'rsync -qa --delete . user@host:/path/to/docroot/ --exclude ikiwiki.cgi', + rsync => 'rsync -qa --delete . user@host:/path/to/docroot/', If using rsync over ssh, you will need to enable noninteractive ssh login to the remote host. It's also a good idea to specify the exact command line to be permitted in the remote host's `$HOME/.ssh/authorized_keys`. -Be sure to exclude the `ikiwiki.cgi` wrapper from being sent to the remote -host, as in the above example. +A typival ikiwiki configuration when using this plugin is to disable cgi +support, so ikiwiki builds a completely static site that can be served from +the remote host. -- cgit v1.2.3 From dad25308d2832de28d3b8151aacc3b124575733c Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sat, 12 Sep 2009 01:32:29 -0400 Subject: typo --- doc/plugins/rsync.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn index e0ab96d14..db7fcb4f7 100644 --- a/doc/plugins/rsync.mdwn +++ b/doc/plugins/rsync.mdwn @@ -13,6 +13,6 @@ If using rsync over ssh, you will need to enable noninteractive ssh login to the remote host. It's also a good idea to specify the exact command line to be permitted in the remote host's `$HOME/.ssh/authorized_keys`. -A typival ikiwiki configuration when using this plugin is to disable cgi +A typical ikiwiki configuration when using this plugin is to disable cgi support, so ikiwiki builds a completely static site that can be served from the remote host. -- cgit v1.2.3 From 36094d76742872e3a894a15775832e8ba8261bbf Mon Sep 17 00:00:00 2001 From: "http://kaizer.se/" Date: Wed, 16 Sep 2009 23:34:27 -0400 Subject: Resolving WikiLinks in rst -- WIP --- doc/plugins/rst/discussion.mdwn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index 9909784d5..af96edc6a 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -41,3 +41,33 @@ such since they are inline elements in the text.. But images work fine in rst's syntax.. what about using rst syntax for wikilinks as well? Is it possible to inject something into the parser to turn unmached links ``WikiLink`_` into ikiwiki links? --ulrik + +------ + +Resolving WikiLinks in rst +========================== + +I wanted to look into if we can hook into rst and influence how links are resolved. +It turns out it is possible, and I have a working WIP for the rst plugin that does this. + +My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: http://kaizer.se/wiki/rst.py +*Warning, written in the middle of the night just to test if it works!* + +It basically matches normal rst links just like ikiwiki would match a wikilink +if it existed. +I can't read perl so I haven't found out so much. The plugin successfully registers backlinks using +`proxy.rpc('add_link', on_page, bestlink)` (since the destination page will be rebuilt to update), +but the backlinks don't show up. + +I converted one of my pages to rst: + +Before: http://kaizer.se/wiki/kupfer-mdwn +After: http://kaizer.se/wiki/kupfer-rst + +I need help on a couple of points + +* How to fix the backlinks with `add_link`? +* How to generate NonExistingLinks using the plugin API? +* Can we include this in ikiwiki's rst if it is not too hairy? + +--ulrik -- cgit v1.2.3 From 5946a54ec793fa89bdb9a116d74684a93a9696bd Mon Sep 17 00:00:00 2001 From: "http://kaizer.se/" Date: Thu, 17 Sep 2009 11:33:12 -0400 Subject: see Resolve native reStructuredText links to ikiwiki pages --- doc/plugins/rst/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index af96edc6a..38fbed6d6 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -50,8 +50,8 @@ Resolving WikiLinks in rst I wanted to look into if we can hook into rst and influence how links are resolved. It turns out it is possible, and I have a working WIP for the rst plugin that does this. -My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: http://kaizer.se/wiki/rst.py -*Warning, written in the middle of the night just to test if it works!* +My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: +[[todo/Resolve native reStructuredText links to ikiwiki pages]] It basically matches normal rst links just like ikiwiki would match a wikilink if it existed. -- cgit v1.2.3 From bac0174b786a10d3cb8277bfa519918bd38762c4 Mon Sep 17 00:00:00 2001 From: brush Date: Tue, 22 Sep 2009 18:49:03 -0400 Subject: installation attachments q's --- doc/plugins/contrib/album/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/plugins/contrib/album/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn new file mode 100644 index 000000000..ee3aa6ce4 --- /dev/null +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -0,0 +1,7 @@ +thanks for this plugin. it might help me in my application, which is to provide album/galleries which can be edited (ie. new images added, taken away, etc.) through web interface. + +i have two challenges: firstly, for installation, i'm not sure what all the files are that need to be downloaded (because of my setup i can't easily pull the repo). so far i have Ikiwiki/Plugins/album.pm; ikiwiki-album; and 4 files in templates/ any others? + +secondly: barring the CGI interface for editing the album, which would be great, is there at least a way to use attachment plugin or any other to manually add images and then create viewers for them? + +i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush -- cgit v1.2.3 From 0b0116cb986bf5840c8e40e57f5a45501c3d22f6 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Fri, 25 Sep 2009 06:35:43 +0200 Subject: create myself a user page and link from my signatures so far --- doc/forum/How_does_ikiwiki_remember_times__63__.mdwn | 1 + doc/plugins/tag/discussion.mdwn | 2 +- doc/users/David_Riebenbauer.mdwn | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 doc/users/David_Riebenbauer.mdwn (limited to 'doc/plugins') diff --git a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn index df9636a1e..6ce576db1 100644 --- a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn +++ b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn @@ -106,3 +106,4 @@ Do I have it right? done +> --[[David_Riebenbauer]] diff --git a/doc/plugins/tag/discussion.mdwn b/doc/plugins/tag/discussion.mdwn index b6dab5358..03dcb7b2f 100644 --- a/doc/plugins/tag/discussion.mdwn +++ b/doc/plugins/tag/discussion.mdwn @@ -16,7 +16,7 @@ Thanks. That works fine. @Ben: could you publish the code for that? ---David Riebenbauer +--[[David_Riebenbauer]] AOLMODE=true echo "I too would really like this feature, which would make cgi free life much better" --[[DavidBremner]] diff --git a/doc/users/David_Riebenbauer.mdwn b/doc/users/David_Riebenbauer.mdwn new file mode 100644 index 000000000..657314ee1 --- /dev/null +++ b/doc/users/David_Riebenbauer.mdwn @@ -0,0 +1,2 @@ +Runs ikiwiki on his [homepage](http://liegesta.at/) and can be reached through +davrieb@liegesta.at -- cgit v1.2.3 From be47e501c32cec7660129f430a4f93ee7fe8d3ff Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 25 Sep 2009 14:19:49 -0400 Subject: reply to potential album user --- doc/plugins/contrib/album/discussion.mdwn | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index ee3aa6ce4..7a3c19cf6 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -1,7 +1,53 @@ thanks for this plugin. it might help me in my application, which is to provide album/galleries which can be edited (ie. new images added, taken away, etc.) through web interface. +> That's my goal eventually, too. Perhaps you can help to +> design/write this plugin? At the moment I'm mostly +> waiting for a design "sanity check" from [[Joey]], +> but any feedback you can provide on the design would +> also be helpful. --[[smcv]] + i have two challenges: firstly, for installation, i'm not sure what all the files are that need to be downloaded (because of my setup i can't easily pull the repo). so far i have Ikiwiki/Plugins/album.pm; ikiwiki-album; and 4 files in templates/ any others? +> Those are all the added files; ikiwiki-album isn't strictly +> needed (IkiWiki itself doesn't use that code, but you can +> use it to turn a directory full of images into correct +> input for the album plugin). +> +> You probably also want the album plugin's expanded version of +> style.css (or put its extra rules in your local.css). +> Without that, your albums will be quite ugly. +> +> There aren't currently any other files modified by my branch. +> --[[smcv]] + secondly: barring the CGI interface for editing the album, which would be great, is there at least a way to use attachment plugin or any other to manually add images and then create viewers for them? +> Images are just attachments, and viewers are pages (any supported +> format, but .html will be fastest to render). Attach each image, +> then write a page for each image containing the +> \[[!albumimage]] directive (usually it will *only* contain that +> directive). +> +> The script ikiwiki-album can help you to do this in a git/svn/etc. +> tree; doing it over the web will be a lot of work (until I get +> the CGI interface written), but it should already be possible! +> +> The structure is something like this: +> +> * album.mdwn (contains the \[[!album]] directive, and perhaps also +> some \[[!albumsection]] directives) +> * album/a.jpg +> * album/a.html (contains the \[[!albumimage]] directive for a.jpg) +> * album/b.jpg +> * album/b.html (contains the \[[!albumimage]] directive for b.jpg) +> +> Have a look at ikiwiki-album to see how the directives are meant to +> work in practice. +> +> --[[smcv]] + i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush + +> This plugin is pretty ambitious, and is unfinished, so I'd recommend +> playing with a normal IkiWiki installation for a bit, then trying +> out this plugin when you've mastered the basics of IkiWiki. --[[smcv]] -- cgit v1.2.3 From caa3818effe74c52fc783e31c51f0566c7805e62 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Sep 2009 15:17:03 -0400 Subject: thoughts --- doc/plugins/contrib/album/discussion.mdwn | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 7a3c19cf6..5fb91c5a4 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -51,3 +51,36 @@ i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush > This plugin is pretty ambitious, and is unfinished, so I'd recommend > playing with a normal IkiWiki installation for a bit, then trying > out this plugin when you've mastered the basics of IkiWiki. --[[smcv]] + +---- + +You had wanted my feedback on the design of this. I have not looked at the +code or tried it yet, but here goes. --[[Joey]] + +* Needing to create the albumimage "viewer" pages for each photo + seems like it will become a pain. Everyone will need to come up + with their own automation for it, and then there's the question + of how to automate it when uploading attachments. +* With each viewer page having next/prev links, I can see how you + were having the scalability issues with ikiwiki's data structures + earlier! +* And doesn't each viewer page really depend on every other page in the + same albumsection? If a new page is added, the next/prev links + may need to be updated, for example. If so, there will be much + unnecessary rebuilding. +* One thing I do like about having individual pages per image is + that they can each have their own comments, etc. +* Seems possibly backwards that the albumimage controls what album + an image appears in. Two use cases -- 1: I may want to make a locked + album, but then anyone who can write to any other page on the wiki can + add an image to it. 2: I may want an image to appear in more than one + album. Think tags. So it seems it would be better to have the album + directive control what pages it includes (a la inline). +* Putting a few of the above thoughts together, my ideal album system + seems to be one where I can just drop the images into a directory and + have them appear in the album index, as well as each generate their own wiki + page. Plus some way I can, later, edit metadata for captions, + etc. (Real pity we can't just put arbitrary metadata into the images + themselves.) This is almost pointing toward making the images first-class + wiki page sources. Hey, it worked for po! :) But the metadata and editing + problems probably don't really allow that. -- cgit v1.2.3 From 13940c57736a28803f11c871cada7a6e8734f029 Mon Sep 17 00:00:00 2001 From: "http://weakish.pigro.net/" Date: Thu, 1 Oct 2009 05:48:09 -0400 Subject: [patch] add an option to determine whether put autoindex pages in repo or not --- doc/plugins/autoindex/discussion.mdwn | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index 82e30aab1..2d6b6f1f0 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -5,3 +5,59 @@ The reason being that I have a lot of directories which need to be autoindexed, but I would prefer if the index files didn't clutter up my git repository. even without that feature the plugin is a great help, thanks + + +------ + +If you just don't want to clutter your git repo, below it's a patch does the following: + +* If you set autoindex_commit to 0 in your ikiwiki.setup file, we *do* place auto-generated markdown files in the **wiki source** but *not* in the **repo** + +* If you set autoindex_commit to 1 (this is the default), auto-generated index files will be put in the repo provided you enabled rcs backend. + +
+--- autoindex.pm.orig	2009-10-01 17:13:51.000000000 +0800
++++ autoindex.pm	2009-10-01 17:21:09.000000000 +0800
+@@ -17,6 +17,13 @@
+ 			safe => 1,
+ 			rebuild => 0,
+ 		},
++        autoindex_commit => {
++            type => 'boolean',
++            default => 1,
++            description => 'commit generated autoindex pages into RCS',
++            safe => 0,
++            rebuild => 0,
++        },
+ }
+ 
+ sub genindex ($) {
+@@ -25,7 +32,7 @@
+ 	my $template=template("autoindex.tmpl");
+ 	$template->param(page => $page);
+ 	writefile($file, $config{srcdir}, $template->output);
+-	if ($config{rcs}) {
++	if ($config{rcs} and $config{autoindex_commit}) {
+ 		IkiWiki::rcs_add($file);
+ 	}
+ }
+@@ -94,13 +101,13 @@
+ 	}
+ 	
+ 	if (@needed) {
+-		if ($config{rcs}) {
++		if ($config{rcs} and $config{autoindex_commit}) {
+ 			IkiWiki::disable_commit_hook();
+ 		}
+ 		foreach my $page (@needed) {
+ 			genindex($page);
+ 		}
+-		if ($config{rcs}) {
++		if ($config{rcs} and $config{autoindex_commit}) {
+ 			IkiWiki::rcs_commit_staged(
+ 				gettext("automatic index generation"),
+ 				undef, undef);
+
+ + +Warning: I guess this patch may work, but I *haven't tested it yet*. -- [[weakish]] -- cgit v1.2.3 From f62de29638ec3d8d1d2e27601b0096cf865c48cc Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 1 Oct 2009 08:12:49 -0400 Subject: documentation seems inaccurate --- doc/plugins/sidebar/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/plugins/sidebar/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/sidebar/discussion.mdwn b/doc/plugins/sidebar/discussion.mdwn new file mode 100644 index 000000000..78af3525c --- /dev/null +++ b/doc/plugins/sidebar/discussion.mdwn @@ -0,0 +1,3 @@ +> Warning: Any change to the sidebar will cause a rebuild of the whole wiki, since every page includes a copy that has to be updated. This can especially be a problem if the sidebar includes inline or map directives, since any changes to pages inlined or mapped onto the sidebar will change the sidebar and cause a full wiki rebuild. + +I tried exactly that, namely having an inline in my sidebar to include an rss feed from some other side. I think the complete wiki rebuild should be doable every few days when a new article appears in that feed. But contrary to that warning there is no complete wiki rebuild, only the sidebar page is rebuilt by the "ikiwiki --aggregate" from cron. Is that a bug or a feature? -- cgit v1.2.3 From 4f9c5896b242ac08be181047ad426bd458a0bf49 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 2 Oct 2009 15:15:23 -0400 Subject: add bug about transitive dependencies --- doc/bugs/transitive_dependencies.mdwn | 47 +++++++++++++++++++++++++++ doc/plugins/sidebar/discussion.mdwn | 2 ++ doc/todo/tracking_bugs_with_dependencies.mdwn | 5 +-- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 doc/bugs/transitive_dependencies.mdwn (limited to 'doc/plugins') diff --git a/doc/bugs/transitive_dependencies.mdwn b/doc/bugs/transitive_dependencies.mdwn new file mode 100644 index 000000000..c61afe81e --- /dev/null +++ b/doc/bugs/transitive_dependencies.mdwn @@ -0,0 +1,47 @@ +If a sidebar contains a map, or inline (etc), one would expect a +change/add/remove of any of the mapped/inlined pages to cause a full wiki +rebuild. But this does not happen. + +If page A inlines page B, which inlines page C, a change to C will cause B +to be updated, but A will not "notice" that this means A needs to be +updated. + +One way to look at this bug is that it's a bug in where dependencies are +recorded when preprocessing the rendered or sidebar page. The current code +does: + + add_depends($params{page}, $somepage); + +Where `$params{page}` is page B. If this is changed to `$params{destpage}`, +then the dependency is added to page A, and updates to C cause it to +change. This does result in the page A's getting lots more dependency info +recorded than before (essentially a copy of all the B's dependency info). + +It's also a fragile, since all plugins that handle dependencies have to be +changed, and do this going forward. And it seems non-obvious that this should +be done. Or really, whether to use `page` or `destpage` there. Currently, +making the "wrong" choice and using `destpage` instead of `page` (which nearly +everything uses) will just result in semi-redundant dependency info being +recorded. If we make destpage mandatory to fix this, goofing up will lead to +this bug coming back. Ugh. + +Another approach to fix it could be to say that anything that causes a +rebuild of B is treated as a change of B. Then when C is changed, B is +rebuilt due to dependencies, and in turn this means A is rebuild because B +"changed". + +This is essentially what is done with wikilinks now, and why, if a sidebar +links to page C, add/remove of C causes all pages to be rebuilt, as seen +here: + + removing old page meep + building sidebar.mdwn, which links to meep + building TourBusStop.mdwn, which depends on sidebar + building contact.mdwn, which depends on sidebar + ... + +The only downside I can see with this approach is that it involves more work. +Does the dep resolver have to keep looping until no new pages are rebuilt? +Seems worth a try to implement this approach. + +--[[Joey]] diff --git a/doc/plugins/sidebar/discussion.mdwn b/doc/plugins/sidebar/discussion.mdwn index 78af3525c..eb441529c 100644 --- a/doc/plugins/sidebar/discussion.mdwn +++ b/doc/plugins/sidebar/discussion.mdwn @@ -1,3 +1,5 @@ > Warning: Any change to the sidebar will cause a rebuild of the whole wiki, since every page includes a copy that has to be updated. This can especially be a problem if the sidebar includes inline or map directives, since any changes to pages inlined or mapped onto the sidebar will change the sidebar and cause a full wiki rebuild. I tried exactly that, namely having an inline in my sidebar to include an rss feed from some other side. I think the complete wiki rebuild should be doable every few days when a new article appears in that feed. But contrary to that warning there is no complete wiki rebuild, only the sidebar page is rebuilt by the "ikiwiki --aggregate" from cron. Is that a bug or a feature? + +> It's a bug, discussed in [[bugs/transitive_dependencies]]. --[[Joey]] diff --git a/doc/todo/tracking_bugs_with_dependencies.mdwn b/doc/todo/tracking_bugs_with_dependencies.mdwn index bfdbf0875..3894df5f6 100644 --- a/doc/todo/tracking_bugs_with_dependencies.mdwn +++ b/doc/todo/tracking_bugs_with_dependencies.mdwn @@ -472,10 +472,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W >>>>> possibly by adding a dependency of the second type along with the dependency of the first type. >>>>>> An example of the current system not tracking enough data is ->>>>>> where A inlines B which inlines C. A change to C will cause B to ->>>>>> rebuild, but A will not "notice" that B has implicitly changed. ->>>>>> That example suggests it might be fixable without explicitly storing ->>>>>> data, by causing a rebuild of B to be treated as a change to B. +>>>>>> described in [[bugs/transitive_dependencies]]. >>>>>> --[[Joey]] >>>>> The second type of dependency is a little more tricky. For each page, we'd need a list of pagespecs that -- cgit v1.2.3 From 6e133959bc69877459fec2ea32788d0656b92168 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 2 Oct 2009 18:47:15 -0400 Subject: fix wording here too --- doc/plugins/pagetemplate.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/pagetemplate.mdwn b/doc/plugins/pagetemplate.mdwn index afd5eb500..53f069d0d 100644 --- a/doc/plugins/pagetemplate.mdwn +++ b/doc/plugins/pagetemplate.mdwn @@ -2,8 +2,8 @@ [[!tag type/chrome]] This plugin provides the [[ikiwiki/directive/pagetemplate]] -[[ikiwiki/directive]], which allows a page to be created using a different -[[template|wikitemplates]]. +[[ikiwiki/directive]], which allows a page to be displayed +using a different [[template|wikitemplates]] than the default. This plugin can only use templates that are already installed in `/usr/share/ikiwiki/templates` (or wherever ikiwiki is configured to look for -- cgit v1.2.3 From fd9d9680242c0d1c835fc56f969f8e2a2618a5de Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 3 Oct 2009 15:37:57 -0400 Subject: document add_depends dependency type interface --- doc/plugins/write.mdwn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 668f8d8b6..c244c1f2f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -609,10 +609,17 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -#### `add_depends($$)` +#### `add_depends($$;@)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. +Additional named parameters can be passed, to indicate what type of +dependency this is. + +Currently, only a "content" parameter is specified. If set to 0, the +dependency does not involve the content of pages matching the PageSpec, but +only their existence. + #### `pagespec_match($$;@)` Passed a page name, and [[ikiwiki/PageSpec]], returns true if the -- cgit v1.2.3 From a8af271e5aed1c4aef3f66cee0847d609aedc705 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Oct 2009 16:28:14 -0400 Subject: document effect of contentless dependencies on sidebar efficiency --- doc/plugins/sidebar.mdwn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/sidebar.mdwn b/doc/plugins/sidebar.mdwn index 36982eff3..4e356d65a 100644 --- a/doc/plugins/sidebar.mdwn +++ b/doc/plugins/sidebar.mdwn @@ -16,6 +16,10 @@ will turn off the sidebar altogether. Warning: Any change to the sidebar will cause a rebuild of the whole wiki, since every page includes a copy that has to be updated. This can -especially be a problem if the sidebar includes [[inline]] or [[map]] -directives, since any changes to pages inlined or mapped onto the sidebar +especially be a problem if the sidebar includes an [[ikiwiki/directive/inline]] +directive, since any changes to pages inlined into the sidebar will change the sidebar and cause a full wiki rebuild. + +Instead, if you include a [[ikiwiki/directive/map]] directive on the sidebar, +and it does not use the `show` parameter, only adding or removing pages +included in the map will cause a full rebuild. Modifying pages will not. -- cgit v1.2.3 From be032a7b87d1080f1a54327346cb5b40432a056c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Oct 2009 20:30:21 -0400 Subject: rework dependency types code Simplify, change default content depends number to 1, change interface to make more sense. --- IkiWiki.pm | 35 +++++++++++++++-------------------- IkiWiki/Plugin/calendar.pm | 18 +++++++++--------- IkiWiki/Plugin/edittemplate.pm | 2 +- IkiWiki/Plugin/listdirectives.pm | 2 +- IkiWiki/Plugin/meta.pm | 2 +- IkiWiki/Plugin/pagecount.pm | 4 ++-- IkiWiki/Plugin/postsparkline.pm | 2 +- IkiWiki/Plugin/progress.pm | 4 ++-- IkiWiki/Render.pm | 28 +++++++++++++--------------- doc/plugins/write.mdwn | 15 +++++++++------ ikiwiki-transition | 2 +- 11 files changed, 55 insertions(+), 59 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 5e5dc739d..c1d07531e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -29,8 +29,8 @@ our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE our $installdir='/usr'; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE # Page dependency types. -our $DEPEND_EXISTS=1; -our $DEPEND_CONTENT=2; +our $DEPEND_CONTENT=1; +our $DEPEND_PRESENCE=2; # Optimisation. use Memoize; @@ -1540,13 +1540,13 @@ sub loadindex () { if (exists $d->{dependslist}) { # old format $depends{$page}={ - map { $_ => $DEPEND_CONTENT | $DEPEND_EXISTS } + map { $_ => $DEPEND_CONTENT } @{$d->{dependslist}} }; } elsif (exists $d->{depends} && ! ref $d->{depends}) { # old format - $depends{$page}={$d->{depends} => $DEPEND_CONTENT | $DEPEND_EXISTS}; + $depends{$page}={$d->{depends} => $DEPEND_CONTENT }; } elsif (exists $d->{depends}) { $depends{$page}=$d->{depends}; @@ -1771,16 +1771,23 @@ sub add_depends ($$;@) { my $page=shift; my $pagespec=shift; + # Is the pagespec a simple page name? my $simple=$pagespec =~ /$config{wiki_file_regexp}/ && $pagespec !~ /[\s*?()!]/; - my $deptype=$DEPEND_CONTENT | $DEPEND_EXISTS; + my $deptype=$DEPEND_CONTENT; if (@_) { my %params=@_; - if (defined $params{content} && $params{content} == 0 && - ($simple || pagespec_contentless($pagespec))) { - $deptype=$deptype & ~$DEPEND_CONTENT; + + # Is the pagespec limited to terms that will continue + # to match pages as long as those pages exist? + my $limited=1; + while ($limited && $pagespec=~m/(\w+)\([^\)]*\)/g) { + $limited = $1 =~ /^(glob|internal|creation_month|creation_day|creation_year|created_before|created_after)$/; } + + $deptype=$deptype & ~$DEPEND_CONTENT & $DEPEND_PRESENCE + if $params{presence} && $limited; } if ($simple) { @@ -1976,18 +1983,6 @@ sub pagespec_valid ($) { return ! $@; } -sub pagespec_contentless ($) { - my $spec=shift; - - while ($spec=~m{ - (\w+)\([^\)]*\) # only match pagespec functions - }igx) { - return 0 unless $1=~/^(glob|internal|creation_month|creation_day|creation_year|created_before|created_after)$/; - } - - return 1; -} - sub glob2re ($) { my $re=quotemeta(shift); $re=~s/\\\*/.*/g; diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index a5cc20882..a1117992a 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -105,21 +105,21 @@ sub format_month (@) { linktext => " $monthname "); } add_depends($params{page}, "$archivebase/$year/".sprintf("%02d", $month), - content => 0); + presence => 1); if (exists $cache{$pagespec}{"$pyear/$pmonth"}) { $purl = htmllink($params{page}, $params{destpage}, "$archivebase/$pyear/" . sprintf("%02d", $pmonth), linktext => " $pmonthname "); } add_depends($params{page}, "$archivebase/$pyear/".sprintf("%02d", $pmonth), - content => 0); + presence => 1); if (exists $cache{$pagespec}{"$nyear/$nmonth"}) { $nurl = htmllink($params{page}, $params{destpage}, "$archivebase/$nyear/" . sprintf("%02d", $nmonth), linktext => " $nmonthname "); } add_depends($params{page}, "$archivebase/$nyear/".sprintf("%02d", $nmonth), - content => 0); + presence => 1); # Start producing the month calendar $calendar=< 0); + add_depends($params{page}, $params{pages}, presence => 1); # Explicitly add all currently linked pages as dependencies, so # that if they are removed, the calendar will be sure to be updated. foreach my $p (@list) { - add_depends($params{page}, $p, content => 0); + add_depends($params{page}, $p, presence => 1); } return $calendar; @@ -249,19 +249,19 @@ sub format_year (@) { "$archivebase/$year", linktext => "$year"); } - add_depends($params{page}, "$archivebase/$year", content => 0); + add_depends($params{page}, "$archivebase/$year", presence => 1); if (exists $cache{$pagespec}{"$pyear"}) { $purl = htmllink($params{page}, $params{destpage}, "$archivebase/$pyear", linktext => "\←"); } - add_depends($params{page}, "$archivebase/$pyear", content => 0); + add_depends($params{page}, "$archivebase/$pyear", presence => 1); if (exists $cache{$pagespec}{"$nyear"}) { $nurl = htmllink($params{page}, $params{destpage}, "$archivebase/$nyear", linktext => "\→"); } - add_depends($params{page}, "$archivebase/$nyear", content => 0); + add_depends($params{page}, "$archivebase/$nyear", presence => 1); # Start producing the year calendar $calendar=<$monthabbr\n}; } - add_depends($params{page}, "$archivebase/$year/$mtag", content => 0); + add_depends($params{page}, "$archivebase/$year/$mtag", presence => 1); $calendar.=qq{\t\n} if ($month % $params{months_per_row} == 0); } diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 89d450725..2dd1dbe68 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -58,7 +58,7 @@ sub preprocess (@) { $pagestate{$params{page}}{edittemplate}{$params{match}}=$link; return "" if ($params{silent} && IkiWiki::yesno($params{silent})); - add_depends($params{page}, $link, content => 0); + add_depends($params{page}, $link, presence => 1); return sprintf(gettext("edittemplate %s registered for %s"), htmllink($params{page}, $params{destpage}, $link), $params{match}); diff --git a/IkiWiki/Plugin/listdirectives.pm b/IkiWiki/Plugin/listdirectives.pm index 96150f986..4023ed7d7 100644 --- a/IkiWiki/Plugin/listdirectives.pm +++ b/IkiWiki/Plugin/listdirectives.pm @@ -84,7 +84,7 @@ sub preprocess (@) { foreach my $plugin (@pluginlist) { $result .= '
  • '; my $link=linkpage($config{directive_description_dir}."/".$plugin); - add_depends($params{page}, $link, content => 0); + add_depends($params{page}, $link, presence => 1); $result .= htmllink($params{page}, $params{destpage}, $link); $result .= '
  • '; } diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index eef3013a0..9b041a748 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -195,7 +195,7 @@ sub preprocess (@) { if (! length $link) { error gettext("redir page not found") } - add_depends($page, $link, content => 0); + add_depends($page, $link, presence => 1); $value=urlto($link, $page); $value.='#'.$redir_anchor if defined $redir_anchor; diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index 17eda0618..80561350b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -23,8 +23,8 @@ sub preprocess (@) { $params{pages}="*" unless defined $params{pages}; # Needs to update count whenever a page is added or removed, so - # register a contentless dependency. - add_depends($params{page}, $params{pages}, content => 0); + # register a presence dependency. + add_depends($params{page}, $params{pages}, presence => 1); my @pages; if ($params{pages} eq "*") { diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index 694d39575..3205958d4 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -48,7 +48,7 @@ sub preprocess (@) { error gettext("unknown formula"); } - add_depends($params{page}, $params{pages}, content => 0); + add_depends($params{page}, $params{pages}, presence => 1); my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } pagespec_match_list( diff --git a/IkiWiki/Plugin/progress.pm b/IkiWiki/Plugin/progress.pm index 3b664f4cb..26c537a84 100644 --- a/IkiWiki/Plugin/progress.pm +++ b/IkiWiki/Plugin/progress.pm @@ -36,8 +36,8 @@ sub preprocess (@) { $fill.="%"; } elsif (defined $params{totalpages} and defined $params{donepages}) { - add_depends($params{page}, $params{totalpages}, content => 0); - add_depends($params{page}, $params{donepages}, content => 0); + add_depends($params{page}, $params{totalpages}, presence => 1); + add_depends($params{page}, $params{donepages}, presence => 1); my @pages=keys %pagesources; my $totalcount=0; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 3fc750925..cf0c3fe08 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -473,13 +473,11 @@ sub refresh () { if (exists $depends_simple{$p}) { foreach my $d (keys %{$depends_simple{$p}}) { - if ($depends_simple{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - if (exists $lc_exists_changed{$d}) { - $reason = $d; - last; - } - } - elsif (exists $lc_changed{$d}) { + if (($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT && + exists $lc_changed{$d}) + || + ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_PRESENCE && + exists $lc_exists_changed{$d})) { $reason = $d; last; } @@ -492,22 +490,22 @@ sub refresh () { next if $@ || ! defined $sub; my @candidates; - if ($depends{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - @candidates=@exists_changed; - } - else { + if ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT) { @candidates=@changed; } + elsif ($depends{$p}{$d} & $IkiWiki::DEPEND_PRESENCE) { + @candidates=@exists_changed; + } # only consider internal files # if the page explicitly depends # on such files if ($d =~ /internal\(/) { - if ($depends{$p}{$d} == $IkiWiki::DEPEND_EXISTS) { - push @candidates, @internal; - } - else { + if ($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT) { push @candidates, @internal, @internal_change; } + elsif ($depends{$p}{$d} & $IkiWiki::DEPEND_PRESENCE) { + push @candidates, @internal; + } } foreach my $file (@candidates) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index c244c1f2f..73db6f12a 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -613,12 +613,15 @@ generating a link to a page. Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. -Additional named parameters can be passed, to indicate what type of -dependency this is. - -Currently, only a "content" parameter is specified. If set to 0, the -dependency does not involve the content of pages matching the PageSpec, but -only their existence. +By default, dependencies are full content dependencies, meaning that the +page will be updated whenever anything matching the PageSpec is modified. +This default can be overridden by additional named parameters, which can be +used to indicate weaker types of dependencies: + +* `presence` if set to true, only the presence of a matching page triggers + the dependency. +* `links` if set to true, any change in the text of links on a matching page + triggers the dependency #### `pagespec_match($$;@)` diff --git a/ikiwiki-transition b/ikiwiki-transition index c50a748e8..1bebb1176 100755 --- a/ikiwiki-transition +++ b/ikiwiki-transition @@ -299,7 +299,7 @@ sub oldloadindex { $pagemtime{$page}=$items{mtime}[0]; $oldlinks{$page}=[@{$items{link}}]; $links{$page}=[@{$items{link}}]; - $depends{$page}={ $items{depends}[0] => $IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_EXISTS } if exists $items{depends}; + $depends{$page}={ $items{depends}[0] => $IkiWiki::DEPEND_CONTENT } if exists $items{depends}; $destsources{$_}=$page foreach @{$items{dest}}; $renderedfiles{$page}=[@{$items{dest}}]; $pagecase{lc $page}=$page; -- cgit v1.2.3 From c6bf4228d5c988e715ff08a9374b72ce054daa2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 15:01:05 -0400 Subject: make links dependencies fire if broken links change --- IkiWiki/Render.pm | 41 ++++++++++++++++++++++++++++------------- doc/plugins/write.mdwn | 6 ++++-- 2 files changed, 32 insertions(+), 15 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 4e8aae3bc..599bb26e2 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -63,24 +63,39 @@ sub find_changed_links (@_) { my %linkchangers; foreach my $file (@_) { my $page=pagename($file); - + if (exists $links{$page}) { - foreach my $link (map { bestlink($page, $_) } @{$links{$page}}) { - if (length $link && - (! exists $oldlinks{$page} || - ! grep { bestlink($page, $_) eq $link } @{$oldlinks{$page}})) { - $linkchanged{$link}=1; - $linkchangers{lc($page)}=1; + foreach my $l (@{$links{$page}}) { + my $link=bestlink($page, $l); + if (length $link) { + if (! exists $oldlinks{$page} || + ! grep { bestlink($page, $_) eq $link } @{$oldlinks{$page}}) { + $linkchanged{$link}=1; + $linkchangers{lc($page)}=1; + } + } + else { + if (! grep { lc $_ eq lc $l } @{$oldlinks{$page}}) { + $linkchangers{lc($page)}=1 + } } + } } if (exists $oldlinks{$page}) { - foreach my $link (map { bestlink($page, $_) } @{$oldlinks{$page}}) { - if (length $link && - (! exists $links{$page} || - ! grep { bestlink($page, $_) eq $link } @{$links{$page}})) { - $linkchanged{$link}=1; - $linkchangers{lc($page)}=1; + foreach my $l (@{$oldlinks{$page}}) { + my $link=bestlink($page, $l); + if (length $link) { + if (! exists $links{$page} || + ! grep { bestlink($page, $_) eq $link } @{$links{$page}}) { + $linkchanged{$link}=1; + $linkchangers{lc($page)}=1; + } + } + else { + if (! grep { lc $_ eq lc $l } @{$links{$page}}) { + $linkchangers{lc($page)}=1 + } } } } diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 73db6f12a..133030f08 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -620,8 +620,10 @@ used to indicate weaker types of dependencies: * `presence` if set to true, only the presence of a matching page triggers the dependency. -* `links` if set to true, any change in the text of links on a matching page - triggers the dependency +* `links` if set to true, any change to links on a matching page + triggers the dependency. This includes when a link is added, removed, + or changes what it points to due to other changes. It does not include + the addition or removal of a duplicate link. #### `pagespec_match($$;@)` -- cgit v1.2.3 From fc864515b857694da6752879edeb2f82fd12e3a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 15:16:14 -0400 Subject: omit forum and javascript from list --- doc/plugins/orphans.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/orphans.mdwn b/doc/plugins/orphans.mdwn index ea7c4df13..8c0d0b933 100644 --- a/doc/plugins/orphans.mdwn +++ b/doc/plugins/orphans.mdwn @@ -10,5 +10,6 @@ Here's a list of orphaned pages on this wiki: [[!orphans pages="* and !news/* and !todo/* and !bugs/* and !users/* and !recentchanges and !examples/* and !tips/* and !sandbox/* and !templates/* and +!forum/* and !*.js !wikiicons/* and !plugins/*"]] """]] -- cgit v1.2.3 From dc6fab3824c9848cdaf8b252253d690f96573d25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 15:17:36 -0400 Subject: syntax --- doc/plugins/orphans.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/orphans.mdwn b/doc/plugins/orphans.mdwn index 8c0d0b933..e403c2d18 100644 --- a/doc/plugins/orphans.mdwn +++ b/doc/plugins/orphans.mdwn @@ -10,6 +10,6 @@ Here's a list of orphaned pages on this wiki: [[!orphans pages="* and !news/* and !todo/* and !bugs/* and !users/* and !recentchanges and !examples/* and !tips/* and !sandbox/* and !templates/* and -!forum/* and !*.js +!forum/* and !*.js and !wikiicons/* and !plugins/*"]] """]] -- cgit v1.2.3 From f7d04d106721a6bff6dfd4a0a7aa162cd2ce5536 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 15:26:15 -0400 Subject: switch plugins page to use a map instead of an inline A map just seems a better fit for reference, since it deliniates the contrib plugins better, and orders better. It also has the advantage of being less expensive, since the plugins page does not need to update when eg, the pagecount page changes. Only downside is, no rss feed of new plugins. Which I know a few people were subscribed to. --- doc/plugins.mdwn | 6 ++---- doc/plugins/contrib.mdwn | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins.mdwn b/doc/plugins.mdwn index 527568208..bd7ee538b 100644 --- a/doc/plugins.mdwn +++ b/doc/plugins.mdwn @@ -13,7 +13,5 @@ will fit most uses of ikiwiki. ## Plugin directory -[[!inline pages="plugins/* and !plugins/type/* and !plugins/write and -!plugins/write/* and !plugins/contrib and !plugins/install and !*/Discussion" -feedpages="created_after(plugins/graphviz)" archive="yes" sort=title -rootpage="plugins/contrib" postformtext="Add a new plugin named:" show=0]] +[[!map pages="plugins/* and !plugins/type/* and !plugins/write and +!plugins/write/* and !plugins/contrib and !plugins/install and !*/Discussion"]] diff --git a/doc/plugins/contrib.mdwn b/doc/plugins/contrib.mdwn index a03e6a95d..ac6c1b751 100644 --- a/doc/plugins/contrib.mdwn +++ b/doc/plugins/contrib.mdwn @@ -1,6 +1,4 @@ These plugins are provided by third parties and are not currently included in ikiwiki. See [[install]] for installation help. -[[!inline pages="plugins/contrib/* and !*/Discussion" -feedpages="created_after(plugins/contrib/navbar)" archive="yes" -rootpage="plugins/contrib" postformtext="Add a new plugin named:" show=0]] +[[!map pages="plugins/contrib/* and !*/Discussion"]] -- cgit v1.2.3 From 3a188c047b4fed29865e7516f3b208901b22161d Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 5 Oct 2009 16:08:19 -0400 Subject: thoughts about renaming the actual images to .albumimage --- doc/plugins/contrib/album/discussion.mdwn | 127 ++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 5fb91c5a4..a613bb2d2 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -61,21 +61,59 @@ code or tried it yet, but here goes. --[[Joey]] seems like it will become a pain. Everyone will need to come up with their own automation for it, and then there's the question of how to automate it when uploading attachments. + +> There's already a script (ikiwiki-album) to populate a git +> checkout with skeleton "viewer" pages; I was planning to make a +> specialized CGI interface for albums after getting feedback from +> you (since the requirements for that CGI interface change depending +> on the implementation). I agree that this is ugly, though. -s + * With each viewer page having next/prev links, I can see how you were having the scalability issues with ikiwiki's data structures earlier! + +> Yeah, I think they're a basic requirement from a UI point of view +> though (although they don't necessarily have to be full wikilinks). +> -s + * And doesn't each viewer page really depend on every other page in the same albumsection? If a new page is added, the next/prev links may need to be updated, for example. If so, there will be much unnecessary rebuilding. + +> albumsections are just a way to insert headings into the flow of +> photos, so they don't actually affect dependencies. +> +> One non-obvious constraint of ikiwiki's current design is that +> everything "off-page" necessary to build any page has to happen +> at scan time, which has caused a few strange design decisions, +> like the fact that each viewer controls what album it's in. +> +> It's difficult for the contents of the album to just be a +> pagespec, like for inline, because pagespecs can depend on +> metadata, which is gathered in arbitrary order at scan time; +> so the earliest you can safely apply a pagespec to the wiki +> contents to get a concrete list of pages is at rebuild time. +> +> (This stalled my attempt at a trail plugin, too.) -s + * One thing I do like about having individual pages per image is that they can each have their own comments, etc. + +> Yes; also, they can be wikilinked. I consider those to be +> UI requirements. -s + * Seems possibly backwards that the albumimage controls what album an image appears in. Two use cases -- 1: I may want to make a locked album, but then anyone who can write to any other page on the wiki can add an image to it. 2: I may want an image to appear in more than one album. Think tags. So it seems it would be better to have the album directive control what pages it includes (a la inline). + +> See note above about pagespecs not being very safe early on. +> You did merge my inline-with-pagenames feature, which is safe to use +> at scan time, though. + * Putting a few of the above thoughts together, my ideal album system seems to be one where I can just drop the images into a directory and have them appear in the album index, as well as each generate their own wiki @@ -84,3 +122,92 @@ code or tried it yet, but here goes. --[[Joey]] themselves.) This is almost pointing toward making the images first-class wiki page sources. Hey, it worked for po! :) But the metadata and editing problems probably don't really allow that. + +> Putting a JPEG in the web form is not an option from my point of +> view :-) but perhaps there could just be a "web-editable" flag supplied +> by plugins, and things could be changed to respect it. +> +> In a way, what you really want for metadata is to have it in the album +> page, so you can batch-edit the whole lot by editing one file (this +> does mean that editing the album necessarily causes each of its viewers +> to be rebuilt, but in practice that happens anyway). -s + +---- + +Trying to use the "special extension" design: + +Suppose that each viewer is a JPEG-or-GIF-or-something, with extension +".albumimage". We have a gallery "memes" with three images, badger, +mushroom and snake. + +Files in git repo: + +* index.mdwn +* memes.mdwn +* memes/badger.albumimage (a renamed JPEG) +* memes/badger/comment_1._comment +* memes/badger/comment_2._comment +* memes/mushroom.albumimage (a renamed GIF) +* memes/mushroom.meta (sidecar file with metadata) +* memes/snake.albumimage (a renamed video) + +Files in web content: + +* index.html +* memes/index.html +* memes/96x96-badger.jpg (from img) +* memes/96x96-mushroom.jpg (from img) +* memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) ) +* memes/badger/index.html (including comments) +* memes/badger.jpg +* memes/mushroom/index.html +* memes/mushroom.gif +* memes/snake/index.html +* memes/snake.mov + +ispage("memes/badger") (etc.) must be true, to make the above rendering +happen, so albumimage needs to be a "page" extension. + +To not confuse other plugins, album should probably have a filter() hook +that turns .albumimage files into HTML? That'd probably be a reasonable +way to get them rendered anyway. + +do=edit&page=memes/badger needs to not put the JPG in a text box: somehow +divert or override the normal edit CGI by telling it that .albumimage +files are not editable in the usual way? + +Every image needs to depend on, and link to, the next and previous images, +which is a bit tricky. In previous thinking about this I'd been applying +the overly strict constraint that the ordered sequence of pages in each +album must be known at scan time. However, that's not *necessarily* needed: +the album and each photo could collect an unordered superset of dependencies +at scan time, and at rebuild time that could be refined to be the exact set, +in order. Perhaps restricting to "the images in an album A must match A/*" +would be useful; then the unordered superset could just be "A/*". Your +"albums via tags" idea would be nice too though, particularly for feature +parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()" +maybe? + +If images are allowed to be considered to be part of more than one album, +then a pretty and usable UI becomes harder - "next/previous" expands into +"next photo in holidays/2009/germany / next photo in tagged/smcv / ..." +and it could get quite hard to navigate. Perhaps next/previous links could +be displayed only for the closest ancestor (in URL space) that is an +album, or something? + +Requiring renaming is awkward for non-technical Windows/Mac users, with both +platforms' defaults being to hide extensions; however, this could be +circumvented by adding some sort of hook in attachment to turn things into +a .albumimage at upload time, and declaring that using git/svn/... without +extensions visible is a "don't do that then" situation :-) + +Ideally attachment could also be configured to upload into a specified +underlay, so that photos don't have to be in your source-code control +(you might want that, but I don't!). + +Things that would be nice, and are probably possible: + +* make the "Edit page" link on viewers divert to album-specific CGI instead + of just failing or not appearing +* some way to deep-link to memes/badger.jpg with a wikilink, without knowing a + priori that it's secretly a JPEG -- cgit v1.2.3 From 786dcf15c4117f9ae6b000318ac9809399df4d69 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Oct 2009 16:47:12 -0400 Subject: responses, questions, ideas --- doc/plugins/contrib/album/discussion.mdwn | 45 ++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index a613bb2d2..5c8e74fa6 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -76,6 +76,12 @@ code or tried it yet, but here goes. --[[Joey]] > though (although they don't necessarily have to be full wikilinks). > -s +>> I think that with the new dependency types system, the dependencies for +>> these can be presence dependencies, which will probably help with +>> avoiding rebuilds of a page if the next/prev page is changed. +>> (Unless you use img to make the thumbnails for those links, then it +>> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]] + * And doesn't each viewer page really depend on every other page in the same albumsection? If a new page is added, the next/prev links may need to be updated, for example. If so, there will be much @@ -97,6 +103,11 @@ code or tried it yet, but here goes. --[[Joey]] > > (This stalled my attempt at a trail plugin, too.) -s +>> Not sure I understand why these need to look at pagespecs at scan time? +>> Also, note that it is fairly doable to detect if a pagespec uses such +>> metadata. Er, I mean, I have a cheezy hack in `add_depends` now that does +>> it to deal with a similar case. --[[Joey]] + * One thing I do like about having individual pages per image is that they can each have their own comments, etc. @@ -131,6 +142,15 @@ code or tried it yet, but here goes. --[[Joey]] > page, so you can batch-edit the whole lot by editing one file (this > does mean that editing the album necessarily causes each of its viewers > to be rebuilt, but in practice that happens anyway). -s +> +>> Yes, that would make some sense.. It also allows putting one image in +>> two albums, with different caption etc. (Maybe for different audiences.) +>> +>> It would probably be possible to add a new dependency type, and thus +>> make ikiwiki smart about noticing whether the metadata has actually +>> changed, and only update those viewers where it has. But the dependency +>> type stuff is still very new, and not plugin friendly .. so only just +>> possible, --[[Joey]] ---- @@ -140,6 +160,10 @@ Suppose that each viewer is a JPEG-or-GIF-or-something, with extension ".albumimage". We have a gallery "memes" with three images, badger, mushroom and snake. +> An alternative might be to use ".album.jpg", and ".album.gif" +> etc as the htmlize extensions. May need some fixes to ikiwiki to support +> that. --[[Joey]] + Files in git repo: * index.mdwn @@ -172,6 +196,10 @@ To not confuse other plugins, album should probably have a filter() hook that turns .albumimage files into HTML? That'd probably be a reasonable way to get them rendered anyway. +> I guess that is needed to avoid preprocess, scan, etc trying to process +> the image, as well as eg, smiley trying to munge it in sanitize. +> --[[Joey]] + do=edit&page=memes/badger needs to not put the JPG in a text box: somehow divert or override the normal edit CGI by telling it that .albumimage files are not editable in the usual way? @@ -182,7 +210,14 @@ the overly strict constraint that the ordered sequence of pages in each album must be known at scan time. However, that's not *necessarily* needed: the album and each photo could collect an unordered superset of dependencies at scan time, and at rebuild time that could be refined to be the exact set, -in order. Perhaps restricting to "the images in an album A must match A/*" +in order. + +> Why do you need to collect this info at scan time? You can determine it +> at build time via `pagespec_match_list`, surely .. maybe with some +> memoization to avoid each image in an album building the same list. +> I sense that I may be missing a subtelty though. --[[Joey]] + +Perhaps restricting to "the images in an album A must match A/*" would be useful; then the unordered superset could just be "A/*". Your "albums via tags" idea would be nice too though, particularly for feature parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()" @@ -195,12 +230,20 @@ and it could get quite hard to navigate. Perhaps next/previous links could be displayed only for the closest ancestor (in URL space) that is an album, or something? +> Ugh, yeah, that is a problem. Perhaps wanting to support that was just +> too ambitious. --[[Joey]] + Requiring renaming is awkward for non-technical Windows/Mac users, with both platforms' defaults being to hide extensions; however, this could be circumvented by adding some sort of hook in attachment to turn things into a .albumimage at upload time, and declaring that using git/svn/... without extensions visible is a "don't do that then" situation :-) +> Or extend `pagetype` so it can do the necessary matching without +> renaming. Maybe by allowing a subdirectory to be specified along +> with an extension. (Or allow specifying a full pagespec, +> but I hesitate to seriously suggest that.) --[[Joey]] + Ideally attachment could also be configured to upload into a specified underlay, so that photos don't have to be in your source-code control (you might want that, but I don't!). -- cgit v1.2.3 From 4528b95d2562831208d490ef378a089631000767 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Oct 2009 18:06:49 -0400 Subject: mention that pagespec_match returns an overloaded value --- doc/plugins/write.mdwn | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 668f8d8b6..8e8c3311e 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -609,15 +609,31 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -#### `add_depends($$)` +#### `add_depends($$;@)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. +By default, dependencies are full content dependencies, meaning that the +page will be updated whenever anything matching the PageSpec is modified. +This default can be overridden by additional named parameters, which can be +used to indicate weaker types of dependencies: + +* `presence` if set to true, only the presence of a matching page triggers + the dependency. +* `links` if set to true, any change to links on a matching page + triggers the dependency. This includes when a link is added, removed, + or changes what it points to due to other changes. It does not include + the addition or removal of a duplicate link. + #### `pagespec_match($$;@)` -Passed a page name, and [[ikiwiki/PageSpec]], returns true if the +Passed a page name, and [[ikiwiki/PageSpec]], returns a true value if the [[ikiwiki/PageSpec]] matches the page. +Note that the return value is overloaded. If stringified, it will be a +message indicating why the PageSpec succeeded, or failed, to match the +page. + Additional named parameters can be passed, to further limit the match. The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match -- cgit v1.2.3 From 4002d7c1a4657e769b036c6e76106991ec5c3897 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Oct 2009 20:31:13 -0400 Subject: add influence info to match_* Also update docs, test suite. --- IkiWiki.pm | 24 ++++++++++++------------ IkiWiki/Plugin/meta.pm | 8 ++++---- debian/changelog | 2 ++ doc/plugins/write.mdwn | 7 +++++++ t/pagespec_match.t | 15 +++++++++++++-- 5 files changed, 38 insertions(+), 18 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 73d2a9763..9c386e154 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2039,7 +2039,7 @@ use overload ( sub new { my $class = shift; my $value = shift; - return bless [$value, {@_}], $class; + return bless [$value, {map { $_ => 1 } @_}], $class; } sub influences { @@ -2099,23 +2099,23 @@ sub match_link ($$;@) { my $from=exists $params{location} ? $params{location} : ''; my $links = $IkiWiki::links{$page}; - return IkiWiki::FailReason->new("$page has no links") unless $links && @{$links}; + return IkiWiki::FailReason->new("$page has no links", $link) unless $links && @{$links}; my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { if (length $bestlink) { - return IkiWiki::SuccessReason->new("$page links to $link") + return IkiWiki::SuccessReason->new("$page links to $link", $page) if $bestlink eq IkiWiki::bestlink($page, $p); } else { - return IkiWiki::SuccessReason->new("$page links to page $p matching $link") + return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page) if match_glob($p, $link, %params); my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link") + return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page) if match_glob($p_rel, $link, %params); } } - return IkiWiki::FailReason->new("$page does not link to $link"); + return IkiWiki::FailReason->new("$page does not link to $link", $page); } sub match_backlink ($$;@) { @@ -2131,14 +2131,14 @@ sub match_created_before ($$;@) { if (exists $IkiWiki::pagectime{$testpage}) { if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) { - return IkiWiki::SuccessReason->new("$page created before $testpage"); + return IkiWiki::SuccessReason->new("$page created before $testpage", $testpage); } else { - return IkiWiki::FailReason->new("$page not created before $testpage"); + return IkiWiki::FailReason->new("$page not created before $testpage", $testpage); } } else { - return IkiWiki::ErrorReason->new("$testpage does not exist"); + return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage); } } @@ -2151,14 +2151,14 @@ sub match_created_after ($$;@) { if (exists $IkiWiki::pagectime{$testpage}) { if ($IkiWiki::pagectime{$page} > $IkiWiki::pagectime{$testpage}) { - return IkiWiki::SuccessReason->new("$page created after $testpage"); + return IkiWiki::SuccessReason->new("$page created after $testpage", $testpage); } else { - return IkiWiki::FailReason->new("$page not created after $testpage"); + return IkiWiki::FailReason->new("$page not created after $testpage", $testpage); } } else { - return IkiWiki::ErrorReason->new("$testpage does not exist"); + return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage); } } diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 9b041a748..a8ee5bc85 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -291,21 +291,21 @@ sub match { if (defined $val) { if ($val=~/^$re$/i) { - return IkiWiki::SuccessReason->new("$re matches $field of $page"); + return IkiWiki::SuccessReason->new("$re matches $field of $page", $page); } else { - return IkiWiki::FailReason->new("$re does not match $field of $page"); + return IkiWiki::FailReason->new("$re does not match $field of $page", $page); } } else { - return IkiWiki::FailReason->new("$page does not have a $field"); + return IkiWiki::FailReason->new("$page does not have a $field", $page); } } package IkiWiki::PageSpec; sub match_title ($$;@) { - IkiWiki::Plugin::meta::match("title", @_); + IkiWiki::Plugin::meta::match("title", @_); } sub match_author ($$;@) { diff --git a/debian/changelog b/debian/changelog index dc6ee0a81..565a0cffa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,8 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low * Transitive dependencies are now correctly supported. * Rebuild wikis on upgrade to this version to get improved dependency info. + * Plugins providing PageSpec `match_*` functions should pass additional + influence information when creating result objects. -- Joey Hess Sun, 27 Sep 2009 17:40:03 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 8e8c3311e..6b47033e5 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -982,6 +982,13 @@ an IkiWiki::FailReason object if the match fails. If the match cannot be attempted at all, for any page, it can instead return an IkiWiki::ErrorReason object explaining why. +When constructing these objects, you should also include a list of any +pages whose contents or other metadata influenced the result of the match. +For example, "backlink(foo)" is influenced by the contents of page foo; +"link(foo)" and "title(bar)" are influenced by the contents of any +page they match; "created_before(foo)" is influenced by the metadata of +foo; while "glob(*)" is not influenced by the contents of any page. + ### Setup plugins The ikiwiki setup file is loaded using a pluggable mechanism. If you look diff --git a/t/pagespec_match.t b/t/pagespec_match.t index a1fcba7c8..f73bfdfe1 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 56; +use Test::More tests => 61; BEGIN { use_ok("IkiWiki"); } @@ -89,6 +89,17 @@ my $ret=pagespec_match("foo", "(invalid"); ok(! $ret, "syntax error"); ok($ret =~ /syntax error/, "error message"); -my $ret=pagespec_match("foo", "bar or foo"); +$ret=pagespec_match("foo", "bar or foo"); ok($ret, "simple match"); is($ret, "foo matches foo", "stringified return"); + +$ret=pagespec_match("foo", "link(bar)"); +is(join(",", $ret->influences), 'foo', "link is influenced by the page with the link"); +$ret=pagespec_match("bar", "backlink(foo)"); +is(join(",", $ret->influences), 'foo', "backlink is influenced by the page with the link"); +$ret=pagespec_match("bar", "backlink(foo)"); +is(join(",", $ret->influences), 'foo', "backlink is influenced by the page with the link"); +$ret=pagespec_match("bar", "created_before(foo)"); +is(join(",", $ret->influences), 'foo', "created_before is influenced by the comparison page"); +$ret=pagespec_match("bar", "created_after(foo)"); +is(join(",", $ret->influences), 'foo', "created_after is influenced by the comparison page"); -- cgit v1.2.3 From 5f9860e65c65aa769f11e550e63cc164b1519710 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Oct 2009 21:48:03 -0400 Subject: add type info to influence information --- IkiWiki.pm | 49 ++++++++++++++++++++++++++++++------------------- IkiWiki/Plugin/meta.pm | 6 +++--- doc/plugins/write.mdwn | 6 +++--- docwiki.setup | 2 +- t/add_depends.t | 14 +++++++------- t/pagespec_match.t | 32 ++++++++++++++++---------------- 6 files changed, 60 insertions(+), 49 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 7adc63139..39a43ddbe 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1795,8 +1795,10 @@ sub add_depends ($$;@) { return if $@; foreach my $p (keys %pagesources) { my $r=$sub->($p, location => $page ); - map { $depends_simple{$page}{lc $_} |= $DEPEND_CONTENT } $r->influences - if $r; + my %i=$r->influences; + foreach my $i (keys %i) { + $depends_simple{$page}{lc $i} |= $i{$i}; + } } $depends{$page}{$pagespec} |= $deptype; @@ -1998,8 +2000,8 @@ use overload ( '""' => sub { $_[0][0] }, '0+' => sub { 0 }, '!' => sub { bless $_[0], 'IkiWiki::SuccessReason'}, - '&' => sub { $_[0][1]={%{$_[0][1]}, %{$_[1][1]}}; $_[0] }, - '|' => sub { $_[1][1]={%{$_[0][1]}, %{$_[1][1]}}; $_[1] }, + '&' => sub { $_[0]->merge_influences($_[1]); $_[0] }, + '|' => sub { $_[1]->merge_influences($_[0]); $_[1] }, fallback => 1, ); @@ -2011,19 +2013,27 @@ use overload ( '""' => sub { $_[0][0] }, '0+' => sub { 1 }, '!' => sub { bless $_[0], 'IkiWiki::FailReason'}, - '&' => sub { $_[1][1]={%{$_[0][1]}, %{$_[1][1]}}; $_[1] }, - '|' => sub { $_[0][1]={%{$_[0][1]}, %{$_[1][1]}}; $_[0] }, + '&' => sub { $_[1]->merge_influences($_[0]); $_[1] }, + '|' => sub { $_[0]->merge_influences($_[1]); $_[0] }, fallback => 1, ); sub new { my $class = shift; my $value = shift; - return bless [$value, {map { $_ => 1 } @_}], $class; + return bless [$value, {@_}], $class; } sub influences { - return keys %{$_[0][1]}; + return %{$_[0][1]}; +} + +sub merge_influences { + my $this=shift; + my $other=shift; + foreach my $influence (keys %{$other->[1]}) { + $this->[1]{$influence} |= $other->[1]{$influence}; + } } package IkiWiki::ErrorReason; @@ -2079,23 +2089,24 @@ sub match_link ($$;@) { my $from=exists $params{location} ? $params{location} : ''; my $links = $IkiWiki::links{$page}; - return IkiWiki::FailReason->new("$page has no links", $page) unless $links && @{$links}; + return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS) + unless $links && @{$links}; my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { if (length $bestlink) { - return IkiWiki::SuccessReason->new("$page links to $link", $page) + return IkiWiki::SuccessReason->new("$page links to $link", $page => $IkiWiki::DEPEND_LINKS) if $bestlink eq IkiWiki::bestlink($page, $p); } else { - return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page) + return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page => $IkiWiki::DEPEND_LINKS) if match_glob($p, $link, %params); my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page) + return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page => $IkiWiki::DEPEND_LINKS) if match_glob($p_rel, $link, %params); } } - return IkiWiki::FailReason->new("$page does not link to $link", $page); + return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS); } sub match_backlink ($$;@) { @@ -2111,14 +2122,14 @@ sub match_created_before ($$;@) { if (exists $IkiWiki::pagectime{$testpage}) { if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) { - return IkiWiki::SuccessReason->new("$page created before $testpage", $testpage); + return IkiWiki::SuccessReason->new("$page created before $testpage", $testpage => $IkiWiki::DEPEND_PRESENCE); } else { - return IkiWiki::FailReason->new("$page not created before $testpage", $testpage); + return IkiWiki::FailReason->new("$page not created before $testpage", $testpage => $IkiWiki::DEPEND_PRESENCE); } } else { - return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage); + return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage => $IkiWiki::DEPEND_PRESENCE); } } @@ -2131,14 +2142,14 @@ sub match_created_after ($$;@) { if (exists $IkiWiki::pagectime{$testpage}) { if ($IkiWiki::pagectime{$page} > $IkiWiki::pagectime{$testpage}) { - return IkiWiki::SuccessReason->new("$page created after $testpage", $testpage); + return IkiWiki::SuccessReason->new("$page created after $testpage", $testpage => $IkiWiki::DEPEND_PRESENCE); } else { - return IkiWiki::FailReason->new("$page not created after $testpage", $testpage); + return IkiWiki::FailReason->new("$page not created after $testpage", $testpage => $IkiWiki::DEPEND_PRESENCE); } } else { - return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage); + return IkiWiki::ErrorReason->new("$testpage does not exist", $testpage => $IkiWiki::DEPEND_PRESENCE); } } diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index a8ee5bc85..c160e7eba 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -291,14 +291,14 @@ sub match { if (defined $val) { if ($val=~/^$re$/i) { - return IkiWiki::SuccessReason->new("$re matches $field of $page", $page); + return IkiWiki::SuccessReason->new("$re matches $field of $page", $page => $IkiWiki::DEPEND_CONTENT); } else { - return IkiWiki::FailReason->new("$re does not match $field of $page", $page); + return IkiWiki::FailReason->new("$re does not match $field of $page", $page => $IkiWiki::DEPEND_CONTENT); } } else { - return IkiWiki::FailReason->new("$page does not have a $field", $page); + return IkiWiki::FailReason->new("$page does not have a $field", $page => $IkiWiki::DEPEND_CONTENT); } } diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 6b47033e5..232430079 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -982,9 +982,9 @@ an IkiWiki::FailReason object if the match fails. If the match cannot be attempted at all, for any page, it can instead return an IkiWiki::ErrorReason object explaining why. -When constructing these objects, you should also include a list of any -pages whose contents or other metadata influenced the result of the match. -For example, "backlink(foo)" is influenced by the contents of page foo; +When constructing these objects, you should also include information about +of any pages whose contents or other metadata influenced the result of the +match. For example, "backlink(foo)" is influenced by the contents of page foo; "link(foo)" and "title(bar)" are influenced by the contents of any page they match; "created_before(foo)" is influenced by the metadata of foo; while "glob(*)" is not influenced by the contents of any page. diff --git a/docwiki.setup b/docwiki.setup index 52421e501..41c07f024 100644 --- a/docwiki.setup +++ b/docwiki.setup @@ -16,5 +16,5 @@ use IkiWiki::Setup::Standard { userdir => "users", usedirs => 0, prefix_directives => 1, - add_plugins => [qw{goodstuff version haiku polygen fortune}], + add_plugins => [qw{linkmap goodstuff version haiku polygen fortune}], } diff --git a/t/add_depends.t b/t/add_depends.t index d49aa74ce..9f426187b 100755 --- a/t/add_depends.t +++ b/t/add_depends.t @@ -57,17 +57,17 @@ ok($IkiWiki::depends{foo0}{"*"} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_L ok(! ($IkiWiki::depends{foo0}{"*"} & $IkiWiki::DEPEND_PRESENCE)); # Adding a pagespec that requires page metadata should add the influence -# as an explicit content dependency. +# as an explicit dependency. In the case of a link, a links dependency. $links{foo0}=$links{foo9}=[qw{bar baz}]; foreach my $spec ("* and ! link(bar)", "* or link(bar)") { ok(add_depends("foo3", $spec, presence => 1)); ok($IkiWiki::depends{foo3}{$spec} & $IkiWiki::DEPEND_PRESENCE); ok(! ($IkiWiki::depends{foo3}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_LINKS))); - ok($IkiWiki::depends_simple{foo3}{foo3} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo3}{foo3} == $IkiWiki::DEPEND_LINKS); ok(add_depends("foo4", $spec, links => 1)); ok($IkiWiki::depends{foo4}{$spec} & $IkiWiki::DEPEND_LINKS); ok(! ($IkiWiki::depends{foo4}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_PRESENCE))); - ok($IkiWiki::depends_simple{foo4}{foo4} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo4}{foo4} == $IkiWiki::DEPEND_LINKS); } # a pagespec with backlinks() will add as an influence the page with the links @@ -76,20 +76,20 @@ foreach my $spec ("bugs or (backlink(foo0) and !*.png)", "backlink(foo)") { ok(add_depends("foo5", $spec, presence => 1)); ok($IkiWiki::depends{foo5}{$spec} & $IkiWiki::DEPEND_PRESENCE); ok(! ($IkiWiki::depends{foo5}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_LINKS))); - ok($IkiWiki::depends_simple{foo5}{foo0} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo5}{foo0} == $IkiWiki::DEPEND_LINKS); ok(add_depends("foo6", $spec, links => 1)); ok($IkiWiki::depends{foo6}{$spec} & $IkiWiki::DEPEND_LINKS); ok(! ($IkiWiki::depends{foo6}{$spec} & ($IkiWiki::DEPEND_PRESENCE | $IkiWiki::DEPEND_CONTENT))); - ok($IkiWiki::depends_simple{foo5}{foo0} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo5}{foo0} == $IkiWiki::DEPEND_LINKS); ok(add_depends("foo7", $spec, presence => 1, links => 1)); ok($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_PRESENCE); ok($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_LINKS); ok(! ($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_CONTENT)); - ok($IkiWiki::depends_simple{foo7}{foo0} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo7}{foo0} == $IkiWiki::DEPEND_LINKS); ok(add_depends("foo8", $spec)); ok($IkiWiki::depends{foo8}{$spec} & $IkiWiki::DEPEND_CONTENT); ok(! ($IkiWiki::depends{foo8}{$spec} & ($IkiWiki::DEPEND_PRESENCE | $IkiWiki::DEPEND_LINKS))); - ok($IkiWiki::depends_simple{foo8}{foo0} == $IkiWiki::DEPEND_CONTENT); + ok($IkiWiki::depends_simple{foo8}{foo0} == $IkiWiki::DEPEND_LINKS); } # content is the default if unknown types are entered diff --git a/t/pagespec_match.t b/t/pagespec_match.t index 1a0db1cef..36fa04370 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -93,19 +93,19 @@ $ret=pagespec_match("foo", "bar or foo"); ok($ret, "simple match"); is($ret, "foo matches foo", "stringified return"); -$ret=pagespec_match("foo", "link(bar)"); -is(join(",", $ret->influences), 'foo', "link is influenced by the page with the link"); -$ret=pagespec_match("bar", "backlink(foo)"); -is(join(",", $ret->influences), 'foo', "backlink is influenced by the page with the link"); -$ret=pagespec_match("bar", "backlink(foo)"); -is(join(",", $ret->influences), 'foo', "backlink is influenced by the page with the link"); -$ret=pagespec_match("bar", "created_before(foo)"); -is(join(",", $ret->influences), 'foo', "created_before is influenced by the comparison page"); -$ret=pagespec_match("bar", "created_after(foo)"); -is(join(",", $ret->influences), 'foo', "created_after is influenced by the comparison page"); -$ret=pagespec_match("bar", "link(quux) and created_after(foo)"); -is(join(",", sort $ret->influences), 'foo,quux', "influences add up over AND"); -$ret=pagespec_match("bar", "link(quux) and created_after(foo)"); -is(join(",", sort $ret->influences), 'foo,quux', "influences add up over OR"); -$ret=pagespec_match("bar", "!link(quux) and !created_after(foo)"); -is(join(",", sort $ret->influences), 'foo,quux', "influences unaffected by negation"); +my %i=pagespec_match("foo", "link(bar)")->influences; +is(join(",", keys %i), 'foo', "link is influenced by the page with the link"); +%i=pagespec_match("bar", "backlink(foo)")->influences; +is(join(",", keys %i), 'foo', "backlink is influenced by the page with the link"); +%i=pagespec_match("bar", "backlink(foo)")->influences; +is(join(",", keys %i), 'foo', "backlink is influenced by the page with the link"); +%i=pagespec_match("bar", "created_before(foo)")->influences; +is(join(",", keys %i), 'foo', "created_before is influenced by the comparison page"); +%i=pagespec_match("bar", "created_after(foo)")->influences; +is(join(",", keys %i), 'foo', "created_after is influenced by the comparison page"); +%i=pagespec_match("bar", "link(quux) and created_after(foo)")->influences; +is(join(",", sort keys %i), 'bar,foo', "influences add up over AND"); +%i=pagespec_match("bar", "link(quux) and created_after(foo)")->influences; +is(join(",", sort keys %i), 'bar,foo', "influences add up over OR"); +%i=pagespec_match("bar", "!link(quux) and !created_after(foo)")->influences; +is(join(",", sort keys %i), 'bar,foo', "influences unaffected by negation"); -- cgit v1.2.3 From 5e236f5d25b68f5fb4a421b24470419c6042cb1c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Oct 2009 16:49:53 -0400 Subject: add use_pagespec and deptype functions --- IkiWiki.pm | 135 +++++++++++++++++++++++++++++++++++++++++-------- debian/changelog | 4 +- doc/plugins/write.mdwn | 61 +++++++++++++++++----- t/use_pagespec.t | 30 +++++++++++ 4 files changed, 194 insertions(+), 36 deletions(-) create mode 100755 t/use_pagespec.t (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 2064c881a..c787612e1 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -17,11 +17,12 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %forcerebuild %loaded_plugins}; use Exporter q{import}; -our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match - pagespec_match_list bestlink htmllink readfile writefile - pagetype srcfile pagename displaytime will_render gettext urlto - targetpage add_underlay pagetitle titlepage linkpage - newpagefile inject add_link +our @EXPORT = qw(hook debug error template htmlpage deptype use_pagespec + add_depends pagespec_match pagespec_match_list bestlink + htmllink readfile writefile pagetype srcfile pagename + displaytime will_render gettext urlto targetpage + add_underlay pagetitle titlepage linkpage newpagefile + inject add_link %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version @@ -1768,18 +1769,10 @@ sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } -sub add_depends ($$;@) { +sub add_depends ($$;$) { my $page=shift; my $pagespec=shift; - - my $deptype=0; - if (@_) { - my %params=@_; - - $deptype=$deptype | $DEPEND_PRESENCE if $params{presence}; - $deptype=$deptype | $DEPEND_LINKS if $params{links}; - } - $deptype=$DEPEND_CONTENT unless $deptype; + my $deptype=shift || $DEPEND_CONTENT; # Is the pagespec a simple page name? if ($pagespec =~ /$config{wiki_file_regexp}/ && @@ -1791,18 +1784,118 @@ sub add_depends ($$;@) { # Analyse the pagespec, and match it against all pages # to get a list of influences, and add explicit dependencies # for those. + #my $sub=pagespec_translate($pagespec); + #return if $@; + #foreach my $p (keys %pagesources) { + # my $r=$sub->($p, location => $page ); + # my %i=$r->influences; + # foreach my $i (keys %i) { + # $depends_simple{$page}{lc $i} |= $i{$i}; + # } + #} + print STDERR "warning: use of add_depends; influences not tracked\n"; + + $depends{$page}{$pagespec} |= $deptype; + return 1; +} + +sub use_pagespec ($$;@) { + my $page=shift; + my $pagespec=shift; + my %params=@_; + my $sub=pagespec_translate($pagespec); - return if $@; - foreach my $p (keys %pagesources) { - my $r=$sub->($p, location => $page ); - my %i=$r->influences; + error "syntax error in pagespec \"$pagespec\"" + if $@ || ! defined $sub; + + my @candidates; + if (exists $params{limit}) { + @candidates=grep { $params{limit}->($_) } keys %pagesources; + } + else { + @candidates=keys %pagesources; + } + + if (defined $params{sort}) { + my $f; + if ($params{sort} eq 'title') { + $f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) }; + } + elsif ($params{sort} eq 'title_natural') { + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } + $f=sub { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) }; + } + elsif ($params{sort} eq 'mtime') { + $f=sub { $pagemtime{$b} <=> $pagemtime{$a} }; + } + elsif ($params{sort} eq 'age') { + $f=sub { $pagectime{$b} <=> $pagectime{$a} }; + } + else { + error sprintf(gettext("unknown sort type %s"), $params{sort}); + } + @candidates = sort { &$f } @candidates; + } + + @candidates=reverse(@candidates) if $params{reverse}; + + my @matches; + my $firstfail; + my $count=0; + foreach my $p (@candidates) { + my $r=$sub->($p, location => $page); + if ($r) { + push @matches, [$p, $r]; + last if defined $params{num} && ++$count == $params{num}; + } + elsif (! defined $firstfail) { + $firstfail=$r; + } + } + + $depends{$page}{$pagespec} |= ($params{deptype} || $DEPEND_CONTENT); + + my @ret; + if (@matches) { + # Add all influences from successful matches. + foreach my $m (@matches) { + push @ret, $m->[0]; + my %i=$m->[1]->influences; + foreach my $i (keys %i) { + $depends_simple{$page}{lc $i} |= $i{$i}; + } + } + } + elsif (defined $firstfail) { + # Add influences from one failure. (Which one should not + # matter; all should have the same influences.) + my %i=$firstfail->influences; foreach my $i (keys %i) { $depends_simple{$page}{lc $i} |= $i{$i}; } + error(sprintf(gettext("cannot match pages: %s"), $firstfail)); } - $depends{$page}{$pagespec} |= $deptype; - return 1; + return @ret; +} + +sub deptype (@) { + my $deptype=0; + foreach my $type (@_) { + if ($type eq 'presence') { + $deptype |= $DEPEND_PRESENCE; + } + elsif ($type eq 'links') { + $deptype |= $DEPEND_LINKS; + } + elsif ($type eq 'content') { + $deptype |= $DEPEND_CONTENT; + } + } + return $deptype; } sub file_pruned ($$) { diff --git a/debian/changelog b/debian/changelog index 565a0cffa..12ddebac9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,6 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low * Added support framework for multiple types of dependencies. * Allow declaring that a dependency is only affected by page presence or changes to its links. - (By passing presence => 1 or links => 1 to add_depends.) * pagecount, calendar, postsparkline, progress: Use a presence dependency, which makes these directives much less expensive to use, since page edits will no longer trigger an unnecessary update. @@ -34,6 +33,9 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low info. * Plugins providing PageSpec `match_*` functions should pass additional influence information when creating result objects. + * Added `use_pagespec` function, that plugins can use to find a list + of matching pages and add dependencies and influences, all at once, + and efficiently. -- Joey Hess Sun, 27 Sep 2009 17:40:03 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 232430079..3d5650758 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -609,21 +609,52 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -#### `add_depends($$;@)` +### `deptype(@)` + +Use this function to generate ikiwiki's internal representation of a +dependency type from one or more of these keywords: + +* `content` is the default. Any change to the content + of a page triggers the dependency. +* `presence` is only triggered by a change to the presence + of a page. +* `links` is only triggered by a change to the links of a page. + This includes when a link is added, removed, or changes what + it points to due to other changes. It does not include the + addition or removal of a duplicate link. + +If multiple types are specified, they are combined. + +#### `use_pagespec($$;@)` + +Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages +in the wiki that match the [[ikiwiki/PageSpec]]. + +The page will automatically be made to depend on the specified +[[ikiwiki/PageSpec]], so `add_depends` does not need to be called. This +is significantly more efficient than calling `add_depends` +followed by `pagespec_match_list`. You should use this anytime a plugin +needs to match a set of pages and generate something based on that list. + +Additional named parameters can be specified: + +* `deptype` optionally specifies the type of dependency to add. Use the + `deptype` function to generate a dependency type. +* `limit` is a reference to a function, that is called and passed a page, + and must return true for the page to be included. +* `sort` specifies a sort order for the list. See + [[ikiwiki/PageSpec/sorting]] for the avilable sort methods. +* `reverse` if true, sorts in reverse. +* `num` if nonzero, specifies the maximum number of matching pages that + will be returned. + +#### `add_depends($$;$)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. By default, dependencies are full content dependencies, meaning that the page will be updated whenever anything matching the PageSpec is modified. -This default can be overridden by additional named parameters, which can be -used to indicate weaker types of dependencies: - -* `presence` if set to true, only the presence of a matching page triggers - the dependency. -* `links` if set to true, any change to links on a matching page - triggers the dependency. This includes when a link is added, removed, - or changes what it points to due to other changes. It does not include - the addition or removal of a duplicate link. +This can be overridden by passing a `deptype` value as the third parameter. #### `pagespec_match($$;@)` @@ -984,10 +1015,12 @@ IkiWiki::ErrorReason object explaining why. When constructing these objects, you should also include information about of any pages whose contents or other metadata influenced the result of the -match. For example, "backlink(foo)" is influenced by the contents of page foo; -"link(foo)" and "title(bar)" are influenced by the contents of any -page they match; "created_before(foo)" is influenced by the metadata of -foo; while "glob(*)" is not influenced by the contents of any page. +match. Do this by passing a list of pages, followed by `deptype` values. + +For example, "backlink(foo)" is influenced by the contents of page foo; +"link(foo)" and "title(bar)" are influenced by the contents of any page +they match; "created_before(foo)" is influenced by the metadata of foo; +while "glob(*)" is not influenced by the contents of any page. ### Setup plugins diff --git a/t/use_pagespec.t b/t/use_pagespec.t new file mode 100755 index 000000000..7b904075e --- /dev/null +++ b/t/use_pagespec.t @@ -0,0 +1,30 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 64; + +BEGIN { use_ok("IkiWiki"); } + +%pagesources=( + foo => "foo.mdwn", + bar => "bar.mdwn", + "post/1" => "post/1.mdwn", + "post/2" => "post/2.mdwn", + "post/3" => "post/3.mdwn", +); + +is_deeply([use_pagespec("foo", "bar")], ["bar"]); +is_deeply([sort(use_pagespec("foo", "post/*"))], ["post/1", "post/2", "post/3"]); +is_deeply([use_pagespec("foo", "post/*", sort => "title", reverse => 1)], + ["post/3", "post/2", "post/1"]); +is_deeply([use_pagespec("foo", "post/*", sort => "title", num => 2)], + ["post/1", "post/2"]); +is_deeply([use_pagespec("foo", "post/*", sort => "title", num => 50)], + ["post/1", "post/2", "post/3"]); +is_deeply([use_pagespec("foo", "post/*", sort => "title", + limit => sub { $_[0] !~ /3/}) ], + ["post/1", "post/2"]); +eval { use_pagespec("foo", "beep") }; +ok($@, "fails with error when unable to match anything"); +eval { use_pagespec("foo", "this is not a legal pagespec!") }; +ok($@, "fails with error when pagespec bad"); -- cgit v1.2.3 From 32cd5f0b798c41b2320a4165c5b6ecc18a4e6e3e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Oct 2009 18:26:36 -0400 Subject: inline: switch to use_pagespec Taking advantage of every single one of its features, of course. Even had to add one more.. --- IkiWiki/Plugin/inline.pm | 49 +++++++++++++++++++++--------------------------- doc/plugins/write.mdwn | 2 ++ 2 files changed, 23 insertions(+), 28 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index be1781520..748e02df4 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -196,45 +196,37 @@ sub preprocess_inline (@) { @list = map { bestlink($params{page}, $_) } split ' ', $params{pagenames}; + if (yesno($params{reverse})) { + @list=reverse(@list); + } + foreach my $p (@list) { add_depends($params{page}, $p, deptype($quick ? "presence" : "content")); } } else { - add_depends($params{page}, $params{pages}, - deptype($quick ? "presence" : "content")); - - @list = pagespec_match_list( - [ grep { $_ ne $params{page} } keys %pagesources ], - $params{pages}, location => $params{page}); - - if (exists $params{sort} && $params{sort} eq 'title') { - @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list; + my $num=0; + if ($params{show}) { + $num=$params{show}; } - elsif (exists $params{sort} && $params{sort} eq 'title_natural') { - eval q{use Sort::Naturally}; - if ($@) { - error(gettext("Sort::Naturally needed for title_natural sort")); - } - @list=sort { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) } @list; + if ($params{feedshow} && $num < $params{feedshow}) { + $num=$params{feedshow}; } - elsif (exists $params{sort} && $params{sort} eq 'mtime') { - @list=sort { $pagemtime{$b} <=> $pagemtime{$a} } @list; + if ($params{skip}) { + $num+=$params{skip}; } - elsif (! exists $params{sort} || $params{sort} eq 'age') { - @list=sort { $pagectime{$b} <=> $pagectime{$a} } @list; - } - else { - error sprintf(gettext("unknown sort type %s"), $params{sort}); - } - } - if (yesno($params{reverse})) { - @list=reverse(@list); + @list = use_pagespec($params{page}, $params{pages}, + deptype => deptype($quick ? "presence" : "content"), + limit => sub { $_[0] ne $params{page} }, + sort => exists $params{sort} ? $params{sort} : "age", + reverse => yesno($params{reverse}), + num => $num, + ); } if (exists $params{skip}) { - @list=@list[$params{skip} .. scalar @list - 1]; + @list=@list[$params{skip} .. $#list]; } my @feedlist; @@ -253,7 +245,8 @@ sub preprocess_inline (@) { } if ($feeds && exists $params{feedpages}) { - @feedlist=pagespec_match_list(\@feedlist, $params{feedpages}, location => $params{page}); + @feedlist = use_pagespec($params{page}, $params{feedpages}, + list => \@feedlist); } my ($feedbase, $feednum); diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 3d5650758..62bebbeed 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -647,6 +647,8 @@ Additional named parameters can be specified: * `reverse` if true, sorts in reverse. * `num` if nonzero, specifies the maximum number of matching pages that will be returned. +* `list` makes it only match amoung the specified list of pages. + Default is to match amoung all pages in the wiki. #### `add_depends($$;$)` -- cgit v1.2.3 From 5e7b2dea84a35163b599b88efc02cd7ef3e0ad46 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Oct 2009 23:51:06 -0400 Subject: rename use_pagespec to pagespec_match_list To avoid breaking plugins, also support the old pagespec_match_list calling convention, with a deprecation warning. --- IkiWiki.pm | 183 ++++++++++++++++++---------------------- IkiWiki/Plugin/calendar.pm | 2 +- IkiWiki/Plugin/inline.pm | 8 +- IkiWiki/Plugin/map.pm | 3 +- IkiWiki/Plugin/orphans.pm | 2 +- IkiWiki/Plugin/pagecount.pm | 2 +- IkiWiki/Plugin/pagestats.pm | 9 +- IkiWiki/Plugin/postsparkline.pm | 2 +- debian/changelog | 6 +- doc/plugins/write.mdwn | 24 ++---- t/pagespec_match_list.t | 31 +++++++ t/use_pagespec.t | 31 ------- 12 files changed, 140 insertions(+), 163 deletions(-) create mode 100755 t/pagespec_match_list.t delete mode 100755 t/use_pagespec.t (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index daa71059b..fd7e23524 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -17,7 +17,7 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %forcerebuild %loaded_plugins}; use Exporter q{import}; -our @EXPORT = qw(hook debug error template htmlpage deptype use_pagespec +our @EXPORT = qw(hook debug error template htmlpage deptype add_depends pagespec_match pagespec_match_list bestlink htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext urlto targetpage @@ -1798,91 +1798,6 @@ sub add_depends ($$;$) { return 1; } -sub use_pagespec ($$;@) { - my $page=shift; - my $pagespec=shift; - my %params=@_; - - my $sub=pagespec_translate($pagespec); - error "syntax error in pagespec \"$pagespec\"" - if $@ || ! defined $sub; - - my @candidates; - if (exists $params{limit}) { - @candidates=grep { $params{limit}->($_) } keys %pagesources; - } - else { - @candidates=keys %pagesources; - } - - if (defined $params{sort}) { - my $f; - if ($params{sort} eq 'title') { - $f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) }; - } - elsif ($params{sort} eq 'title_natural') { - eval q{use Sort::Naturally}; - if ($@) { - error(gettext("Sort::Naturally needed for title_natural sort")); - } - $f=sub { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) }; - } - elsif ($params{sort} eq 'mtime') { - $f=sub { $pagemtime{$b} <=> $pagemtime{$a} }; - } - elsif ($params{sort} eq 'age') { - $f=sub { $pagectime{$b} <=> $pagectime{$a} }; - } - else { - error sprintf(gettext("unknown sort type %s"), $params{sort}); - } - @candidates = sort { &$f } @candidates; - } - - @candidates=reverse(@candidates) if $params{reverse}; - - my @matches; - my $firstfail; - my $count=0; - foreach my $p (@candidates) { - my $r=$sub->($p, location => $page); - if ($r) { - push @matches, [$p, $r]; - last if defined $params{num} && ++$count == $params{num}; - } - elsif (! defined $firstfail) { - $firstfail=$r; - } - } - - $depends{$page}{$pagespec} |= ($params{deptype} || $DEPEND_CONTENT); - - my @ret; - if (@matches) { - # Add all influences from successful matches. - foreach my $m (@matches) { - push @ret, $m->[0]; - my %i=$m->[1]->influences; - foreach my $i (keys %i) { - $depends_simple{$page}{lc $i} |= $i{$i}; - } - } - } - elsif (defined $firstfail) { - # Add influences from one failure. (Which one should not - # matter; all should have the same influences.) - my %i=$firstfail->influences; - foreach my $i (keys %i) { - $depends_simple{$page}{lc $i} |= $i{$i}; - } - - error(sprintf(gettext("cannot match pages: %s"), $firstfail)) - if $firstfail->isa("IkiWiki::ErrorReason"); - } - - return @ret; -} - sub deptype (@) { my $deptype=0; foreach my $type (@_) { @@ -2055,27 +1970,95 @@ sub pagespec_match ($$;@) { } sub pagespec_match_list ($$;@) { - my $pages=shift; - my $spec=shift; - my @params=@_; + my $page=shift; + my $pagespec=shift; + my %params=@_; - my $sub=pagespec_translate($spec); - error "syntax error in pagespec \"$spec\"" + # Backwards compatability with old calling convention. + if (ref $page) { + print STDERR "warning: a plugin (".caller().") is using pagespec_match_list in an obsolete way, and needs to be updated\n"; + $params{list}=$page; + $page=$params{location}; # ugh! + } + + my $sub=pagespec_translate($pagespec); + error "syntax error in pagespec \"$pagespec\"" if $@ || ! defined $sub; + + my @candidates; + if (exists $params{limit}) { + @candidates=grep { $params{limit}->($_) } keys %pagesources; + } + else { + @candidates=keys %pagesources; + } + + if (defined $params{sort}) { + my $f; + if ($params{sort} eq 'title') { + $f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) }; + } + elsif ($params{sort} eq 'title_natural') { + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } + $f=sub { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) }; + } + elsif ($params{sort} eq 'mtime') { + $f=sub { $pagemtime{$b} <=> $pagemtime{$a} }; + } + elsif ($params{sort} eq 'age') { + $f=sub { $pagectime{$b} <=> $pagectime{$a} }; + } + else { + error sprintf(gettext("unknown sort type %s"), $params{sort}); + } + @candidates = sort { &$f } @candidates; + } + + @candidates=reverse(@candidates) if $params{reverse}; - my @ret; - my $r; - foreach my $page (@$pages) { - $r=$sub->($page, @params); - push @ret, $page if $r; + my @matches; + my $firstfail; + my $count=0; + foreach my $p (@candidates) { + my $r=$sub->($p, location => $page); + if ($r) { + push @matches, [$p, $r]; + last if defined $params{num} && ++$count == $params{num}; + } + elsif (! defined $firstfail) { + $firstfail=$r; + } } + + $depends{$page}{$pagespec} |= ($params{deptype} || $DEPEND_CONTENT); - if (! @ret && defined $r && $r->isa("IkiWiki::ErrorReason")) { - error(sprintf(gettext("cannot match pages: %s"), $r)); + my @ret; + if (@matches) { + # Add all influences from successful matches. + foreach my $m (@matches) { + push @ret, $m->[0]; + my %i=$m->[1]->influences; + foreach my $i (keys %i) { + $depends_simple{$page}{lc $i} |= $i{$i}; + } + } } - else { - return @ret; + elsif (defined $firstfail) { + # Add influences from one failure. (Which one should not + # matter; all should have the same influences.) + my %i=$firstfail->influences; + foreach my $i (keys %i) { + $depends_simple{$page}{lc $i} |= $i{$i}; + } + + error(sprintf(gettext("cannot match pages: %s"), $firstfail)) + if $firstfail->isa("IkiWiki::ErrorReason"); } + + return @ret; } sub pagespec_valid ($) { diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index a89175cfb..c50d038df 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -74,7 +74,7 @@ sub format_month (@) { my $nyear = $params{nyear}; my %linkcache; - foreach my $p (use_pagespec($params{page}, $params{pagespec}, + foreach my $p (pagespec_match_list($params{page}, $params{pagespec}, # add presence dependencies to update # month calendar when pages are added/removed deptype => deptype("presence"))) { diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index c02137aed..815a37838 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -216,7 +216,7 @@ sub preprocess_inline (@) { $num+=$params{skip}; } - @list = use_pagespec($params{page}, $params{pages}, + @list = pagespec_match_list($params{page}, $params{pages}, deptype => deptype($quick ? "presence" : "content"), limit => sub { $_[0] ne $params{page} }, sort => exists $params{sort} ? $params{sort} : "age", @@ -245,9 +245,11 @@ sub preprocess_inline (@) { } if ($feeds && exists $params{feedpages}) { - @feedlist = use_pagespec($params{page}, "($params{pages}) and ($params{feedpages})", + @feedlist = pagespec_match_list( + $params{page}, "($params{pages}) and ($params{feedpages})", deptype => deptype($quick ? "presence" : "content"), - list => \@feedlist); + list => \@feedlist, + ); } my ($feedbase, $feednum); diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 634b0e4d6..788b96827 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -36,7 +36,8 @@ sub preprocess (@) { # Get all the items to map. my %mapitems; - foreach my $page (use_pagespec($params{page}, $params{pages}, deptype => $deptype)) { + foreach my $page (pagespec_match_list($params{page}, $params{pages}, + deptype => $deptype)) { if (exists $params{show} && exists $pagestate{$page} && exists $pagestate{$page}{meta}{$params{show}}) { diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 607239500..b1ebd1b9d 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -28,7 +28,7 @@ sub preprocess (@) { # considering as orphans. add_depends($params{page}, "*", deptype("links")); - my @orphans=use_pagespec($params{page}, $params{pages}, + my @orphans=pagespec_match_list($params{page}, $params{pages}, # update when orphans are added/removed deptype => deptype("presence"), limit => sub { diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index 40474b2a1..8d36f057e 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -32,7 +32,7 @@ sub preprocess (@) { return scalar keys %pagesources; } - return scalar use_pagespec($params{page}, $pages, + return scalar pagespec_match_list($params{page}, $pages, deptype => deptype("presence")); } diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index e64f7d9c3..47638210a 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -37,16 +37,17 @@ sub preprocess (@) { my %counts; my $max = 0; - foreach my $page (use_pagespec($params{page}, $params{pages}, - # update when a displayed page is added or removed - deptype => deptype("presence"))) { + foreach my $page (pagespec_match_list($params{page}, $params{pages}, + # update when a displayed page is added/removed + deptype => deptype("presence"))) { use IkiWiki::Render; my @backlinks = IkiWiki::backlink_pages($page); if (exists $params{among}) { # only consider backlinks from the amoung pages - @backlinks = use_pagespec($params{page}, $params{among}, + @backlinks = pagespec_match_list( + $params{page}, $params{among}, # update whenever links on those pages change deptype => deptype("links"), list => \@backlinks diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index f51e309c8..1d4532366 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -54,7 +54,7 @@ sub preprocess (@) { } my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } - use_pagespec($params{page}, $params{pages}, + pagespec_match_list($params{page}, $params{pages}, deptype => $deptype, limit => sub { $_[0] ne $params{page} }, ); diff --git a/debian/changelog b/debian/changelog index 3a6fdf77d..49809e6cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,9 +33,9 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low info. * Plugins providing PageSpec `match_*` functions should pass additional influence information when creating result objects. - * Added `use_pagespec` function, that plugins can use to find a list - of matching pages and add dependencies and influences, all at once, - and efficiently. + * API change: `pagespec_match_list` has completly changed its interface. + The old interface will be removed soon, and a warning will be printed + if any plugins try to use it. * Optimize away most expensive file prune calls, when refreshing, by only checking new files. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 62bebbeed..f6ea76c36 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -625,16 +625,16 @@ dependency type from one or more of these keywords: If multiple types are specified, they are combined. -#### `use_pagespec($$;@)` +#### `pagespec_match_list($$;@)` Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages in the wiki that match the [[ikiwiki/PageSpec]]. The page will automatically be made to depend on the specified [[ikiwiki/PageSpec]], so `add_depends` does not need to be called. This -is significantly more efficient than calling `add_depends` -followed by `pagespec_match_list`. You should use this anytime a plugin -needs to match a set of pages and generate something based on that list. +is significantly more efficient than calling `add_depends` and +`pagespec_match` in a loop. You should use this anytime a plugin +needs to match a set of pages and do something based on that list. Additional named parameters can be specified: @@ -650,6 +650,9 @@ Additional named parameters can be specified: * `list` makes it only match amoung the specified list of pages. Default is to match amoung all pages in the wiki. +Unlike pagespec_match, this may throw an error if there is an error in +the pagespec. + #### `add_depends($$;$)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. @@ -672,19 +675,6 @@ The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match relative to the top of the wiki. -#### `pagespec_match_list($$;@)` - -Passed a reference to a list of page names, and [[ikiwiki/PageSpec]], -returns the set of pages that match the [[ikiwiki/PageSpec]]. - -Additional named parameters can be passed, to further limit the match. -The most often used is "location", which specifies the location the -PageSpec should match against. If not passed, relative PageSpecs will match -relative to the top of the wiki. - -Unlike pagespec_match, this may throw an error if there is an error in -the pagespec. - #### `bestlink($$)` Given a page and the text of a link on the page, determine which diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t new file mode 100755 index 000000000..85a30b542 --- /dev/null +++ b/t/pagespec_match_list.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 10; + +BEGIN { use_ok("IkiWiki"); } + +%pagesources=( + foo => "foo.mdwn", + bar => "bar.mdwn", + "post/1" => "post/1.mdwn", + "post/2" => "post/2.mdwn", + "post/3" => "post/3.mdwn", +); + +is_deeply([pagespec_match_list("foo", "bar")], ["bar"]); +is_deeply([sort(pagespec_match_list("foo", "post/*"))], ["post/1", "post/2", "post/3"]); +is_deeply([pagespec_match_list("foo", "post/*", sort => "title", reverse => 1)], + ["post/3", "post/2", "post/1"]); +is_deeply([pagespec_match_list("foo", "post/*", sort => "title", num => 2)], + ["post/1", "post/2"]); +is_deeply([pagespec_match_list("foo", "post/*", sort => "title", num => 50)], + ["post/1", "post/2", "post/3"]); +is_deeply([pagespec_match_list("foo", "post/*", sort => "title", + limit => sub { $_[0] !~ /3/}) ], + ["post/1", "post/2"]); +my $r=eval { pagespec_match_list("foo", "beep") }; +ok(eval { pagespec_match_list("foo", "beep") } == 0); +ok(! $@, "does not fail with error when unable to match anything"); +eval { pagespec_match_list("foo", "this is not a legal pagespec!") }; +ok($@, "fails with error when pagespec bad"); diff --git a/t/use_pagespec.t b/t/use_pagespec.t deleted file mode 100755 index 92d7977cf..000000000 --- a/t/use_pagespec.t +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use Test::More tests => 10; - -BEGIN { use_ok("IkiWiki"); } - -%pagesources=( - foo => "foo.mdwn", - bar => "bar.mdwn", - "post/1" => "post/1.mdwn", - "post/2" => "post/2.mdwn", - "post/3" => "post/3.mdwn", -); - -is_deeply([use_pagespec("foo", "bar")], ["bar"]); -is_deeply([sort(use_pagespec("foo", "post/*"))], ["post/1", "post/2", "post/3"]); -is_deeply([use_pagespec("foo", "post/*", sort => "title", reverse => 1)], - ["post/3", "post/2", "post/1"]); -is_deeply([use_pagespec("foo", "post/*", sort => "title", num => 2)], - ["post/1", "post/2"]); -is_deeply([use_pagespec("foo", "post/*", sort => "title", num => 50)], - ["post/1", "post/2", "post/3"]); -is_deeply([use_pagespec("foo", "post/*", sort => "title", - limit => sub { $_[0] !~ /3/}) ], - ["post/1", "post/2"]); -my $r=eval { use_pagespec("foo", "beep") }; -ok(eval { use_pagespec("foo", "beep") } == 0); -ok(! $@, "does not fail with error when unable to match anything"); -eval { use_pagespec("foo", "this is not a legal pagespec!") }; -ok($@, "fails with error when pagespec bad"); -- cgit v1.2.3 From 769b78df078d0287a10166ce828941a491858ff2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Oct 2009 13:02:10 -0400 Subject: pagespec_match_list allow additional pagespec limit parameters again --- IkiWiki.pm | 12 ++++++++---- doc/plugins/write.mdwn | 7 +++++-- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 475e278c3..f959d868b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2019,21 +2019,25 @@ sub pagespec_match_list ($$;@) { @candidates=reverse(@candidates) if $params{reverse}; + $depends{$page}{$pagespec} |= ($params{deptype} || $DEPEND_CONTENT); + + # clear params, remainder is passed to pagespec + my $num=$params{num}; + delete @params{qw{num deptype reverse sort limit}}; + my @matches; my $firstfail; my $count=0; foreach my $p (@candidates) { - my $r=$sub->($p, location => $page); + my $r=$sub->($p, %params, location => $page); if ($r) { push @matches, [$p, $r]; - last if defined $params{num} && ++$count == $params{num}; + last if defined $num && ++$count == $num; } elsif (! defined $firstfail) { $firstfail=$r; } } - - $depends{$page}{$pagespec} |= ($params{deptype} || $DEPEND_CONTENT); my @ret; if (@matches) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index f6ea76c36..9661bf4de 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -636,6 +636,9 @@ is significantly more efficient than calling `add_depends` and `pagespec_match` in a loop. You should use this anytime a plugin needs to match a set of pages and do something based on that list. +Unlike pagespec_match, this may throw an error if there is an error in +the pagespec. + Additional named parameters can be specified: * `deptype` optionally specifies the type of dependency to add. Use the @@ -650,8 +653,8 @@ Additional named parameters can be specified: * `list` makes it only match amoung the specified list of pages. Default is to match amoung all pages in the wiki. -Unlike pagespec_match, this may throw an error if there is an error in -the pagespec. +Any other named parameters are passed on to `pagespec_match`, to further +limit the match. #### `add_depends($$;$)` -- cgit v1.2.3 From 6f2cc5ac8cc7e76b3faf20cd7516f82bcb3de7ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Oct 2009 13:20:41 -0400 Subject: pagespec_match_list: change limit to filter --- IkiWiki.pm | 6 +++--- IkiWiki/Plugin/inline.pm | 2 +- IkiWiki/Plugin/orphans.pm | 10 +++++----- IkiWiki/Plugin/postsparkline.pm | 2 +- doc/plugins/write.mdwn | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index f959d868b..49c76c4d4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1986,8 +1986,8 @@ sub pagespec_match_list ($$;@) { if $@ || ! defined $sub; my @candidates; - if (exists $params{limit}) { - @candidates=grep { $params{limit}->($_) } keys %pagesources; + if (exists $params{filter}) { + @candidates=grep { ! $params{filter}->($_) } keys %pagesources; } else { @candidates=keys %pagesources; @@ -2023,7 +2023,7 @@ sub pagespec_match_list ($$;@) { # clear params, remainder is passed to pagespec my $num=$params{num}; - delete @params{qw{num deptype reverse sort limit}}; + delete @params{qw{num deptype reverse sort filter}}; my @matches; my $firstfail; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 815a37838..0fe0bd2e1 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -218,7 +218,7 @@ sub preprocess_inline (@) { @list = pagespec_match_list($params{page}, $params{pages}, deptype => deptype($quick ? "presence" : "content"), - limit => sub { $_[0] ne $params{page} }, + filter => sub { $_[0] eq $params{page} }, sort => exists $params{sort} ? $params{sort} : "age", reverse => yesno($params{reverse}), num => $num, diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index b1ebd1b9d..702943f87 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -31,24 +31,24 @@ sub preprocess (@) { my @orphans=pagespec_match_list($params{page}, $params{pages}, # update when orphans are added/removed deptype => deptype("presence"), - limit => sub { + filter => sub { my $page=shift; # Filter out pages that other pages link to. - return 0 if IkiWiki::backlink_pages($page); + return 1 if IkiWiki::backlink_pages($page); # Toplevel index is assumed to never be orphaned. - return 0 if $page eq 'index'; + return 1 if $page eq 'index'; # If the page has a link to some other page, it's # indirectly linked via that page's backlinks. - return 0 if grep { + return 1 if grep { length $_ && ($_ !~ /\/\Q$config{discussionpage}\E$/i || ! $config{discussion}) && bestlink($page, $_) !~ /^(\Q$page\E|)$/ } @{$links{$page}}; - return 1; + return 0; }, ); diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index 1d4532366..0d5a12e33 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -56,7 +56,7 @@ sub preprocess (@) { my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } pagespec_match_list($params{page}, $params{pages}, deptype => $deptype, - limit => sub { $_[0] ne $params{page} }, + filter => sub { $_[0] eq $params{page} }, ); my @data=eval qq{IkiWiki::Plugin::postsparkline::formula::$formula(\\\%params, \@list)}; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 9661bf4de..2254d7025 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -643,8 +643,8 @@ Additional named parameters can be specified: * `deptype` optionally specifies the type of dependency to add. Use the `deptype` function to generate a dependency type. -* `limit` is a reference to a function, that is called and passed a page, - and must return true for the page to be included. +* `filter` is a reference to a function, that is called and passed a page, + and returns true if the page should be filtered out of the list. * `sort` specifies a sort order for the list. See [[ikiwiki/PageSpec/sorting]] for the avilable sort methods. * `reverse` if true, sorts in reverse. -- cgit v1.2.3 From 74409f940d24f51a08becb626e266c91d40d69bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Oct 2009 17:15:40 -0400 Subject: add_depends: optimise influence calculation I made match_* functions whose influences can vary depending on the page matched set a special "" influence to indicate this. Then add_depends can try just one page, and if static influences are found, stop there. --- IkiWiki.pm | 52 +++++++++++++++++++++++++------------------------- IkiWiki/Plugin/meta.pm | 6 +++--- doc/plugins/write.mdwn | 2 +- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index c67a1e138..cd93fe969 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1780,19 +1780,17 @@ sub add_depends ($$;$) { return 1; } - # Analyse the pagespec, and match it against all pages - # to get a list of influences, and add explicit dependencies - # for those. - #my $sub=pagespec_translate($pagespec); - #return if $@; - #foreach my $p (keys %pagesources) { - # my $r=$sub->($p, location => $page ); - # my %i=$r->influences; - # foreach my $i (keys %i) { - # $depends_simple{$page}{lc $i} |= $i{$i}; - # } - #} - print STDERR "warning: use of add_depends by ".caller()."; influences not tracked\n"; + # Add explicit dependencies for influences. + my $sub=pagespec_translate($pagespec); + return if $@; + foreach my $p (keys %pagesources) { + my $r=$sub->($p, location => $page); + my $i=$r->influences; + foreach my $k (keys %$i) { + $depends_simple{$page}{lc $k} |= $i->{$k}; + } + last if $r->influences_static; + } $depends{$page}{$pagespec} |= $deptype; return 1; @@ -2045,9 +2043,9 @@ sub pagespec_match_list ($$;@) { } # Add simple dependencies for accumulated influences. - my %i=$accum->influences; - foreach my $i (keys %i) { - $depends_simple{$page}{lc $i} |= $i{$i}; + my $i=$accum->influences; + foreach my $k (keys %$i) { + $depends_simple{$page}{lc $k} |= $i->{$k}; } return @matches; @@ -2099,12 +2097,14 @@ sub new { sub influences { my $this=shift; - if (! @_) { - return %{$this->[1]}; - } - else { - $this->[1]={@_}; - } + $this->[1]={@_} if @_; + my %i=%{$this->[1]}; + delete $i{""}; + return \%i; +} + +sub influences_static { + return ! $_[0][1]->{""}; } sub merge_influences { @@ -2173,19 +2173,19 @@ sub match_link ($$;@) { my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { if (length $bestlink) { - return IkiWiki::SuccessReason->new("$page links to $link", $page => $IkiWiki::DEPEND_LINKS) + return IkiWiki::SuccessReason->new("$page links to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) if $bestlink eq IkiWiki::bestlink($page, $p); } else { - return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page => $IkiWiki::DEPEND_LINKS) + return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) if match_glob($p, $link, %params); my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page => $IkiWiki::DEPEND_LINKS) + return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) if match_glob($p_rel, $link, %params); } } - return IkiWiki::FailReason->new("$page does not link to $link"); + return IkiWiki::FailReason->new("$page does not link to $link", "" => 1); } sub match_backlink ($$;@) { diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index c675880b3..8dcd73a1a 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -291,14 +291,14 @@ sub match { if (defined $val) { if ($val=~/^$re$/i) { - return IkiWiki::SuccessReason->new("$re matches $field of $page", $page => $IkiWiki::DEPEND_CONTENT); + return IkiWiki::SuccessReason->new("$re matches $field of $page", $page => $IkiWiki::DEPEND_CONTENT, "" => 1); } else { - return IkiWiki::FailReason->new("$re does not match $field of $page"); + return IkiWiki::FailReason->new("$re does not match $field of $page", "" => 1); } } else { - return IkiWiki::FailReason->new("$page does not have a $field"); + return IkiWiki::FailReason->new("$page does not have a $field", "" => 1); } } diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 2254d7025..c72418c3c 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -632,7 +632,7 @@ in the wiki that match the [[ikiwiki/PageSpec]]. The page will automatically be made to depend on the specified [[ikiwiki/PageSpec]], so `add_depends` does not need to be called. This -is significantly more efficient than calling `add_depends` and +is often significantly more efficient than calling `add_depends` and `pagespec_match` in a loop. You should use this anytime a plugin needs to match a set of pages and do something based on that list. -- cgit v1.2.3 From 800d165037ee9bc3362e21048ab07bdd120dcfe0 Mon Sep 17 00:00:00 2001 From: Jogo Date: Sat, 10 Oct 2009 04:22:41 -0400 Subject: --- doc/plugins/lockedit/discussion.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/plugins/lockedit/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn new file mode 100644 index 000000000..b058b2b07 --- /dev/null +++ b/doc/plugins/lockedit/discussion.mdwn @@ -0,0 +1,21 @@ +This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose : + + sub canedit ($$) { + my $page=shift; + my $cgi=shift; + my $session=shift; + + my $user=$session->param("name"); + return undef if defined $user && IkiWiki::is_admin($user); + + if (defined $config{locked_pages} && length $config{locked_pages} && + pagespec_match($page, $config{locked_pages}, + user => $session->param("name"), + ip => $ENV{REMOTE_ADDR}, + )) { + return sprintf(gettext("%s is locked and cannot be edited"), + htmllink("", "", $page, noimageinline => 1)); + } + + return undef; + } -- cgit v1.2.3 From 22ed3f388b6433c512ca7a026d868861ea1990ea Mon Sep 17 00:00:00 2001 From: Jogo Date: Sun, 11 Oct 2009 04:34:17 -0400 Subject: --- doc/plugins/contrib/groupfile.mdwn | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 doc/plugins/contrib/groupfile.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/groupfile.mdwn b/doc/plugins/contrib/groupfile.mdwn new file mode 100644 index 000000000..e5c0ded42 --- /dev/null +++ b/doc/plugins/contrib/groupfile.mdwn @@ -0,0 +1,105 @@ +[[!template id=plugin name=groupfile core=0 author="[[Jogo]]"]] + +This plugin add a `group(groupname)` function to [[ikiwiki/PageSpec]], which is true +only if the actual user is member of the group named `groupname`. + +Groups membership are read from a file. The syntax of this file is very close to +usual `/etc/passwd` Unix file : the group's name, followed by a colon, followed by +a coma separated list of user's names. For exemple : + + dev:toto,foo + i18n:zorba + +----- + + #!/usr/bin/perl + # GroupFile plugin. + # by Joseph Boudou + + package IkiWiki::Plugin::groupfile; + + use warnings; + use strict; + use IkiWiki 3.00; + + sub import { + hook(type => 'getsetup', id => 'groups', call => \&get_setup); + } + + sub get_setup () { + return ( + plugin => { + safe => 0, + rebuild => 0, + }, + group_file => { + type => 'string', + example => '/etc/ikiwiki/group', + description => 'group file location', + safe => 0, + rebuild => 0, + }, + ); + } + + my $users_of = 0; + + sub get_groups () { + if (not $users_of) { + + if (not defined $config{group_file}) { + return 'group_file option not set'; + } + + open my $file, '<', $config{group_file} + or return 'Unable to open group_file'; + + $users_of = {}; + READ: + while (<$file>) { + next READ if (/^\s*$/); + + if (/^(\w+):([\w,]+)/) { + %{ $users_of->{$1} } = map { $_ => 1 } split /,/, $2; + } + else { + $users_of = "Error at group_file:$."; + last READ; + } + } + + close $file; + } + + return $users_of; + } + + package IkiWiki::PageSpec; + + sub match_group ($$;@) { + shift; + my $group = shift; + my %params = @_; + + if (not exists $params{user}) { + return IkiWiki::ErrorReason->new('no user specified'); + } + if (not defined $params{user}) { + return IkiWiki::FailReason->new('not logged in'); + } + + my $users_of = IkiWiki::Plugin::groupfile::get_groups(); + if (not ref $users_of) { + return IkiWiki::ErrorReason->new($users_of); + } + + if (exists $users_of->{$group}{ $params{user} }) { + return IkiWiki::SuccessReason->new("user is member of $group"); + } + else { + return IkiWiki::FailReason->new( + "user $params{user} isn't member of $group"); + } + } + + 1 -- cgit v1.2.3 From 5dba91cdc88c01ac1d314f24b12eb2cda651e206 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 13:51:23 -0400 Subject: typo --- doc/plugins/calendar.mdwn | 2 +- t/pagespec_match_result.t | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index d695762b7..8ade70004 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -6,7 +6,7 @@ The directive displays a calendar, similar to the typical calendars shown on some blogs. Since ikiwiki is a wiki compiler, to keep the calendar up-to-date, -wikis that include it need to be periodically refreshes, typically by cron +wikis that include it need to be periodically refreshed, typically by cron at midnight. Example crontab: 0 0 * * * ikiwiki -setup ~/ikiwiki.setup -refresh diff --git a/t/pagespec_match_result.t b/t/pagespec_match_result.t index d9c31d6f0..c2112bf14 100755 --- a/t/pagespec_match_result.t +++ b/t/pagespec_match_result.t @@ -57,3 +57,21 @@ ok(! $s->influences->{foo}, "removed 0 influence"); ok(! $s->influences->{bar}, "removed 1 influence"); ok($s->influences->{baz}, "set influence"); ok($s->influences_static); + +# influence blocking +my $r=F()->block & S(foo => 1); +ok(! $r->influences->{foo}, "failed blocker & influence -> does not pass"); +$r=F()->block | S(foo => 1); +ok($r->influences->{foo}, "failed blocker | influence -> does pass"); +$r=S(foo => 1) & F()->block; +ok(! $r->influences->{foo}, "influence & failed blocker -> does not pass"); +$r=S(foo => 1) | F()->block; +ok($r->influences->{foo}, "influence | failed blocker -> does pass"); +$r=S(foo => 1) & F()->block & S(foo => 2); +ok(! $r->influences->{foo}, "influence & failed blocker & influence -> does not pass"); +$r=S(foo => 1) | F()->block | S(foo => 2); +ok($r->influences->{foo}, "influence | failed blocker | influence -> does pass"); +$r=S()->block & S(foo => 1); +ok($r->influences->{foo}, "successful blocker -> does pass"); +$r=(! S()->block) & S(foo => 1); +ok(! $r->influences->{foo}, "! successful blocker -> failed blocker"); -- cgit v1.2.3 From 5cddd8a0a3b1b42dd3a92eb4f839679c12ddf97e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 16:04:03 -0400 Subject: typo --- doc/plugins/calendar.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index d695762b7..8ade70004 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -6,7 +6,7 @@ The directive displays a calendar, similar to the typical calendars shown on some blogs. Since ikiwiki is a wiki compiler, to keep the calendar up-to-date, -wikis that include it need to be periodically refreshes, typically by cron +wikis that include it need to be periodically refreshed, typically by cron at midnight. Example crontab: 0 0 * * * ikiwiki -setup ~/ikiwiki.setup -refresh -- cgit v1.2.3 From e1939185d29e1431861e63d6526cb3a498d6033e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 16:42:49 -0400 Subject: ikiwiki-calendar: New command automates creation of archive pages using the calendar plugin. --- debian/changelog | 7 +++++ doc/examples/blog.mdwn | 4 +++ doc/ikiwiki-calendar.mdwn | 51 ++++++++++++++++++++++++++++++++ doc/ikiwiki/directive/calendar.mdwn | 29 ++++++++++++------ doc/plugins/calendar.mdwn | 8 ++--- ikiwiki-calendar | 59 +++++++++++++++++++++++++++++++++++++ templates/calendarmonth.tmpl | 3 ++ templates/calendaryear.tmpl | 1 + 8 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 doc/ikiwiki-calendar.mdwn create mode 100755 ikiwiki-calendar create mode 100644 templates/calendarmonth.tmpl create mode 100644 templates/calendaryear.tmpl (limited to 'doc/plugins') diff --git a/debian/changelog b/debian/changelog index a79faf7fb..22935955a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20091010) UNRELEASED; urgency=low + + * ikiwiki-calendar: New command automates creation of archive pages + using the calendar plugin. + + -- Joey Hess Sun, 11 Oct 2009 15:54:45 -0400 + ikiwiki (3.20091009) unstable; urgency=low * parentlinks: Add has_parentlinks template parameter to allow styling diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index 2155d7fea..f542cad0c 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -23,3 +23,7 @@ Some additional configuration you might want to do: enable comments to posts to the blog: comments_pagespec => 'blog/posts/* and !*/Discussion', + +* Enable the [[calendar|plugins/calendar]] plugin and run the + [[ikiwiki-calendar]] command from cron daily to get an interlinked + set of calendar archives. diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn new file mode 100644 index 000000000..e2cc612f3 --- /dev/null +++ b/doc/ikiwiki-calendar.mdwn @@ -0,0 +1,51 @@ +# NAME + +ikiwiki-calendar - create calendar archive pages + +# SYNOPSIS + +ikiwiki-calendar [-f] your.setup [pagespec] [year] + +# DESCRIPTION + +`ikiwiki-calendar` creates pages that use the [[ikiwiki/directive/calendar]] +directive, allowing the archives to be browsed one month +at a time, with calendar-based navigation. + +You must specify the setup file for your wiki. The pages will +be created inside its `srcdir`, beneath the `archivebase` +directory used by the calendar plugin (default "archives"). + +You will probably want to specify a [[ikiwiki/PageSpec]] +to control which pages are included on the calendars. The +default is all pages. To limit it to only posts in a blog, +use something like "posts/* and !*/Discussion". + +It defaults to creating calendar pages for the current +year, as well as the previous year, and the next year. +If you specify a year, it will create pages for that year. + +Existing pages will not be overwritten by this command by default. +Use the `-f` switch to force it to overwrite any existing pages. + +## CRONTAB + +While this command only needs to be run once a year to update +the archive pages for each new year, you are recommended to set up +a cron job to run it daily, at midnight. Then it will also update +the calendars to highlight the current day. + +An example crontab: + + 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion" + +# TEMPLATES + +This command uses two [[template|wikitemplates]] to generate +the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. + +# AUTHOR + +Joey Hess + +Warning: this page is automatically made into ikiwiki-calendar's man page, edit with care diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn index 8a257d6eb..b2ac75b11 100644 --- a/doc/ikiwiki/directive/calendar.mdwn +++ b/doc/ikiwiki/directive/calendar.mdwn @@ -1,5 +1,4 @@ The `calendar` directive is supplied by the [[!iki plugins/calendar desc=calendar]] plugin. -This plugin requires extra setup. See the plugin documentation for details. This directive displays a calendar, similar to the typical calendars shown on some blogs. @@ -12,16 +11,28 @@ some blogs. \[[!calendar type="year" year="2005" pages="blog/* and !*/Discussion"]] +## setup + The calendar is essentially a fancy front end to archives of previous pages, usually used for blogs. It can produce a calendar for a given month, -or a list of months for a given year. - -The month format calendar simply links to any page posted on each -day of the month. The year format calendar links to archive pages, with -names like `archives/2007` (for all of 2007) and `archives/2007/01` -(for January, 2007). For this to work, you'll need to create these archive -pages. They typically use [[inline]] to display or list pages created in -the given time frame. +or a list of months for a given year. The month format calendar simply +links to any page posted on each day of the month. The year format calendar +links to archive pages, with names like `archives/2007` (for all of 2007) +and `archives/2007/01` (for January, 2007). + +While you can insert calendar directives anywhere on your wiki, including +in the sidebar, you'll also need to create these archive pages. They +typically use this directive to display a calendar, and also use [[inline]] +to display or list pages created in the given time frame. + +The `ikiwiki-calendar` command can be used to automatically generate the +archive pages. It also refreshes the wiki, updating the calendars to +highlight the current day. This command is typically run at midnight from +cron. An example crontab: + +An example crontab: + + 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion" ## usage diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index 8ade70004..bc1bc6c71 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -3,13 +3,9 @@ This plugin provides a [[ikiwiki/directive/calendar]] [[ikiwiki/directive]]. The directive displays a calendar, similar to the typical calendars shown on -some blogs. +some blogs. -Since ikiwiki is a wiki compiler, to keep the calendar up-to-date, -wikis that include it need to be periodically refreshed, typically by cron -at midnight. Example crontab: - - 0 0 * * * ikiwiki -setup ~/ikiwiki.setup -refresh +The [[ikiwiki-calendar]] command is used to keep the calendar up-to-date. ## CSS diff --git a/ikiwiki-calendar b/ikiwiki-calendar new file mode 100755 index 000000000..ec572cb7c --- /dev/null +++ b/ikiwiki-calendar @@ -0,0 +1,59 @@ +#!/usr/bin/perl +use warnings; +use strict; +use IkiWiki; +use IkiWiki::Setup; +use Getopt::Long; + +sub usage () { + die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [year]"), "\n"; +} + +my $force=0; +GetOptions( + "force" => \$force, +) || usage(); +my $setup=shift || usage(); +my $pagespec=shift || "*"; +my $year=shift || 1900+(localtime(time))[5]; + +%config=IkiWiki::defaultconfig(); +IkiWiki::Setup::load($setup); +IkiWiki::loadplugins(); +IkiWiki::checkconfig(); + +my $archivebase = 'archives'; +$archivebase = $config{archivebase} if defined $config{archivebase}; + +sub writearchive ($$;$) { + my $template=template(shift); + my $year=shift; + my $month=shift; + + my $page=defined $month ? "$year/$month" : $year; + + my $pagefile=newpagefile("$archivebase/$page", $config{default_pageext}); + $template->param(pagespec => $pagespec); + $template->param(year => $year); + $template->param(month => $month) if defined $month; + + if ($force || ! -e "$config{srcdir}/$pagefile") { + writefile($pagefile, $config{srcdir}, $template->output); + IkiWiki::rcs_add($pagefile) if $config{rcs}; + } +} + +IkiWiki::lockwiki(); + +foreach my $y ($year-1, $year, $year+1) { + writearchive("calendaryear.tmpl", $y); + foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) { + writearchive("calendarmonth.tmpl", $y, $m); + } +} + +IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef) + if $config{rcs}; +IkiWiki::unlockwiki(); + +system("ikiwiki", "-setup", $setup, "-refresh"); diff --git a/templates/calendarmonth.tmpl b/templates/calendarmonth.tmpl new file mode 100644 index 000000000..37ad78c5c --- /dev/null +++ b/templates/calendarmonth.tmpl @@ -0,0 +1,3 @@ +[[!calendar type=month month= year= pages=""]] + +[[!inline pages="creation_month() and creation_year() and " show=0 feeds=no reverse=yes]] diff --git a/templates/calendaryear.tmpl b/templates/calendaryear.tmpl new file mode 100644 index 000000000..714bd6d47 --- /dev/null +++ b/templates/calendaryear.tmpl @@ -0,0 +1 @@ +[[!calendar type=year year= pages=""]] -- cgit v1.2.3 From 6993d1f905c35bbad415d3f60cde924da32e80a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Oct 2009 22:58:17 -0400 Subject: response --- doc/plugins/lockedit/discussion.mdwn | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn index b058b2b07..8a08edaad 100644 --- a/doc/plugins/lockedit/discussion.mdwn +++ b/doc/plugins/lockedit/discussion.mdwn @@ -1,21 +1,8 @@ -This plugin not only locks pages but ensures too a user is logged in. This seems to me redundant with signedit. I propose : +This plugin not only locks pages but ensures too a user is logged in. This +seems to me redundant with signedit. I propose [removing the if block that +calls needsignin ]. - sub canedit ($$) { - my $page=shift; - my $cgi=shift; - my $session=shift; - - my $user=$session->param("name"); - return undef if defined $user && IkiWiki::is_admin($user); - - if (defined $config{locked_pages} && length $config{locked_pages} && - pagespec_match($page, $config{locked_pages}, - user => $session->param("name"), - ip => $ENV{REMOTE_ADDR}, - )) { - return sprintf(gettext("%s is locked and cannot be edited"), - htmllink("", "", $page, noimageinline => 1)); - } - - return undef; - } +> That was added because the most typical reason for being unable to edit a +> page is that you are not logged in. And without the jump to logging the +> user in, there is no way for the user to log in, without navigating away +> from the page they were trying to edit. --[[Joey]] -- cgit v1.2.3 From 7272938a116b2c87f8c34057034b5f4e9244cdf8 Mon Sep 17 00:00:00 2001 From: Jogo Date: Mon, 12 Oct 2009 16:44:12 -0400 Subject: --- doc/plugins/lockedit/discussion.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/lockedit/discussion.mdwn b/doc/plugins/lockedit/discussion.mdwn index 8a08edaad..867fc6a51 100644 --- a/doc/plugins/lockedit/discussion.mdwn +++ b/doc/plugins/lockedit/discussion.mdwn @@ -6,3 +6,13 @@ calls needsignin ]. > page is that you are not logged in. And without the jump to logging the > user in, there is no way for the user to log in, without navigating away > from the page they were trying to edit. --[[Joey]] + +>> Ok, but the problem is that when you don't want any signin form you end up +>> with a lone login button. That might happend if you lock pages only on IP +>> adresses, if you use another cookie from another webapp... + +>> That happends to me and I had to reimplement lockedit in my private auth +>> plugin. + +>> Perhaps you could return undef on that case and let another plugin do the +>> needsignin call ? -- [[Jogo]] -- cgit v1.2.3 From 7e25c2116cc2ababf7b099e1044dee619837dd23 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Tue, 13 Oct 2009 20:51:43 -0400 Subject: .htaccess hack --- doc/plugins/rsync/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/rsync/discussion.mdwn b/doc/plugins/rsync/discussion.mdwn index 6bf7a3826..ef0fa9967 100644 --- a/doc/plugins/rsync/discussion.mdwn +++ b/doc/plugins/rsync/discussion.mdwn @@ -47,6 +47,8 @@ The wiki now lives on (1), and clicking "edit" just works. --[[schmonz]] >> a DVCS (of which I've got at least one other), and possibly for >> other uses not yet imagined. ;-) --[[schmonz]] +>>> I'm now using this plugin for an additional purpose. One of the aforementioned wikis (there are actually two) can only be read by trusted users, the list of which is kept in an `.htaccess` file. I added it to git as `htaccess.txt`, enabled the [[plugins/txt]] plugin, and in my `rsync_command` script, have it copied to the destdir as `.htaccess` before calling `rsync`. Now my users (who aren't tech-savvy, but are trustworthy) can edit the access list directly in the wiki. This idea might also be useful for wikis not using `rsync` at all. --[[schmonz]] + ---- Revew: --[[Joey]] -- cgit v1.2.3 From cd5bf7eb7f74c2414a87c77141ed0c502ff7f464 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 15 Oct 2009 23:16:52 -0400 Subject: comments after trying to implement joey's idea --- doc/plugins/contrib/album/discussion.mdwn | 134 ++++++++++++++++++++++++++---- 1 file changed, 119 insertions(+), 15 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 5c8e74fa6..156cd7ad8 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -68,6 +68,9 @@ code or tried it yet, but here goes. --[[Joey]] > you (since the requirements for that CGI interface change depending > on the implementation). I agree that this is ugly, though. -s +>> Would you accept a version where the albumimage "viewer" pages +>> could be 0 bytes long, at least until metadata gets added? -s + * With each viewer page having next/prev links, I can see how you were having the scalability issues with ikiwiki's data structures earlier! @@ -80,7 +83,7 @@ code or tried it yet, but here goes. --[[Joey]] >> these can be presence dependencies, which will probably help with >> avoiding rebuilds of a page if the next/prev page is changed. >> (Unless you use img to make the thumbnails for those links, then it ->> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]] +>> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]] * And doesn't each viewer page really depend on every other page in the same albumsection? If a new page is added, the next/prev links @@ -108,6 +111,11 @@ code or tried it yet, but here goes. --[[Joey]] >> metadata. Er, I mean, I have a cheezy hack in `add_depends` now that does >> it to deal with a similar case. --[[Joey]] +>>> I think I was misunderstanding how early you have to call `add_depends`? +>>> The critical thing I missed was that if you're scanning a page, you're +>>> going to rebuild it in a moment anyway, so it doesn't matter if you +>>> have no idea what it depends on until the rebuild phase. -s + * One thing I do like about having individual pages per image is that they can each have their own comments, etc. @@ -121,9 +129,25 @@ code or tried it yet, but here goes. --[[Joey]] album. Think tags. So it seems it would be better to have the album directive control what pages it includes (a la inline). -> See note above about pagespecs not being very safe early on. -> You did merge my inline-with-pagenames feature, which is safe to use -> at scan time, though. +> I'm inclined to fix this by constraining images to be subpages of exactly +> one album: if they're subpages of 2+ nested albums then they're only +> considered to be in the deepest-nested one (i.e. longest URL), and if +> they're not in any album then that's a usage error. This would +> also make prev/next links sane. +> +> If you want to reference images from elsewhere in the wiki and display +> them as if in an album, then you can use an ordinary inline with +> the same template that the album would use, and I'll make sure the +> templates are set up so this works. +> +> (Implementation detail: this means that an image X/Y/Z/W/V, where X and +> Y are albums, Z does not exist and W exists but is not an album, +> would have a content dependency on Y, a presence dependency on Z +> and a content dependency on W.) +> +> Perhaps I should just restrict to having the album images be direct +> subpages of the album, although that would mean breaking some URLs +> on the existing website I'm doing all this work for... -s * Putting a few of the above thoughts together, my ideal album system seems to be one where I can just drop the images into a directory and @@ -137,15 +161,57 @@ code or tried it yet, but here goes. --[[Joey]] > Putting a JPEG in the web form is not an option from my point of > view :-) but perhaps there could just be a "web-editable" flag supplied > by plugins, and things could be changed to respect it. -> + +>> Replying to myself: would you accept patches to support +>> `hook(type => 'htmlize', editable => 0, ...)` in editpage? This would +>> essentially mean "this is an opaque binary: you can delete it +>> or rename it, and it might have its own special editing UI, but you +>> can never get it in a web form". +>> +>> On the other hand, that essentially means we need to reimplement +>> editpage in order to edit the sidecar files that contain the metadata. +>> Having already done one partial reimplementation of editpage (for +>> comments) I'm in no hurry to do another. +>> +>> I suppose another possibility would be to register hook +>> functions to be called by editpage when it loads and saves the +>> file. In this case, the loading hook would be to discard +>> the binary and use filter() instead, and the saving conversion +>> would be to write the edited content into the metadata sidecar +>> (creating it if necessary). +>> +>> I'd also need to make editpage (and also comments!) not allow the +>> creation of a file of type albumjpg, albumgif etc., which is something +>> I previously missed; and I'd need to make attachment able to +>> upload-and-rename. +>> -s + > In a way, what you really want for metadata is to have it in the album > page, so you can batch-edit the whole lot by editing one file (this > does mean that editing the album necessarily causes each of its viewers > to be rebuilt, but in practice that happens anyway). -s -> ->> Yes, that would make some sense.. It also allows putting one image in ->> two albums, with different caption etc. (Maybe for different audiences.) + +>> Replying to myself: in practice that *doesn't* happen anyway. Having +>> the metadata in the album page is somewhat harmful because it means +>> that changing the title of one image causes every viewer in the album +>> to be rebuilt, whereas if you have a metadata file per image, only +>> the album itself, plus the next and previous viewers, need +>> rebuilding. So, I think a file per image is the way to go. >> +>> Ideally we'd have some way to "batch-edit" the metadata of all +>> images in an album at once, except that would make conflict +>> resolution much more complicated to deal with; maybe just +>> give up and scream about mid-air collisions in that case? +>> (That's apparently good enough for Bugzilla, but not really +>> for ikiwiki). -s + +>> Yes, [all metadata in one file] would make some sense.. It also allows putting one image in +>> two albums, with different caption etc. (Maybe for different audiences.) +>> --[[Joey]] + +>>> Eek. No, that's not what I had in mind at all; the metadata ends up +>>> in the "viewer" page, so it's necessarily the same for all albums. -s + >> It would probably be possible to add a new dependency type, and thus >> make ikiwiki smart about noticing whether the metadata has actually >> changed, and only update those viewers where it has. But the dependency @@ -164,23 +230,26 @@ mushroom and snake. > etc as the htmlize extensions. May need some fixes to ikiwiki to support > that. --[[Joey]] +>> foo.albumjpg (etc.) for images, and foo._albummeta (with +>> `keepextension => 1`) for sidecar metadata files, seems viable. -s + Files in git repo: * index.mdwn * memes.mdwn -* memes/badger.albumimage (a renamed JPEG) +* memes/badger.albumjpg (a renamed JPEG) * memes/badger/comment_1._comment * memes/badger/comment_2._comment -* memes/mushroom.albumimage (a renamed GIF) -* memes/mushroom.meta (sidecar file with metadata) -* memes/snake.albumimage (a renamed video) +* memes/mushroom.albumgif (a renamed GIF) +* memes/mushroom._albummeta (sidecar file with metadata) +* memes/snake.albummov (a renamed video) Files in web content: * index.html * memes/index.html * memes/96x96-badger.jpg (from img) -* memes/96x96-mushroom.jpg (from img) +* memes/96x96-mushroom.gif (from img) * memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) ) * memes/badger/index.html (including comments) * memes/badger.jpg @@ -200,10 +269,28 @@ way to get them rendered anyway. > the image, as well as eg, smiley trying to munge it in sanitize. > --[[Joey]] +>> As long as nothing has a filter() hook that assumes it's already +>> text... filters are run in arbitrary order. We seem to be OK so far +>> though. +>> +>> If this is the route I take, I propose to have the result of filter() +>> be the contents of the sidecar metadata file (empty string if none), +>> with the `\[[!albumimage]]` directive (which no longer requires +>> arguments) prepended if not already present. This would mean that +>> meta directives in the metadata file would work as normal, and it +>> would be possible to insert text both before and after the viewer +>> if desired. The result of filter() would also be a sensible starting +>> point for editing, and the result of editing could be diverted into +>> the metadata file. -s + do=edit&page=memes/badger needs to not put the JPG in a text box: somehow divert or override the normal edit CGI by telling it that .albumimage files are not editable in the usual way? +> Something I missed here is that editpage also needs to be told that +> creating new files of type albumjpg, albumgif etc. is not allowed +> either! -s + Every image needs to depend on, and link to, the next and previous images, which is a bit tricky. In previous thinking about this I'd been applying the overly strict constraint that the ordered sequence of pages in each @@ -217,6 +304,9 @@ in order. > memoization to avoid each image in an album building the same list. > I sense that I may be missing a subtelty though. --[[Joey]] +>> I think I was misunderstanding how early you have to call `add_depends` +>> as mentioned above. -s + Perhaps restricting to "the images in an album A must match A/*" would be useful; then the unordered superset could just be "A/*". Your "albums via tags" idea would be nice too though, particularly for feature @@ -233,6 +323,9 @@ album, or something? > Ugh, yeah, that is a problem. Perhaps wanting to support that was just > too ambitious. --[[Joey]] +>> I propose to restrict to having images be subpages of albums, as +>> described above. -s + Requiring renaming is awkward for non-technical Windows/Mac users, with both platforms' defaults being to hide extensions; however, this could be circumvented by adding some sort of hook in attachment to turn things into @@ -244,13 +337,24 @@ extensions visible is a "don't do that then" situation :-) > with an extension. (Or allow specifying a full pagespec, > but I hesitate to seriously suggest that.) --[[Joey]] +>> I think that might be a terrifying idea for another day. If we can +>> mutate the extension during the `attach` upload, that'd be enough; +>> I don't think people who are skilled enough to use git/svn/..., +>> but not skilled enough to tell Explorer to show file extensions, +>> represent a major use case. -s + Ideally attachment could also be configured to upload into a specified underlay, so that photos don't have to be in your source-code control (you might want that, but I don't!). +> Replying to myself: perhaps best done as an orthogonal extension +> to attach? -s + Things that would be nice, and are probably possible: * make the "Edit page" link on viewers divert to album-specific CGI instead - of just failing or not appearing + of just failing or not appearing (probably possible via pagetemplate) + * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a - priori that it's secretly a JPEG + priori that it's secretly a JPEG (probably harder than it looks - you'd + have to make a directive for it and it's probably not worth it) -- cgit v1.2.3 From 969ce8c5f889f8f2696c3ed4995f021b2a6539e1 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 15 Oct 2009 23:22:18 -0400 Subject: add a bit more attribution so it's clearer what Joey wrote --- doc/plugins/contrib/album/discussion.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 156cd7ad8..50d6c8ddd 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -60,7 +60,7 @@ code or tried it yet, but here goes. --[[Joey]] * Needing to create the albumimage "viewer" pages for each photo seems like it will become a pain. Everyone will need to come up with their own automation for it, and then there's the question - of how to automate it when uploading attachments. + of how to automate it when uploading attachments. -J > There's already a script (ikiwiki-album) to populate a git > checkout with skeleton "viewer" pages; I was planning to make a @@ -73,7 +73,7 @@ code or tried it yet, but here goes. --[[Joey]] * With each viewer page having next/prev links, I can see how you were having the scalability issues with ikiwiki's data structures - earlier! + earlier! -J > Yeah, I think they're a basic requirement from a UI point of view > though (although they don't necessarily have to be full wikilinks). @@ -88,7 +88,7 @@ code or tried it yet, but here goes. --[[Joey]] * And doesn't each viewer page really depend on every other page in the same albumsection? If a new page is added, the next/prev links may need to be updated, for example. If so, there will be much - unnecessary rebuilding. + unnecessary rebuilding. -J > albumsections are just a way to insert headings into the flow of > photos, so they don't actually affect dependencies. @@ -117,7 +117,7 @@ code or tried it yet, but here goes. --[[Joey]] >>> have no idea what it depends on until the rebuild phase. -s * One thing I do like about having individual pages per image is - that they can each have their own comments, etc. + that they can each have their own comments, etc. -J > Yes; also, they can be wikilinked. I consider those to be > UI requirements. -s @@ -127,7 +127,7 @@ code or tried it yet, but here goes. --[[Joey]] album, but then anyone who can write to any other page on the wiki can add an image to it. 2: I may want an image to appear in more than one album. Think tags. So it seems it would be better to have the album - directive control what pages it includes (a la inline). + directive control what pages it includes (a la inline). -J > I'm inclined to fix this by constraining images to be subpages of exactly > one album: if they're subpages of 2+ nested albums then they're only @@ -156,7 +156,7 @@ code or tried it yet, but here goes. --[[Joey]] etc. (Real pity we can't just put arbitrary metadata into the images themselves.) This is almost pointing toward making the images first-class wiki page sources. Hey, it worked for po! :) But the metadata and editing - problems probably don't really allow that. + problems probably don't really allow that. -J > Putting a JPEG in the web form is not an option from my point of > view :-) but perhaps there could just be a "web-editable" flag supplied -- cgit v1.2.3 From bc4b8e4e239e56fedcc3cf065f7c6cbd224f7525 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 15 Oct 2009 23:27:53 -0400 Subject: not another hidden requirement... --- doc/plugins/contrib/album/discussion.mdwn | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 50d6c8ddd..9720589b4 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -69,7 +69,16 @@ code or tried it yet, but here goes. --[[Joey]] > on the implementation). I agree that this is ugly, though. -s >> Would you accept a version where the albumimage "viewer" pages ->> could be 0 bytes long, at least until metadata gets added? -s +>> could be 0 bytes long, at least until metadata gets added? +>> +>> The more I think about the "binaries as first-class pages" approach, +>> the more subtle interactions I notice with other plugins. I +>> think I'm up to needing changes to editpage, comments, attachment +>> and recentchanges, plus adjustments to img and Render (to reduce +>> duplication when thumbnailing an image with a strange extension +>> while simultaneously changing the extension, and to hardlink/copy +>> an image with a strange extension to a differing target filename +>> with the normal extension, respectively). -s * With each viewer page having next/prev links, I can see how you were having the scalability issues with ikiwiki's data structures @@ -350,6 +359,10 @@ underlay, so that photos don't have to be in your source-code control > Replying to myself: perhaps best done as an orthogonal extension > to attach? -s +> Yet another non-obvious thing this design would need to do is to find +> some way to have each change to memes/badger._albummeta show up as a +> change to memes/badger in `recentchanges`. -s + Things that would be nice, and are probably possible: * make the "Edit page" link on viewers divert to album-specific CGI instead -- cgit v1.2.3 From 002b6d2c41300052a056f4f95f417d5d0667f5ce Mon Sep 17 00:00:00 2001 From: tschwinge Date: Fri, 16 Oct 2009 03:19:55 -0400 Subject: shortcuts: local file. --- doc/plugins/shortcut/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/shortcut/discussion.mdwn b/doc/plugins/shortcut/discussion.mdwn index 4e11ce08c..2e2b1b281 100644 --- a/doc/plugins/shortcut/discussion.mdwn +++ b/doc/plugins/shortcut/discussion.mdwn @@ -9,4 +9,10 @@ Maybe use the `default_pageext` is better than hardcode .mdwn? > done, it will use `default_pageext` now --[[Joey]] +--- +Instead of modifying the [[basewiki]]'s [[shortcuts]] file for local needs -- +thus copying it at some point and losing continuity with upstream enhancements -- +what about handling a `shortcuts-local.mdwn` or `shortcuts/local.mdwn` (if such +a file exists in the wiki), and additionally process that one. Possibily a +conditional `\[[!inline]]` could be used. --[[tschwinge]] -- cgit v1.2.3 From 8dfd5289a970e2a77499a2178c493c2c233ba27e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Oct 2009 13:24:27 -0400 Subject: moderatedcomments: New plugin to allow comment moderation w/o relying on blogspam.net. --- IkiWiki/Plugin/moderatedcomments.pm | 44 +++++++++++++++++++++++++++++++++++++ debian/changelog | 2 ++ doc/plugins/comments.mdwn | 3 ++- doc/plugins/moderatedcomments.mdwn | 10 +++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 IkiWiki/Plugin/moderatedcomments.pm create mode 100644 doc/plugins/moderatedcomments.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm new file mode 100644 index 000000000..2555927b7 --- /dev/null +++ b/IkiWiki/Plugin/moderatedcomments.pm @@ -0,0 +1,44 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::moderatedcomments; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "moderatedcomments", call => \&getsetup); + hook(type => "checkcontent", id => "moderatedcomments", call => \&checkcontent); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 0, + }, + moderate_users => { + type => 'boolean', + example => 1, + description => 'Moderate comments of logged-in users?', + safe => 1, + rebuild => 0, + }, +} + +sub checkcontent (@) { + my %params=@_; + + # only handle comments + return undef unless pagespec_match($params{page}, "postcomment(*)", + location => $params{page}); + + # admins and maybe users can comment w/o moderation + my $session=$params{session}; + my $user=$session->param("name") if $session; + return undef if defined $user && (IkiWiki::is_admin($user) || + (exists $config{moderate_users} && ! $config{moderate_users})); + + return gettext("comment needs moderation"); +} + +1 diff --git a/debian/changelog b/debian/changelog index 336924317..f517111b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20091024) UNRELEASED; urgency=low * po: Fix breakage caused by changes to render code. * mdwn: Avoid trying to use multimarkdown if it is not installed. + * moderatedcomments: New plugin to allow comment moderation w/o relying + on blogspam.net. -- Joey Hess Mon, 26 Oct 2009 11:53:32 -0400 diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn index 7e2232411..b6d4d252b 100644 --- a/doc/plugins/comments.mdwn +++ b/doc/plugins/comments.mdwn @@ -45,7 +45,8 @@ There are some global options for the setup file: ## comment moderation If you enable the [[blogspam]] plugin, comments that appear spammy will be -held for moderation. Wiki admins can access the comment moderation queue +held for moderation. (Or with the [[moderatedcomments]] plugin, all +comments will be held.) Wiki admins can access the comment moderation queue via a button on their Preferences page. The comments are stored in `.ikiwiki/comments_pending/`, and can be diff --git a/doc/plugins/moderatedcomments.mdwn b/doc/plugins/moderatedcomments.mdwn new file mode 100644 index 000000000..97924d742 --- /dev/null +++ b/doc/plugins/moderatedcomments.mdwn @@ -0,0 +1,10 @@ +[[!template id=plugin name=moderatedcomments author="[[Joey]]"]] +[[!tag type/auth]] + +This plugin causes [[comments]] to be held for manual moderation. +Admins can access the comment moderation queue via their preferences page. + +By default, all comments made by anyone who is not an admin will be held +for moderation. The `moderate_users` setting can be set to false to avoid +moderating comments of logged-in users, while still moderating anonymous +comments. -- cgit v1.2.3 From 11fc28970b329334d88d3667e5b55e0d57e353ab Mon Sep 17 00:00:00 2001 From: Jogo Date: Tue, 27 Oct 2009 17:44:06 -0400 Subject: 403 response may be a "not found" too --- doc/plugins/404/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/plugins/404/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/404/discussion.mdwn b/doc/plugins/404/discussion.mdwn new file mode 100644 index 000000000..5a8e8ed85 --- /dev/null +++ b/doc/plugins/404/discussion.mdwn @@ -0,0 +1,3 @@ +With Apache, if you have a page foo/bar/baz but no foo/bar, and if you've +disabled `Indexes` option, you'll end up with a `403` response for foo/bar. +The 404 plugin doesn't try to handle that. But it should. -- [[Jogo]] -- cgit v1.2.3 From 57213fa0dbabd52001897d0b63bfb1a8d9d6926a Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Tue, 27 Oct 2009 22:22:11 -0400 Subject: Google will take a full URL, request that the plugin send it --- doc/plugins/google/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index babc919d2..39403f9f9 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -4,3 +4,8 @@ This is not very good since the default ikiwiki templates produce XHTML instead of HTML. > Fixed, thanks for the patch! --[[Joey]] + +It works to pass the whole wiki baseurl to Google, not just the +domain, and appears to be legal. I've got a wiki that'd benefit +(it's a few directories down from the root). Can the plugin be +tweaked to do this? --[[schmonz]] -- cgit v1.2.3 From 4dd50ba1bc4cb86c408ff45bbe06069e511e28fc Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Wed, 28 Oct 2009 13:52:05 +0000 Subject: update URL to mediawiki plugin --- doc/plugins/contrib/mediawiki.mdwn | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/mediawiki.mdwn b/doc/plugins/contrib/mediawiki.mdwn index 7bf1ba0df..13c2d04b2 100644 --- a/doc/plugins/contrib/mediawiki.mdwn +++ b/doc/plugins/contrib/mediawiki.mdwn @@ -1,7 +1,10 @@ [[!template id=plugin name=mediawiki author="[[sabr]]"]] [[!tag type/format]] -[The Mediawiki plugin](http://u32.net/Mediawiki_Plugin/) allows ikiwiki to -process pages written using MediaWiki markup. +The Mediawiki plugin allows ikiwiki to process pages written using MediaWiki +markup. -Available at +Available at . + +This plugin originally lived at , but that +website has disappeared. -- cgit v1.2.3 From 879f2f683e878ca859f98eb8b182002cdbc69a20 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 28 Oct 2009 20:57:27 -0400 Subject: the setup file wants `rsync_command`, not `rsync` --- doc/plugins/rsync.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn index db7fcb4f7..315b663c0 100644 --- a/doc/plugins/rsync.mdwn +++ b/doc/plugins/rsync.mdwn @@ -7,7 +7,7 @@ The command to run is specified by setting `rsync_command` in your setup file. The command will be run in your destdir, so something like this is a typical command: - rsync => 'rsync -qa --delete . user@host:/path/to/docroot/', + rsync_command => 'rsync -qa --delete . user@host:/path/to/docroot/', If using rsync over ssh, you will need to enable noninteractive ssh login to the remote host. It's also a good idea to specify the exact command line -- cgit v1.2.3 From c29957e0177c3c654a1ea1feffdba00307449560 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 29 Oct 2009 18:05:58 -0400 Subject: google: Pass the whole wiki url to google, not just the domain, so that search works correctly for wikis that are located in subdirectories of domains. --- IkiWiki/Plugin/google.pm | 9 +-------- debian/changelog | 3 +++ doc/plugins/google/discussion.mdwn | 2 ++ templates/googleform.tmpl | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 1683220e7..483fa1707 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -6,8 +6,6 @@ use strict; use IkiWiki 3.00; use URI; -my $host; - sub import { hook(type => "getsetup", id => "google", call => \&getsetup); hook(type => "checkconfig", id => "google", call => \&checkconfig); @@ -26,11 +24,6 @@ sub checkconfig () { if (! length $config{url}) { error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google')); } - my $uri=URI->new($config{url}); - if (! $uri || ! defined $uri->host) { - error(gettext("Failed to parse url, cannot determine domain name")); - } - $host=$uri->host; } my $form; @@ -43,7 +36,7 @@ sub pagetemplate (@) { if ($template->query(name => "searchform")) { if (! defined $form) { my $searchform = template("googleform.tmpl", blind_cache => 1); - $searchform->param(sitefqdn => $host); + $searchform->param(url => $config{url}); $form=$searchform->output; } diff --git a/debian/changelog b/debian/changelog index 4c8c4d6fc..f19b4eae4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ ikiwiki (3.20091024) UNRELEASED; urgency=low url is uri-encoded. Most browsers other than MSIE don't care, but it's the right thing to do. * Add a spec file to allow building rpm from the source package. + * google: Pass the whole wiki url to google, not just the domain, + so that search works correctly for wikis that are located in + subdirectories of domains. -- Joey Hess Mon, 26 Oct 2009 11:53:32 -0400 diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 39403f9f9..94fc36a35 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -9,3 +9,5 @@ It works to pass the whole wiki baseurl to Google, not just the domain, and appears to be legal. I've got a wiki that'd benefit (it's a few directories down from the root). Can the plugin be tweaked to do this? --[[schmonz]] + +> Done. --[[Joey]] diff --git a/templates/googleform.tmpl b/templates/googleform.tmpl index e2d4a1f43..bcf1004a4 100644 --- a/templates/googleform.tmpl +++ b/templates/googleform.tmpl @@ -1,6 +1,6 @@
    - +
    -- cgit v1.2.3 From 06293fc92e17cee816721a95fb3a4dfee34a3d7f Mon Sep 17 00:00:00 2001 From: "http://mcfrisk.myopenid.com/" Date: Wed, 4 Nov 2009 17:51:10 -0500 Subject: from html to ikiwiki with url compatibility --- doc/plugins/html/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/plugins/html/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/html/discussion.mdwn b/doc/plugins/html/discussion.mdwn new file mode 100644 index 000000000..5446468bb --- /dev/null +++ b/doc/plugins/html/discussion.mdwn @@ -0,0 +1,5 @@ +I'm trying to convert hand written html site to ikiwiki and maintain url compatibility. +html plugin with indexpages=1 converts all dir_name/index.html correctly dir_name urls with wiki/css +based content, but somedir/somefile.html files are only accessible as somedir/somefile/. + +How to make somedir/somefile.html accessible as somedir/somefile.html under ikiwiki? -- cgit v1.2.3 From b37bca1dffed48747f89d420798396eddc1991d7 Mon Sep 17 00:00:00 2001 From: "http://mcfrisk.myopenid.com/" Date: Thu, 5 Nov 2009 03:46:13 -0500 Subject: move forum --- doc/plugins/html/discussion.mdwn | 4 ---- 1 file changed, 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/html/discussion.mdwn b/doc/plugins/html/discussion.mdwn index 5446468bb..8b1378917 100644 --- a/doc/plugins/html/discussion.mdwn +++ b/doc/plugins/html/discussion.mdwn @@ -1,5 +1 @@ -I'm trying to convert hand written html site to ikiwiki and maintain url compatibility. -html plugin with indexpages=1 converts all dir_name/index.html correctly dir_name urls with wiki/css -based content, but somedir/somefile.html files are only accessible as somedir/somefile/. -How to make somedir/somefile.html accessible as somedir/somefile.html under ikiwiki? -- cgit v1.2.3 From 2faf2d706b98863c74fa27796f080b166ae933ba Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Thu, 5 Nov 2009 09:26:57 +0000 Subject: rm empty discussion page --- doc/plugins/html/discussion.mdwn | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/plugins/html/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/html/discussion.mdwn b/doc/plugins/html/discussion.mdwn deleted file mode 100644 index 8b1378917..000000000 --- a/doc/plugins/html/discussion.mdwn +++ /dev/null @@ -1 +0,0 @@ - -- cgit v1.2.3 From 66b46576ec097b9f10b45d4b1de18bb214cd5bd5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Nov 2009 13:48:07 -0500 Subject: Moved the postscan hook to run on the raw html of a page, before the template is filled out. This improves the search plugin's indexing, since it will not include navigational elements from the page template or sidebar. --- IkiWiki/Render.pm | 8 ++++---- debian/changelog | 4 ++++ ...y_includes_text_from_navigational_elements.mdwn | 13 +++++++++++++ doc/plugins/write.mdwn | 22 +++++++++++----------- 4 files changed, 32 insertions(+), 15 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 0889fed62..ab3a71671 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -61,6 +61,10 @@ sub backlinks ($) { sub genpage ($$) { my $page=shift; my $content=shift; + + run_hooks(postscan => sub { + shift->(page => $page, content => $content); + }); my $templatefile; run_hooks(templatefile => sub { @@ -130,10 +134,6 @@ sub genpage ($$) { $content=$template->output; - run_hooks(postscan => sub { - shift->(page => $page, content => $content); - }); - run_hooks(format => sub { $content=shift->( page => $page, diff --git a/debian/changelog b/debian/changelog index 0026d9ddc..6a5ae30ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low references. * underlay: Avoid crashing if lists of underlays (or template directories) are not configured. + * Moved the postscan hook to run on the raw html of a page, before + the template is filled out. This improves the search plugin's indexing, + since it will not include navigational elements from the page template + or sidebar. -- Joey Hess Fri, 06 Nov 2009 12:04:29 -0500 diff --git a/doc/bugs/Search_summary_includes_text_from_navigational_elements.mdwn b/doc/bugs/Search_summary_includes_text_from_navigational_elements.mdwn index 874b9ffeb..b774c4531 100644 --- a/doc/bugs/Search_summary_includes_text_from_navigational_elements.mdwn +++ b/doc/bugs/Search_summary_includes_text_from_navigational_elements.mdwn @@ -7,3 +7,16 @@ A way to name some CSS ids that should be removed in search results within the i http://leaf.dragonflybsd.org/mailarchive/users/2009-11/msg00077.html (bin attachment on that page is actually a .diff.) + +> So I was looking at this and I relized that while the search plugin used +> to use the format hook, and so there was no way to avoid it seeing all +> the gunk around the page body, it was changed a while ago for different +> reasons to use its own hook, postscan. So there's really no reason not +> to move postscan so it runs before said gunk is added to the page. +> (Aside from a small risk of breaking other third-party plugins that +> somehow use postscan.) +> +> I've implemented that in git, and it drops the navigation elements nicely. +> It's perhaps less general than allowing specific divs to be skipped from +> search, but it seems good enough. Please thank the dragonfly guys for their +> work on this. [[done]] --[[Joey]] diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index c72418c3c..2f179d46f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -201,6 +201,17 @@ like `Makefile` that have no extension. If `hook` is passed an optional "longname" parameter, this value is used when prompting a user to choose a page type on the edit page form. +### postscan + + hook(type => "postscan", id => "foo", call => \&postscan); + +This hook is called once the page has been converted to html (but before +the generated html is put in a template). The most common use is to +update search indexes. Added in ikiwiki 2.54. + +The function is passed named parameters "page" and "content". Its return +value is ignored. + ### pagetemplate hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); @@ -237,17 +248,6 @@ modify the body of a page after it has been fully converted to html. The function is passed named parameters: "page", "destpage", and "content", and should return the sanitized content. -### postscan - - hook(type => "postscan", id => "foo", call => \&postscan); - -This hook is called once the full page body is available (but before the -format hook). The most common use is to update search indexes. Added in -ikiwiki 2.54. - -The function is passed named parameters "page" and "content". Its return -value is ignored. - ### format hook(type => "format", id => "foo", call => \&format); -- cgit v1.2.3 From 9f0931ce21e5f58e2e9de0ef302beca08b8f9177 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Nov 2009 13:32:08 -0500 Subject: localstyle: New plugin, allows overrding the toplevel local.css with one that is closer to a page. I chose not to have it override style.css, because style.css is not really intended to be edited; the one from the underlay is intended to be used as a base that local.css overrides. I chose to use a plugin rather than changing the default behavior, both because I didn't want to have to worry about possibly breaking backwards compatability (though this seems unlikely), and because it seemed cleaner to not include style template parameters in the main page template code. I suppose someone might want a way to not override the toplevel local.css, but instead include it as well as foo/local.css. Probably the best way to do that would be to have foo/local.css @import ../local.css (modulo browser compatability issues). Alternatively, edit page.tmpl to always include the toplevel local.css, or swap out this plugin for another one. --- IkiWiki/Plugin/localstyle.pm | 35 +++++++++++++++++++++++++++++++++++ debian/changelog | 2 ++ doc/css.mdwn | 3 +++ doc/plugins/localstyle.mdwn | 12 ++++++++++++ templates/page.tmpl | 5 +++++ 5 files changed, 57 insertions(+) create mode 100644 IkiWiki/Plugin/localstyle.pm create mode 100644 doc/plugins/localstyle.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/localstyle.pm b/IkiWiki/Plugin/localstyle.pm new file mode 100644 index 000000000..111f4dc30 --- /dev/null +++ b/IkiWiki/Plugin/localstyle.pm @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +package IkiWiki::Plugin::localstyle; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "localstyle", call => \&getsetup); + hook(type => "pagetemplate", id => "localstyle", call => \&pagetemplate); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 1, + }, +} + +sub pagetemplate (@) { + my %params=@_; + + my $template=$params{template}; + + if ($template->query(name => "local_css")) { + my $best=bestlink($params{page}, 'local.css'); + if ($best) { + $template->param(local_css => $best); + } + } +} + +1 diff --git a/debian/changelog b/debian/changelog index 6a5ae30ab..4ab63f175 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low the template is filled out. This improves the search plugin's indexing, since it will not include navigational elements from the page template or sidebar. + * localstyle: New plugin, allows overrding the toplevel local.css + with one that is closer to a page. -- Joey Hess Fri, 06 Nov 2009 12:04:29 -0500 diff --git a/doc/css.mdwn b/doc/css.mdwn index 20790b3d1..29a335596 100644 --- a/doc/css.mdwn +++ b/doc/css.mdwn @@ -16,3 +16,6 @@ files. The [[plugins/meta]] plugin can be used to add additional style sheets to a page. + +The [[plugins/localstyle]] plugin can be used to override the toplevel +[[local.css]] for a whole section of the wiki. diff --git a/doc/plugins/localstyle.mdwn b/doc/plugins/localstyle.mdwn new file mode 100644 index 000000000..70a909d68 --- /dev/null +++ b/doc/plugins/localstyle.mdwn @@ -0,0 +1,12 @@ +[[!template id=plugin name=localstyle author="[[Joey]]"]] +[[!tag type/chrome]] + +This plugin allows styling different sections of a wiki using different +versions of the local.css [[CSS]] file. Normally this file is read from the +top level of the wiki, but with this plugin enabled, standard +[[ikiwiki/subpage/LinkingRules]] are used to find the closest local.css +file to each page. + +So, for example, to use different styling for page `foo`, as well as all +of its [[SubPages|ikiwiki/subpage]], such as `foo/bar`, create a +`foo/local.css`. diff --git a/templates/page.tmpl b/templates/page.tmpl index e71ba316d..0e73463ec 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -7,8 +7,13 @@ + + + + + -- cgit v1.2.3 From 92a6f2e5e88b513ceaa1b9083ddbf6e928122893 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 Nov 2009 00:50:59 -0500 Subject: httpauth: Add cgiauthurl setting that can be used to do http basic auth only when ikiwiki needs authentication, rather than for any access to the cgi/wiki. --- IkiWiki/Plugin/httpauth.pm | 11 +++++++++++ debian/changelog | 3 +++ doc/plugins/httpauth.mdwn | 24 ++++++++++++++++++++---- 3 files changed, 34 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index 1816c9d74..bbfff859a 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -17,6 +17,13 @@ sub getsetup () { safe => 1, rebuild => 0, }, + cgiauthurl => { + type => "string", + example => "ttp://example.com/wiki/auth/ikiwiki.cgi", + description => "url to redirect to when authentication is needed", + safe => 1, + rebuild => 0, + }, } sub auth ($$) { @@ -26,6 +33,10 @@ sub auth ($$) { if (defined $cgi->remote_user()) { $session->param("name", $cgi->remote_user()); } + elsif (defined $config{cgiauthurl}) { + IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); + exit; + } } 1 diff --git a/debian/changelog b/debian/changelog index 4ab63f175..1a703b11f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low or sidebar. * localstyle: New plugin, allows overrding the toplevel local.css with one that is closer to a page. + * httpauth: Add cgiauthurl setting that can be used to do http basic auth + only when ikiwiki needs authentication, rather than for any access to + the cgi/wiki. -- Joey Hess Fri, 06 Nov 2009 12:04:29 -0500 diff --git a/doc/plugins/httpauth.mdwn b/doc/plugins/httpauth.mdwn index 11ed223e7..77796a3d7 100644 --- a/doc/plugins/httpauth.mdwn +++ b/doc/plugins/httpauth.mdwn @@ -2,8 +2,24 @@ [[!tag type/auth]] This plugin allows HTTP basic authentication to be used to log into the -wiki. To use the plugin, your web server should be set up to perform HTTP -basic authentiation for at least the directory containing `ikiwiki.cgi`. -The authenticated user will be automatically signed into the wiki. +wiki. -This plugin is included in ikiwiki, but is not enabled by default. +## fully authenticated wiki + +One way to use the plugin is to configure your web server to require +HTTP basic authentication for any access to the directory containing the +wiki (and `ikiwiki.cgi`). The authenticated user will be automatically +signed into the wiki. This method is suitable only for private wikis. + +## separate cgiauthurl + +To use httpauth for a wiki where the content is public, and where +the `ikiwiki.cgi` needs to be usable without authentication (for searching +and so on), you can configure a separate url that is used for +authentication, via the `cgiauthurl` option in the setup file. This +url will then be redirected to whenever authentication is needed. + +A typical setup is to make an `auth` subdirectory, and symlink `ikiwiki.cgi` +into it. Then configure the web server to require authentication only for +access to the `auth` subdirectory. Then `cgiauthurl` is pointed at this +symlink. -- cgit v1.2.3 From df75c5b93a1067461b649e48cc62d4c7f4d18ec7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 25 Nov 2009 01:18:43 -0500 Subject: date: New plugin that allows inserting date directives that expand to pretty-printed dates, using the same formatting as used for page modification date display, etc. --- IkiWiki/Plugin/date.pm | 33 +++++++++++++++++++++++++++++++++ debian/changelog | 3 +++ doc/ikiwiki/directive/date.mdwn | 14 ++++++++++++++ doc/plugins/date.mdwn | 6 ++++++ 4 files changed, 56 insertions(+) create mode 100644 IkiWiki/Plugin/date.pm create mode 100644 doc/ikiwiki/directive/date.mdwn create mode 100644 doc/plugins/date.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/date.pm b/IkiWiki/Plugin/date.pm new file mode 100644 index 000000000..8f2aa73d6 --- /dev/null +++ b/IkiWiki/Plugin/date.pm @@ -0,0 +1,33 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::date; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "meta", call => \&getsetup); + hook(type => "preprocess", id => "meta", call => \&preprocess); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, +} + +sub preprocess (@) { + my $str=shift; + + eval q{use Date::Parse}; + error $@ if $@; + my $time = str2time($str); + if (! defined $time) { + error("unable to parse $str"); + } + return displaytime($time); +} + +1 diff --git a/debian/changelog b/debian/changelog index 15d56a693..10fcebbec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ ikiwiki (3.20091114) UNRELEASED; urgency=low larger for inlines of many, or complex pages. * Added (incomplete) Turkish po file. Closes: #556744 Thanks, Recai Oktaş + * date: New plugin that allows inserting date directives that expand to + pretty-printed dates, using the same formatting as used for page + modification date display, etc. -- Joey Hess Mon, 16 Nov 2009 15:46:45 -0500 diff --git a/doc/ikiwiki/directive/date.mdwn b/doc/ikiwiki/directive/date.mdwn new file mode 100644 index 000000000..df45fa840 --- /dev/null +++ b/doc/ikiwiki/directive/date.mdwn @@ -0,0 +1,14 @@ +The `date` directive is supplied by the [[!iki plugins/date desc=date]] plugin. + +This directive can be used to display a date on a page, using the same +display method that is used to display the modification date in the page +footer, and other dates in the wiki. This can be useful for consistency +of display, or if you want to embed parseable dates into the page source. + +Like the dates used by the [[meta]] directive, the date can be entered in +nearly any format, since it's parsed by [[!cpan TimeDate]]. + +For example, an update to a page with an embedded date stamp could look +like: + + Updated \[[!date "Wed, 25 Nov 2009 01:11:55 -0500"]]: mumble mumble diff --git a/doc/plugins/date.mdwn b/doc/plugins/date.mdwn new file mode 100644 index 000000000..b8dbdfee5 --- /dev/null +++ b/doc/plugins/date.mdwn @@ -0,0 +1,6 @@ +[[!template id=plugin name=date author="[[Joey]]"]] +[[!tag type/meta]] + +This plugin provides the [[ikiwiki/directive/date]] +[[ikiwiki/directive]], which provides a way to display an arbitrary date +in a page. -- cgit v1.2.3 From f4cb6edd0f4d32710e2ef6ddef7de1b06b103389 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 25 Nov 2009 01:31:44 -0500 Subject: remove info about how to manually add relativedates The date directive is a better approach. --- doc/plugins/relativedate.mdwn | 6 ------ 1 file changed, 6 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/relativedate.mdwn b/doc/plugins/relativedate.mdwn index 3ada0864b..50c96c5d7 100644 --- a/doc/plugins/relativedate.mdwn +++ b/doc/plugins/relativedate.mdwn @@ -8,9 +8,3 @@ cause a tooltip to pop up with the absolute date. This only works in browsers with javascript enabled; other browsers will show the absolute date instead. Also, this plugin can be used with other plugins like [[prettydate]] that change how the absolute date is displayed. - -If this plugin is enabled, you may also add relative dates to pages in the -wiki, by using html elements in the "relativedate" class. For example, this -will display as a relative date: - - Tue Jan 20 12:00:00 EDT 2009 -- cgit v1.2.3 From 268a2dd54cd47d6ec39c22d61baa5f6f9d40b7f5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Nov 2009 14:10:21 -0500 Subject: htmllink: allow a title attribute to be specified --- IkiWiki.pm | 9 ++++----- debian/changelog | 1 + doc/plugins/write.mdwn | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 1e9d1ca2a..611ba6f65 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1081,11 +1081,10 @@ sub htmllink ($$$;@) { } my @attrs; - if (defined $opts{rel}) { - push @attrs, ' rel="'.$opts{rel}.'"'; - } - if (defined $opts{class}) { - push @attrs, ' class="'.$opts{class}.'"'; + foreach my $attr (qw{rel class title}) { + if (defined $opts{$attr}) { + push @attrs, " $attr=\"".$opts{attr}.'"'; + } } return "$linktext"; diff --git a/debian/changelog b/debian/changelog index 10fcebbec..e31928223 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.20091114) UNRELEASED; urgency=low * date: New plugin that allows inserting date directives that expand to pretty-printed dates, using the same formatting as used for page modification date display, etc. + * htmllink: Allow a title attribute to be specified. -- Joey Hess Mon, 16 Nov 2009 15:46:45 -0500 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 2f179d46f..45f083b42 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -712,6 +712,7 @@ control some options. These are: * anchor - set to make the link include an anchor * rel - set to add a rel attribute to the link * class - set to add a css class to the link +* title - set to add a title attribute to the link #### `readfile($;$)` -- cgit v1.2.3 From 9f30da3e1cb4fef022e1ad4802a6406e61c524d4 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Mon, 30 Nov 2009 21:55:06 -0500 Subject: xslt plugin --- doc/plugins/contrib/xslt.mdwn | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 doc/plugins/contrib/xslt.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn new file mode 100644 index 000000000..406d42f4e --- /dev/null +++ b/doc/plugins/contrib/xslt.mdwn @@ -0,0 +1,37 @@ +## NAME + +IkiWiki::Plugin::xslt - ikiwiki directive to process an XML file with XSLT + +## SYNOPSIS + +\[[!xslt file="data1.xml" stylesheet="style1.xsl"]] + +## DESCRIPTION + +IkiWiki::Plugin::xslt is an IkiWiki plugin implementing a directive +to process an input XML data file with XSLT, and output the result in +the page where the directive was called. + +It is expected that the XSLT stylesheet will output valid HTML markup. + +## OPTIONS + +There are two arguments to this directive. + +* **file:** + The file which contains XML data to be processed. This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. + +* **stylesheet:** + The file which contains XSLT stylesheet to apply to the XML data. This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. + +## PREREQUISITES + + IkiWiki + XML::LibXML + XML::LibXSLT + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git + -- cgit v1.2.3 From d57ec1c6a4d2e05d2570fb273c7682d383b3b7d9 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Tue, 1 Dec 2009 11:30:03 -0500 Subject: add plugin template --- doc/plugins/contrib/xslt.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn index 406d42f4e..e26f58e38 100644 --- a/doc/plugins/contrib/xslt.mdwn +++ b/doc/plugins/contrib/xslt.mdwn @@ -1,3 +1,4 @@ +[[!template id=plugin name=xslt author="rubykat"]] ## NAME IkiWiki::Plugin::xslt - ikiwiki directive to process an XML file with XSLT -- cgit v1.2.3 From db746519ebca6495342d836a77c0664977ee0d99 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 1 Dec 2009 16:04:18 -0500 Subject: security and comments --- doc/plugins/contrib/xslt/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/plugins/contrib/xslt/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt/discussion.mdwn b/doc/plugins/contrib/xslt/discussion.mdwn new file mode 100644 index 000000000..a549681de --- /dev/null +++ b/doc/plugins/contrib/xslt/discussion.mdwn @@ -0,0 +1,16 @@ +## security + +I'm curious what the security implications of having this plugin on a +publically writable wiki are. + +First, it looks like the way it looks up the stylesheet file will happily +use a regular .mdwn wiki page as the stylsheet. Which means any user can +create a stylesheet and have it be used, without needing permission to +upload arbitrary files. That probably needs to be fixed; one way would be +to mandate that the `srcfile` has a `.xsl` extension. + +Secondly, if an attacker is able to upload a stylesheet file somehow, could +this be used to attack the server where it is built? I know that xslt is +really a full programming language, so I assume at least DOS attacks are +possible. Can it also read other arbitrary files, run other programs, etc? +--[[Joey]] -- cgit v1.2.3 From 3ca05b15d6c47446e89128b405b9ffce8a418a3c Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 1 Dec 2009 18:30:25 -0500 Subject: reply to comment --- doc/plugins/contrib/xslt/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt/discussion.mdwn b/doc/plugins/contrib/xslt/discussion.mdwn index a549681de..3288150a4 100644 --- a/doc/plugins/contrib/xslt/discussion.mdwn +++ b/doc/plugins/contrib/xslt/discussion.mdwn @@ -14,3 +14,9 @@ this be used to attack the server where it is built? I know that xslt is really a full programming language, so I assume at least DOS attacks are possible. Can it also read other arbitrary files, run other programs, etc? --[[Joey]] + +> For the first point, agreed. It should probably check that the data file has a `.xml` extension also. Will fix soon. + +> For the second point, I think the main concern would be resource usage. XSLT is a pretty limited language; it can read other XML files, but it can't run other programs so far as I know. + +> -- [[KathrynAndersen]] -- cgit v1.2.3 From cbdd0d85078eb8bc9d01698e9cc8ac24e12ca7ea Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 1 Dec 2009 18:51:10 -0500 Subject: bug fix; now checks extensions. --- doc/plugins/contrib/xslt.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn index e26f58e38..f98f8378d 100644 --- a/doc/plugins/contrib/xslt.mdwn +++ b/doc/plugins/contrib/xslt.mdwn @@ -20,10 +20,10 @@ It is expected that the XSLT stylesheet will output valid HTML markup. There are two arguments to this directive. * **file:** - The file which contains XML data to be processed. This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. + The file which contains XML data to be processed. This file *must* have a `.xml` extension (`filename.xml`). This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. * **stylesheet:** - The file which contains XSLT stylesheet to apply to the XML data. This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. + The file which contains XSLT stylesheet to apply to the XML data. This file *must* have a `.xsl` extension (`filename.xsl`). This file is searched for using the usual IkiWiki mechanism, thus finding the file first in the same directory as the page, then in the directory above, and so on. ## PREREQUISITES -- cgit v1.2.3 From 18840f67e991e48e1c78bf848ce3dd50a649569b Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 1 Dec 2009 18:51:48 -0500 Subject: now have fixed xslt plugin --- doc/plugins/contrib/xslt/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt/discussion.mdwn b/doc/plugins/contrib/xslt/discussion.mdwn index 3288150a4..9cda02f88 100644 --- a/doc/plugins/contrib/xslt/discussion.mdwn +++ b/doc/plugins/contrib/xslt/discussion.mdwn @@ -15,7 +15,7 @@ really a full programming language, so I assume at least DOS attacks are possible. Can it also read other arbitrary files, run other programs, etc? --[[Joey]] -> For the first point, agreed. It should probably check that the data file has a `.xml` extension also. Will fix soon. +> For the first point, agreed. It should probably check that the data file has a `.xml` extension also. Have now fixed. > For the second point, I think the main concern would be resource usage. XSLT is a pretty limited language; it can read other XML files, but it can't run other programs so far as I know. -- cgit v1.2.3 From 6eb35262d5c2cd3a9b24029d958cc24743ccd64f Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 1 Dec 2009 20:55:25 -0500 Subject: clearing up a bit of confusion about who I am --- doc/plugins/contrib/xslt.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn index f98f8378d..c30e618ea 100644 --- a/doc/plugins/contrib/xslt.mdwn +++ b/doc/plugins/contrib/xslt.mdwn @@ -1,4 +1,4 @@ -[[!template id=plugin name=xslt author="rubykat"]] +[[!template id=plugin name=xslt author="[[rubykat]]"]] ## NAME IkiWiki::Plugin::xslt - ikiwiki directive to process an XML file with XSLT -- cgit v1.2.3 From 5d68ee9e4e920ef3756c7489fd84eafd1b332f87 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 2 Dec 2009 00:43:47 -0500 Subject: here be a plugin for processing POD! --- doc/plugins/contrib/pod.mdwn | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/plugins/contrib/pod.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn new file mode 100644 index 000000000..648e3b0c2 --- /dev/null +++ b/doc/plugins/contrib/pod.mdwn @@ -0,0 +1,35 @@ +## NAME + +IkiWiki::Plugin::pod - process pages written in POD format. + +## SYNOPSIS + +In the ikiwiki setup file, enable this plugin by adding it to the +list of active plugins. + + add_plugins => [qw{goodstuff pod ....}], + +## DESCRIPTION + +IkiWiki::Plugin::pod is an IkiWiki plugin enabling ikiwiki to +process pages written in POD (Plain Old Documentation) format. +This will treat files with a `.pod` or `.pm` extension as files +which contain POD markup. + +## OPTIONS + +The following options can be set in the ikiwiki setup file. + +* **pod_index:** If true, this will generate an index (table of contents) for the page. +* **pod_toplink:** The label to be used for links back to the top of the page. If this is empty, then no top-links will be generated. + +## PREREQUISITES + + IkiWiki + Pod::Xhtml + IO::String + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From 11a6112b561a5624b30cb587a067d35e0098c21d Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 2 Dec 2009 00:45:23 -0500 Subject: added the proper template thingie --- doc/plugins/contrib/pod.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index 648e3b0c2..5ca1b3347 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -1,3 +1,4 @@ +[[!template id=plugin name=pod author="[[rubykat]]"]] ## NAME IkiWiki::Plugin::pod - process pages written in POD format. -- cgit v1.2.3 From c4b7d046690a7d35f5f6dc73fcbc83b72bc95f42 Mon Sep 17 00:00:00 2001 From: "http://lj.rossia.org/users/imz/" Date: Wed, 2 Dec 2009 13:08:42 -0500 Subject: minor: a link to describe the format --- doc/plugins/contrib/pod.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index 5ca1b3347..dafffa844 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -13,7 +13,7 @@ list of active plugins. ## DESCRIPTION IkiWiki::Plugin::pod is an IkiWiki plugin enabling ikiwiki to -process pages written in POD (Plain Old Documentation) format. +process pages written in POD ([Plain Old Documentation](http://en.wikipedia.org/wiki/Plain_Old_Documentation)) format. This will treat files with a `.pod` or `.pm` extension as files which contain POD markup. -- cgit v1.2.3 From 917b8e5ba17ba4b0c9a2cf5c12781f1880d02ff5 Mon Sep 17 00:00:00 2001 From: "http://lj.rossia.org/users/imz/" Date: Wed, 2 Dec 2009 13:20:43 -0500 Subject: minor: a link to describe the mentioned format --- doc/plugins/table.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index 7b080acda..10a85bb2c 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -3,6 +3,6 @@ This plugin provides the [[ikiwiki/directive/table]] [[ikiwiki/directive]]. It can build HTML tables from data in CSV (comma-separated values) -or DSV (delimiter-separated values) format. +or DSV ([delimiter-separated values](http://en.wikipedia.org/wiki/Delimiter-separated_values)) format. It needs the perl module [[!cpan Text::CSV]] for the CSV data. -- cgit v1.2.3 From 658da70f6aa52331389566cd1824e8342264dfe5 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 4 Dec 2009 04:09:44 -0500 Subject: added field plugin --- doc/plugins/contrib/field.mdwn | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/plugins/contrib/field.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field.mdwn b/doc/plugins/contrib/field.mdwn new file mode 100644 index 000000000..f7c2f4b1b --- /dev/null +++ b/doc/plugins/contrib/field.mdwn @@ -0,0 +1,97 @@ +[[!template id=plugin name=pod author="[[rubykat]]"]] +[[!toc]] +## NAME + +IkiWiki::Plugin::field - front-end for per-page record fields. + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff field ....}], + + # simple registration + field_register => [qw{meta}], + +## DESCRIPTION + +This plugin is meant to be used in conjunction with other plugins +in order to provide a uniform interface to access per-page structured +data, where each page is treated like a record, and the structured data +are fields in that record. This can include the meta-data for that page, +such as the page title. + +Plugins can register a function which will return the value of a "field" for +a given page. This can be used in three ways: + +* In page templates; all registered fields will be passed to the page template in the "pagetemplate" processing. +* In PageSpecs; the "field" function can be used to match the value of a field in a page. +* By other plugins, using the field_get_value function, to get the value of a field for a page, and do with it what they will. + +## OPTIONS + +The following options can be set in the ikiwiki setup file. + +**field_register** + +A list of plugin-IDs to register. This assumes that the plugins in +question store data in the %pagestatus hash using the ID of that plugin, +and thus the field values are looked for there. + +This is the simplest form of registration, but the advantage is that it +doesn't require the plugin to be modified in order for it to be +registered with the "field" plugin. + +## PageSpec + +The "field" PageSpec function can be used to match the value of a field for a page. + +field(*name* *glob*) + +For example: + +field(bar Foo*) will match if the "bar" field starts with "Foo". + +## FUNCTIONS + +### field_register + +field_register(id=>$id); + +Register a plugin as having field data. The above form is the simplest, where the field value +is looked up in the %pagestatus hash under the plugin-id. + +Additional Options: + +**call=>&myfunc** + +A reference to a function to call rather than just looking up the value in the %pagestatus hash. +It takes two arguments: the name of the field, and the name of the page. It is expected to return +the value of that field, or undef if there is no field by that name. + + sub myfunc ($$) { + my $field = shift; + my $page = shift; + + ... + + return $value; + } + +**first=>1** + +Set this to be called first in the sequence of calls looking for values. Since the first found +value is the one which is returned, ordering is significant. + +**last=>1** + +Set this to be called last in the sequence of calls looking for values. Since the first found +value is the one which is returned, ordering is significant. + +### field_get_value($field, $page) + +Returns the value of the field for that page, or undef if none is found. + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From 2a4f37b4622bd5ce8e2c153fff2ae5d1d57f57de Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 4 Dec 2009 04:11:12 -0500 Subject: oops, fixed name --- doc/plugins/contrib/field.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field.mdwn b/doc/plugins/contrib/field.mdwn index f7c2f4b1b..745a36bcd 100644 --- a/doc/plugins/contrib/field.mdwn +++ b/doc/plugins/contrib/field.mdwn @@ -1,4 +1,4 @@ -[[!template id=plugin name=pod author="[[rubykat]]"]] +[[!template id=plugin name=field author="[[rubykat]]"]] [[!toc]] ## NAME -- cgit v1.2.3 From a3803f3cd82af36b77a8ee718f9057515adf05ea Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/schmonz" Date: Fri, 11 Dec 2009 21:59:08 -0500 Subject: on my unixauth branch now --- doc/plugins/contrib/unixauth.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/unixauth.mdwn b/doc/plugins/contrib/unixauth.mdwn index 137195139..c97312b59 100644 --- a/doc/plugins/contrib/unixauth.mdwn +++ b/doc/plugins/contrib/unixauth.mdwn @@ -1,7 +1,7 @@ [[!template id=plugin name=unixauth core=0 author="[[schmonz]]"]] [[!tag type/auth]] -[[!template id=gitbranch branch=schmonz author="[[schmonz]]"]] +[[!template id=gitbranch branch=unixauth author="[[schmonz]]"]] This plugin authenticates users against the Unix user database. It presents a similar UI to [[plugins/passwordauth]], but simpler, as there's no need to be able to register or change one's password. -- cgit v1.2.3 From 5b48f1412e8117372af081c513b8c8a41176d4e7 Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/kari.pahula" Date: Sat, 12 Dec 2009 06:33:21 -0500 Subject: Getting OpenID verified identity externally --- doc/plugins/openid/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/openid/discussion.mdwn b/doc/plugins/openid/discussion.mdwn index 39e947b82..a88da8b9d 100644 --- a/doc/plugins/openid/discussion.mdwn +++ b/doc/plugins/openid/discussion.mdwn @@ -19,3 +19,8 @@ It looks like OpenID 2.0 (the only supported by Yahoo) is not supported in ikiwi -- Ivan Z. They have more on OpenID 2.0 in [their FAQ](http://developer.yahoo.com/openid/faq.html). --Ivan Z. + +---- +I'm trying to add a way to query the data saved by the OpenID plugin from outside of ikiwiki, to see what identity the user has been authenticated as, if any. I'm thinking of designating some directories as internal pages and check the identity against a list in a mod_perl access hook. I would also write a CGI script that would return a JSON formatted reply to tell if the user is authenticated for those pages and query it with AJAX and only render links to the internal pages if the user would have access to them. That's just a couple of ideas I'm working on first, but I can imagine that there's any number of other tricks that people could implement with that sort of a thing. + +Also, this isn't really specific to OpenID but to all auth plugins, but I'm going to use only OpenID for authentication so that's what I'm targeting right now. I suppose that would be worth its own TODO item. --[[kaol]] -- cgit v1.2.3 From 407a94c6a6d5ea125f5c31787799c864e2c1b7f0 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 23 Dec 2009 15:07:11 +0000 Subject: added tag --- doc/plugins/contrib/pod.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index dafffa844..d6fdf4b63 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -34,3 +34,6 @@ The following options can be set in the ikiwiki setup file. * browse at GitHub: * git repo at git://github.com/rubykat/ikiplugins.git + +---- +[[!taglink format]] -- cgit v1.2.3 From 85eab3e9ff30ba42307a53bf22ef72ce87e18616 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 23 Dec 2009 15:08:14 +0000 Subject: try again with tag --- doc/plugins/contrib/pod.mdwn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index d6fdf4b63..19b0111df 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=pod author="[[rubykat]]"]] +[[!tag format]] ## NAME IkiWiki::Plugin::pod - process pages written in POD format. @@ -35,5 +36,3 @@ The following options can be set in the ikiwiki setup file. * browse at GitHub: * git repo at git://github.com/rubykat/ikiplugins.git ----- -[[!taglink format]] -- cgit v1.2.3 From 01e744af0f099fcf28d9cf0bc0f090262c092bdf Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 23 Dec 2009 15:09:59 +0000 Subject: third time lucky? --- doc/plugins/contrib/pod.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index 19b0111df..97a9c648a 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=pod author="[[rubykat]]"]] -[[!tag format]] +[[!tag type/format]] ## NAME IkiWiki::Plugin::pod - process pages written in POD format. -- cgit v1.2.3 From c7e822a4962c36a3f26e1f0413734b2e67e2e607 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 23 Dec 2009 15:13:04 +0000 Subject: added tag --- doc/plugins/contrib/field.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field.mdwn b/doc/plugins/contrib/field.mdwn index 745a36bcd..a43bf24b2 100644 --- a/doc/plugins/contrib/field.mdwn +++ b/doc/plugins/contrib/field.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=field author="[[rubykat]]"]] +[[!tag type/meta]] [[!toc]] ## NAME -- cgit v1.2.3 From c4a2d93115b6a7826b21f13b9d29bd947551c6c6 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 23 Dec 2009 15:14:57 +0000 Subject: added tag --- doc/plugins/contrib/xslt.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn index c30e618ea..80c956c58 100644 --- a/doc/plugins/contrib/xslt.mdwn +++ b/doc/plugins/contrib/xslt.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=xslt author="[[rubykat]]"]] +[[!tag type/chrome]] ## NAME IkiWiki::Plugin::xslt - ikiwiki directive to process an XML file with XSLT -- cgit v1.2.3 From cf26aa6bc76ada153b265ef7851eacb1c6f2417e Mon Sep 17 00:00:00 2001 From: "http://weakish.pigro.net/" Date: Thu, 24 Dec 2009 08:46:40 +0000 Subject: question: "still domain specific or not?" --- doc/plugins/google/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 94fc36a35..32a0a41b9 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -11,3 +11,12 @@ domain, and appears to be legal. I've got a wiki that'd benefit tweaked to do this? --[[schmonz]] > Done. --[[Joey]] + +The main page said: + +> Also, if the same domain has other content, outside the wiki's +> content, it will be searched as well. + +Is it still true now? (Or this statement is out of date?) --[weakish] + +[weakish]: http://weakish.pigro.net -- cgit v1.2.3 From d35bf0be6765d692d97769cd2d81ed143c8e9036 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Dec 2009 15:08:22 -0500 Subject: correction --- doc/plugins/google.mdwn | 3 +-- doc/plugins/google/discussion.mdwn | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/google.mdwn b/doc/plugins/google.mdwn index 7c61e637b..349c278ee 100644 --- a/doc/plugins/google.mdwn +++ b/doc/plugins/google.mdwn @@ -5,8 +5,7 @@ This plugin adds a search form to the wiki, using google's site search. Google is asked to search for pages in the domain specified in the wiki's `url` configuration parameter. Results will depend on whether google has -indexed the site, and how recently. Also, if the same domain has other -content, outside the wiki's content, it will be searched as well. +indexed the site, and how recently. The [[search]] plugin offers full text search of only the wiki, but requires that a search engine be installed on your site. diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 32a0a41b9..e664f5723 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -20,3 +20,6 @@ The main page said: Is it still true now? (Or this statement is out of date?) --[weakish] [weakish]: http://weakish.pigro.net + +> I checked, and it's never been true; google is given the url to the top +> of the wiki and only searches things in there. --[[Joey]] -- cgit v1.2.3 From 0c89eabcf5a7f9dd881abc8a8cb5f2271ec4e01e Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 00:37:56 +0000 Subject: more options for field configuration, additional pagespec test --- doc/plugins/contrib/field.mdwn | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field.mdwn b/doc/plugins/contrib/field.mdwn index a43bf24b2..09646d28a 100644 --- a/doc/plugins/contrib/field.mdwn +++ b/doc/plugins/contrib/field.mdwn @@ -13,6 +13,9 @@ IkiWiki::Plugin::field - front-end for per-page record fields. # simple registration field_register => [qw{meta}], + # allow the config to be queried as a field + field_allow_config => 1, + ## DESCRIPTION This plugin is meant to be used in conjunction with other plugins @@ -32,8 +35,17 @@ a given page. This can be used in three ways: The following options can be set in the ikiwiki setup file. +**field_allow_config** + + field_allow_config => 1, + +Allow the $config hash to be queried like any other field; the +keys of the config hash are the field names. + **field_register** + field_register => [qw{meta}], + A list of plugin-IDs to register. This assumes that the plugins in question store data in the %pagestatus hash using the ID of that plugin, and thus the field values are looked for there. @@ -46,12 +58,17 @@ registered with the "field" plugin. The "field" PageSpec function can be used to match the value of a field for a page. -field(*name* *glob*) +**field(*name* *glob*)** For example: field(bar Foo*) will match if the "bar" field starts with "Foo". +**destfield(*name* *glob*)** + +is the same, except that it tests the destination page (that is, in cases +when the source page is being included in another page). + ## FUNCTIONS ### field_register -- cgit v1.2.3 From 9ccd1ba41bff43c1a5d06197b454c8748224e30f Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:20:34 +0000 Subject: ymlfront: backend for structured data --- doc/plugins/contrib/ymlfront.mdwn | 99 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 doc/plugins/contrib/ymlfront.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront.mdwn b/doc/plugins/contrib/ymlfront.mdwn new file mode 100644 index 000000000..f4438f23c --- /dev/null +++ b/doc/plugins/contrib/ymlfront.mdwn @@ -0,0 +1,99 @@ +[[!template id=plugin name=ymlfront author="[[rubykat]]"]] +[[!tag type/meta]] +[[!toc]] +## NAME + +IkiWiki::Plugin::ymlfront - add YAML-format data to a page + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff ymlfront ....}], + +## DESCRIPTION + +This plugin provides a way of adding arbitrary meta-data (data fields) to any +page by prefixing the page with a YAML-format document. This provides a way to +create per-page structured data, where each page is treated like a record, and +the structured data are fields in that record. This can include the meta-data +for that page, such as the page title. + +This plugin is meant to be used in conjunction with the [[field]] plugin. + +## DETAILS + +The YAML-format data in a page must be placed at the start of the page +and delimited by lines containing precisely three dashes. The "normal" +content of the page then follows. + +For example: + + --- + title: Foo does not work + Urgency: High + Status: Assigned + AssignedTo: Fred Nurk + Version: 1.2.3 + --- + When running on the Sprongle system, the Foo function returns incorrect data. + +What will normally be displayed is everything following the second line of dashes. +That will be htmlized using the page-type of the page-file. + +### Accessing the Data + +There are three ways to access the data given in the YAML section. + +* [[getfield]] plugin + + The **getfield** plugin can display the data as individual variable values. + + For example: + + --- + title: Foo does not work + Urgency: High + Status: Assigned + AssignedTo: Fred Nurk + Version: 1.2.3 + --- + # {{$title}} + + **Urgency:** {{$Urgency}}\\ + **Status:** {{$Status}}\\ + **Assigned To:** {{$AssignedTo}}\\ + **Version:** {{$Version}} + + When running on the Sprongle system, the Foo function returns incorrect data. + +* [[ftemplate]] plugin + + The **ftemplate** plugin is like the [[plugins/template]] plugin, but it is also aware of [[field]] values. + + For example: + + --- + title: Foo does not work + Urgency: High + Status: Assigned + AssignedTo: Fred Nurk + Version: 1.2.3 + --- + \[[!ftemplate id="bug_display_template"]] + + When running on the Sprongle system, the Foo function returns incorrect data. + +* write your own plugin + + In conjunction with the [[field]] plugin, you can write your own plugin to access the data. + +## PREREQUISITES + + IkiWiki + IkiWiki::Plugin::field + YAML::Any + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From ccc8e8868269bf2751596e04f792c388acb85c12 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:27:59 +0000 Subject: getfield: query field (meta-data) values --- doc/plugins/contrib/getfield.mdwn | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doc/plugins/contrib/getfield.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn new file mode 100644 index 000000000..ed03dc439 --- /dev/null +++ b/doc/plugins/contrib/getfield.mdwn @@ -0,0 +1,85 @@ +[[!template id=plugin name=getfield author="[[rubykat]]"]] +[[!tag type/meta]] +[[!toc]] +## NAME + +IkiWiki::Plugin::getfield - query the values of fields + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff getfield ....}], + +## DESCRIPTION + +This plugin provides a way of querying the meta-data (data fields) of a page +inside the page content (rather than inside a template) This provides a way to +use per-page structured data, where each page is treated like a record, and the +structured data are fields in that record. This can include the meta-data for +that page, such as the page title. + +This plugin is meant to be used in conjunction with the B plugin. + +### USAGE + +One can get the value of a field by using special markup in the page. +This does not use directive markup, in order to make it easier to +use the markup inside other directives. There are two forms: + +* {{$*fieldname*}} + + This queries the value of *fieldname* for the source page. + + For example: + + \[[!meta title="My Long and Complicated Title With Potential For Spelling Mistakes"]] + # {{$title}} + + When the page is processed, this will give you: + +

    My Long and Complicated Title With Potential For Spelling Mistakes

    + +* {{+$*fieldname*+}} + + This queries the value of *fieldname* for the destination page; that is, + the value when this page is included inside another page. + + For example: + + On PageA: + + \[[!meta title="I Am Page A"]] + # {{+$title+}} + + Stuff about A. + + On PageB: + + \[[!meta title="I Am Page B"]] + \[[!inline pagespec="PageA"]] + + When PageA is displayed: + +

    I Am Page A

    +

    Stuff about A.

    + + When PageB is displayed: + +

    I Am Page B

    +

    Stuff about A.

    + +### More Examples + +Listing all the sub-pages of the current page: + + \[[!map pages="{{$page}}/*"]] + +### LIMITATIONS + +One cannot query the values of fields on pages other than the current +page or the destination page. + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From 7d997f1007b240c14c04ff73b09a2a62fa3e64ad Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:36:28 +0000 Subject: ftemplate: field-aware structured template plugin --- doc/plugins/contrib/ftemplate.mdwn | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 doc/plugins/contrib/ftemplate.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate.mdwn b/doc/plugins/contrib/ftemplate.mdwn new file mode 100644 index 000000000..bcc6f2c67 --- /dev/null +++ b/doc/plugins/contrib/ftemplate.mdwn @@ -0,0 +1,94 @@ +[[!template id=plugin name=ftemplate author="[[rubykat]]"]] +[[!tag type/meta type/format]] +[[!toc]] +## NAME + +IkiWiki::Plugin::ftemplate - field-aware structured template plugin + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff ftemplate ....}], + +## DESCRIPTION + +This plugin provides the **ftemplate** directive. This is like +the [[ikiwiki/directive/template]] directive, with the addition that one does not +have to provide all the values in the call to the template, +because ftemplate can query structured data ("fields") using +the [[field]] plugin. + +Templates are files that can be filled out and inserted into pages in +the wiki, by using the ftemplate directive. The directive has an id +parameter that identifies the template to use. + +Additional parameters can be used to fill out the template, in +addition to the "field" values. Passed-in values override the +"field" values. + +There are two places where template files can live. One is, as with the +[[plugins/template]] plugin, in the /templates directory on the wiki. These +templates are wiki pages, and can be edited from the web like other wiki +pages. + +The second place where template files can live is in the global +templates directory (the same place where the page.tmpl template lives). +This is a useful place to put template files if you want to prevent +them being edited from the web, and you don't want to have to make +them work as wiki pages. + +### EXAMPLES + +#### Example 1 + +PageA: + + [[!meta title="I Am Page A"]] + [[!meta description="A is for Apple."]] + [[!meta author="Fred Nurk"]] + [[!ftemplate id="mytemplate"]] + +Template "mytemplate": + + # + by + + **Summary:** + +This will give: + +

    I Am Page A

    +

    by Fred Nurk

    +

    Summary: A is for Apple. + +#### Example 2: Overriding values + +PageB: + + [[!meta title="I Am Page B"]] + [[!meta description="B is for Banana."]] + [[!meta author="Fred Nurk"]] + [[!ftemplate id="mytemplate" title="Bananananananas"]] + +This will give: + +

    Bananananananas

    +

    by Fred Nurk

    +

    Summary: B is for Banana. + +### LIMITATIONS + +One cannot query the values of fields on pages other than the current +page. + +## PREREQUISITES + + IkiWiki + IkiWiki::Plugin::field + HTML::Template + Encode + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From a3527672769b93eeb4a70fbe9f316c986706c375 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:37:27 +0000 Subject: fixed title --- doc/plugins/contrib/ftemplate.mdwn | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate.mdwn b/doc/plugins/contrib/ftemplate.mdwn index bcc6f2c67..fba51e1c2 100644 --- a/doc/plugins/contrib/ftemplate.mdwn +++ b/doc/plugins/contrib/ftemplate.mdwn @@ -43,10 +43,10 @@ them work as wiki pages. PageA: - [[!meta title="I Am Page A"]] - [[!meta description="A is for Apple."]] - [[!meta author="Fred Nurk"]] - [[!ftemplate id="mytemplate"]] + \[[!meta title="I Am Page A"]] + \[[!meta description="A is for Apple."]] + \[[!meta author="Fred Nurk"]] + \[[!ftemplate id="mytemplate"]] Template "mytemplate": @@ -65,10 +65,10 @@ This will give: PageB: - [[!meta title="I Am Page B"]] - [[!meta description="B is for Banana."]] - [[!meta author="Fred Nurk"]] - [[!ftemplate id="mytemplate" title="Bananananananas"]] + \[[!meta title="I Am Page B"]] + \[[!meta description="B is for Banana."]] + \[[!meta author="Fred Nurk"]] + \[[!ftemplate id="mytemplate" title="Bananananananas"]] This will give: -- cgit v1.2.3 From 2cbf60a431d41b3cb0767f1c0fb1ecf50103bcb0 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:38:33 +0000 Subject: correcting link --- doc/plugins/contrib/getfield.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn index ed03dc439..5e6b01113 100644 --- a/doc/plugins/contrib/getfield.mdwn +++ b/doc/plugins/contrib/getfield.mdwn @@ -81,5 +81,5 @@ page or the destination page. ## DOWNLOAD -* browse at GitHub: +* browse at GitHub: * git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From f90827f29bc1682bf3682375972f5cc836049dc7 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:47:59 +0000 Subject: this is sort of format too --- doc/plugins/contrib/getfield.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn index 5e6b01113..302569f4b 100644 --- a/doc/plugins/contrib/getfield.mdwn +++ b/doc/plugins/contrib/getfield.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=getfield author="[[rubykat]]"]] -[[!tag type/meta]] +[[!tag type/meta type/format]] [[!toc]] ## NAME -- cgit v1.2.3 From 4f25d90ebc2d3ff2ad7a5d7bd8578a6c4d673aa8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Jan 2010 18:56:05 -0500 Subject: mention that lighttpd does support this. Example needed. --- doc/plugins/po.mdwn | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f3b70b5f7..da85636ec 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -129,11 +129,10 @@ For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/conte lighttpd -------- -lighttpd unfortunately does not support content negotiation. - -**FIXME**: does `mod_magnet` provide the functionality needed to - emulate this? +Recent versions of lighttpd should be able to use +`$HTTP["language"]` to configure the translatted pages to be served. +TODO: Example Usage ===== -- cgit v1.2.3 From 65db2f47acfe5815952bb0bfbdbe15b5cf5ce7be Mon Sep 17 00:00:00 2001 From: Spida Date: Fri, 15 Jan 2010 00:15:33 +0000 Subject: --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index da85636ec..576d36ec1 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -132,6 +132,8 @@ lighttpd Recent versions of lighttpd should be able to use `$HTTP["language"]` to configure the translatted pages to be served. +See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119) + TODO: Example Usage -- cgit v1.2.3 From a1138ae820d3ea121cbd28552a3300631179b0a5 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sat, 16 Jan 2010 05:19:42 +0000 Subject: the pod bold thingy didn't work, making it a markdown one --- doc/plugins/contrib/getfield.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn index 302569f4b..929f70485 100644 --- a/doc/plugins/contrib/getfield.mdwn +++ b/doc/plugins/contrib/getfield.mdwn @@ -18,7 +18,7 @@ use per-page structured data, where each page is treated like a record, and the structured data are fields in that record. This can include the meta-data for that page, such as the page title. -This plugin is meant to be used in conjunction with the B plugin. +This plugin is meant to be used in conjunction with the **field** plugin. ### USAGE -- cgit v1.2.3 From 353f722dc439a14d7e74dab9ca2818f955ff4d41 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sat, 16 Jan 2010 05:29:53 +0000 Subject: --- doc/plugins/contrib/getfield/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/plugins/contrib/getfield/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn new file mode 100644 index 000000000..61b9f5378 --- /dev/null +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -0,0 +1,3 @@ +## Templating, and other uses + +Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If it can be made to work anywhere, or from a specific place in the wiki - configurable, possibly - you'll have something very similar to mediawiki's templates. I can already think of a few uses for this combined with [[template]] ;) . --[[SR|users/simonraven]] -- cgit v1.2.3 From 3b2772967fdb125bb8160f968729681b7af13269 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sat, 16 Jan 2010 08:08:46 +0000 Subject: responded to discussion --- doc/plugins/contrib/getfield/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 61b9f5378..78462197a 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -1,3 +1,12 @@ ## Templating, and other uses Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If it can be made to work anywhere, or from a specific place in the wiki - configurable, possibly - you'll have something very similar to mediawiki's templates. I can already think of a few uses for this combined with [[template]] ;) . --[[SR|users/simonraven]] + +> Yes, I mentioned "only current page" in the "LIMITATIONS" section. + +> What do you think would be a good syntax for querying other pages? +> It needs to resolve to a single page, though I guess using "bestlink" to find the closest page would mean that one didn't have to spell out the whole page. + +> I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. + +> -- [[users/KathrynAndersen]] -- cgit v1.2.3 From e3a09318a0686a7e3d01206f56ca6019c3c198e0 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sat, 16 Jan 2010 08:42:56 +0000 Subject: --- doc/plugins/contrib/getfield/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 78462197a..f3c844e94 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -7,6 +7,10 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i > What do you think would be a good syntax for querying other pages? > It needs to resolve to a single page, though I guess using "bestlink" to find the closest page would mean that one didn't have to spell out the whole page. +>> I don't know the internals very well, I think that's how other plugins do it. *goes to check* Usually it's a `foreach` loop, and use a `pagestate{foo}` to check the page's status/state. There's also some stuff like 'pagespec_match_list($params{page}` ... they do slightly different thing depending on need. --[[SR|users/simonraven]] + > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. > -- [[users/KathrynAndersen]] + +>> Ooh, sounds nice :) . --[[SR|users/simonraven]] -- cgit v1.2.3 From 354468d280354234d9c8c91333534c9784f427cf Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sun, 17 Jan 2010 00:10:55 +0000 Subject: respond: markup, not internals --- doc/plugins/contrib/getfield/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index f3c844e94..37d65d851 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -9,6 +9,11 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >> I don't know the internals very well, I think that's how other plugins do it. *goes to check* Usually it's a `foreach` loop, and use a `pagestate{foo}` to check the page's status/state. There's also some stuff like 'pagespec_match_list($params{page}` ... they do slightly different thing depending on need. --[[SR|users/simonraven]] +>>> No, I meant what markup I should use; the actual implementation probably wouldn't be too difficult. + +>>> The current markup is {{$*fieldname*}}; what you're wanting, perhaps it should be represented like {{$*pagename*:*fieldname*}}, or {{$*pagename*::*fieldname*}} or something else... +>>> -- [[KathrynAndersen]] + > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. > -- [[users/KathrynAndersen]] -- cgit v1.2.3 From b3363aa89f840fd42b8a621b011326ef41b73513 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 17 Jan 2010 09:28:07 +0000 Subject: --- doc/plugins/contrib/getfield/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 37d65d851..9f1337046 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -14,6 +14,8 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >>> The current markup is {{$*fieldname*}}; what you're wanting, perhaps it should be represented like {{$*pagename*:*fieldname*}}, or {{$*pagename*::*fieldname*}} or something else... >>> -- [[KathrynAndersen]] +>>>> Oh. Hmm. I like your idea actually, or alternately, in keeping more with other plugins, doing it like {{pagename/fieldname}}. The meaning is less clear that way, but avoids potential issues with filename clashes that have a colon in them. It also keeps a certain logic - at least to me. Either way, I think both are good choices. + > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. > -- [[users/KathrynAndersen]] -- cgit v1.2.3 From 2137d1f68c694af6135d0d84b59bbfbcffe36669 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 17 Jan 2010 09:31:07 +0000 Subject: --- doc/plugins/contrib/getfield/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 9f1337046..42338a3c7 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -14,7 +14,7 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >>> The current markup is {{$*fieldname*}}; what you're wanting, perhaps it should be represented like {{$*pagename*:*fieldname*}}, or {{$*pagename*::*fieldname*}} or something else... >>> -- [[KathrynAndersen]] ->>>> Oh. Hmm. I like your idea actually, or alternately, in keeping more with other plugins, doing it like {{pagename/fieldname}}. The meaning is less clear that way, but avoids potential issues with filename clashes that have a colon in them. It also keeps a certain logic - at least to me. Either way, I think both are good choices. +>>>> Oh. Hmm. I like your idea actually, or alternately, in keeping more with other plugins, doing it like {{pagename/fieldname}}. The meaning of the separator is less clear with /, but avoids potential issues with filename clashes that have a colon in them. It also keeps a certain logic - at least to me. Either way, I think both are good choices. [[SR|users/simonraven]] > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. -- cgit v1.2.3 From fa0bbaab21a456f8115d9af508fef06443b8d275 Mon Sep 17 00:00:00 2001 From: "http://oblomov.myopenid.com/" Date: Sun, 17 Jan 2010 09:56:26 +0000 Subject: Suggest # as page-field separator --- doc/plugins/contrib/getfield/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 42338a3c7..900ca65b2 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -16,6 +16,9 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >>>> Oh. Hmm. I like your idea actually, or alternately, in keeping more with other plugins, doing it like {{pagename/fieldname}}. The meaning of the separator is less clear with /, but avoids potential issues with filename clashes that have a colon in them. It also keeps a certain logic - at least to me. Either way, I think both are good choices. [[SR|users/simonraven]] +>>>>> What about using {{pagename#fieldname}}? The meaning of the hash in URLs sort of fits with what is needed here (reference to a 'named' thing within the page) and it won't conflict with actual hash usages (unless we expect different named parts of pages to define different values for the same field ...) +>>>>> -- [[Oblomov]] + > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. > -- [[users/KathrynAndersen]] -- cgit v1.2.3 From 9c0c8b57fb9ccaf21888a7eb9e93dc0d312773e0 Mon Sep 17 00:00:00 2001 From: simonraven Date: Sun, 17 Jan 2010 17:27:51 +0000 Subject: --- doc/plugins/contrib/getfield/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 900ca65b2..ce6246034 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -18,6 +18,8 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >>>>> What about using {{pagename#fieldname}}? The meaning of the hash in URLs sort of fits with what is needed here (reference to a 'named' thing within the page) and it won't conflict with actual hash usages (unless we expect different named parts of pages to define different values for the same field ...) >>>>> -- [[Oblomov]] +>>>>>> That's a good one too. --[[simonraven]] + > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. -- cgit v1.2.3 From bcde9b74120d0572d41447d798917ae02134e059 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sun, 24 Jan 2010 02:52:57 +0000 Subject: new report plugin --- doc/plugins/contrib/report.mdwn | 166 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 doc/plugins/contrib/report.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report.mdwn b/doc/plugins/contrib/report.mdwn new file mode 100644 index 000000000..7130bcb5f --- /dev/null +++ b/doc/plugins/contrib/report.mdwn @@ -0,0 +1,166 @@ +[[!template id=plugin name=report author="[[rubykat]]"]] +[[!tag type/meta type/format]] +[[!toc]] +## NAME + +IkiWiki::Plugin::report - Produce templated reports from page field data. + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff report ....}], + + \[[!report template="blog_summary" + pages="blog/*" + sort="mtime"]] + +## DESCRIPTION + +This plugin provides the **report** directive. This enables one to report on +the structured data ("field" values) of multiple pages; the output is formatted +via a template. This depends on the "field" plugin. + +The pages to report on are selected by a PageSpec given by the "pages" +parameter. The template is given by the "template" parameter. +The template expects the data from a single page; it is applied +to each matching page separately, one after the other. + +Additional parameters can be used to fill out the template, in +addition to the "field" values. Passed-in values override the +"field" values. + +There are two places where template files can live. One, as with the +[[plugins/template]] plugin, is in the /templates directory on the wiki. These +templates are wiki pages, and can be edited from the web like other wiki +pages. + +The second place where template files can live is in the global +templates directory (the same place where the page.tmpl template lives). +This is a useful place to put template files if you want to prevent +them being edited from the web, and you don't want to have to make +them work as wiki pages. + +## OPTIONS + +**template**: The template to use for the report. + +**pages**: A PageSpec to determine the pages to report on. + +**sort**: How the matching pages should be sorted. Sorting criteria are separated by spaces. + +The possible values for sorting are: + +* **page**: Sort by the full page ID. +* **pagename**: Sort by the base page name. +* **pagename_natural**: Sort by the base page name, using Sort::Naturally if it is installed. +* **mtime**: Sort by the page modification time. +* **age**: Sort by the page creation time, newest first. + +Any other value is taken to be a field name to sort by. +If a sort value begins with a minus (-) then the order for that field is reversed. + +### Headers + +An additional option is the "headers" option. This is a space-separated +list of field names which are to be used as headers in the report. This +is a way of getting around one of the limitations of HTML::Template, that +is, not being able to do tests such as +"if this-header is not equal to previous-header". + +Instead, that logic is performed inside the plugin. The template is +given parameters "HEADER1", "HEADER2" and so on, for each header. +If the value of a header field is the same as the previous value, +then HEADER**N** is set to be empty, but if the value of the header +field is new, then HEADER**N** is given that value. + +#### Example + +Suppose you're writing a blog in which you record "moods", and you +want to display your blog posts by mood. + + \[[!report template="mood_summary" + pages="blog/*" + sort="Mood Date title" + headers="Mood"]] + +The "mood_summary" template might be like this: + + + ## + + ### + () \[[ + +### Advanced Options + +The following options are used to improve efficiency when dealing +with large numbers of pages; most people probably won't need them. + +**trail**: + +A page or pages to use as a "trail" page. When a trail page is used, +the matching pages are limited to (a subset of) the pages which that +page links to; the "pages" pagespec in this case, rather than selecting +pages from the entire wiki, will select pages from within the set of pages +given by the trail page. + +**doscan**: + +Whether this report should be called in "scan" mode; if it is, then +the pages which match the pagespec are added to the list of links from +this page. This can be used by *another* report by setting this +page to be a "trail" page in *that* report. +It is not possible to use "trail" and "doscan" at the same time. +By default, "doscan" is false. + +## TEMPLATE PARAMETERS + +The templates are in HTML::Template format, just as [[plugins/template]] and +[[ftemplate]] are. The parameters passed in to the template are as follows: + +***fields***: + +The structured data from the current matching page. This includes +"title" and "description" if they are defined. + +***common values***: + +Values known for all pages: "page", "destpage". Also "basename" (the base name of the page). + +***passed-in values***: + +Any additional parameters to the report directive are passed to the +template; a parameter will override the matching "field" value. +For example, if you have a "Mood" field, and you pass Mood="bad" to +the report, then that will be the Mood which is given for the whole +report. + +Generally this is useful if one wishes to make a more generic +template and hide or show portions of it depending on what +values are passed in the report directive call. + +For example, one could have a "hide_mood" parameter which would hide +the "Mood" section of your template when it is true, which one could +use when the Mood is one of the headers. + +***headers***: + +See the section on Headers. + +***first and last***: + +If this is the first page-record in the report, then "first" is true. +If this is the last page-record in the report, then "last" is true. + +## PREREQUISITES + + IkiWiki + IkiWiki::Plugin::field + HTML::Template + Encode + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From 27d2d7115df82908396d460d92857fd0990c556d Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sun, 24 Jan 2010 02:59:11 +0000 Subject: note that report is now released --- doc/plugins/contrib/getfield/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index ce6246034..015e9f5a1 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -26,3 +26,6 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i > -- [[users/KathrynAndersen]] >> Ooh, sounds nice :) . --[[SR|users/simonraven]] + +>>> I've now released the [[plugins/contrib/report]] plugin. I've been using it on my site; the holdup on releasing was because I hadn't yet written the docs for it. I hope you find it useful. +>>> -- [[users/KathrynAndersen]] -- cgit v1.2.3 From f6b2edef642ccda83a4c96aeeb2e146202707a67 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sun, 24 Jan 2010 09:38:40 +0000 Subject: new release of getfield; can now get values from other pages as well as current page --- doc/plugins/contrib/getfield.mdwn | 60 ++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield.mdwn b/doc/plugins/contrib/getfield.mdwn index 929f70485..0a92894f1 100644 --- a/doc/plugins/contrib/getfield.mdwn +++ b/doc/plugins/contrib/getfield.mdwn @@ -18,13 +18,13 @@ use per-page structured data, where each page is treated like a record, and the structured data are fields in that record. This can include the meta-data for that page, such as the page title. -This plugin is meant to be used in conjunction with the **field** plugin. +This plugin is meant to be used in conjunction with the [[field]] plugin. ### USAGE One can get the value of a field by using special markup in the page. This does not use directive markup, in order to make it easier to -use the markup inside other directives. There are two forms: +use the markup inside other directives. There are four forms: * {{$*fieldname*}} @@ -39,6 +39,26 @@ use the markup inside other directives. There are two forms:

    My Long and Complicated Title With Potential For Spelling Mistakes

    +* {{$*pagename*#*fieldname*}} + + This queries the value of *fieldname* for the page *pagename*. + + For example: + + On PageFoo: + + \[[!meta title="I Am Page Foo"]] + + Stuff about Foo. + + On PageBar: + + For more info, see \[[{{$PageFoo#title}}|PageFoo]]. + + When PageBar is displayed: + + <p>For more info, see <a href="PageFoo">I Am Page Foo</a>.</p> + * {{+$*fieldname*+}} This queries the value of *fieldname* for the destination page; that is, @@ -68,17 +88,43 @@ use the markup inside other directives. There are two forms:

    I Am Page B

    Stuff about A.

    +* {{+$*pagename*#*fieldname*+}} + + This queries the value of *fieldname* for the page *pagename*; the + only difference between this and {{$*pagename*#*fieldname*}} is + that the full name of *pagename* is calculated relative to the + destination page rather than the source page. + + I can't really think of a reason why this should be needed, but + this format has been added for completeness. + +### No Value Found + +If no value is found for the given field, then the field name is returned. + +For example: + +On PageFoo: + + \[[!meta title="Foo"]] + My title is {{$title}}. + + My description is {{$description}}. + +When PageFoo is displayed: + +

    My title is Foo.

    + +

    My description is description.

    + +This is because "description" hasn't been defined for that page. + ### More Examples Listing all the sub-pages of the current page: \[[!map pages="{{$page}}/*"]] -### LIMITATIONS - -One cannot query the values of fields on pages other than the current -page or the destination page. - ## DOWNLOAD * browse at GitHub: -- cgit v1.2.3 From e9ee3d7d85e792ee6720696abe62f25cdd7f945a Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Sun, 24 Jan 2010 09:41:44 +0000 Subject: note new version of getfield --- doc/plugins/contrib/getfield/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/getfield/discussion.mdwn b/doc/plugins/contrib/getfield/discussion.mdwn index 015e9f5a1..5f7fffead 100644 --- a/doc/plugins/contrib/getfield/discussion.mdwn +++ b/doc/plugins/contrib/getfield/discussion.mdwn @@ -19,6 +19,7 @@ Like you mentioned in [[ftemplate]] IIRC, it'll only work on the same page. If i >>>>> What about using {{pagename#fieldname}}? The meaning of the hash in URLs sort of fits with what is needed here (reference to a 'named' thing within the page) and it won't conflict with actual hash usages (unless we expect different named parts of pages to define different values for the same field ...) >>>>> -- [[Oblomov]] >>>>>> That's a good one too. --[[simonraven]] +>>>>>>> Done! I used {{$*pagename*#*fieldname*}} for the format. -- [[users/KathrynAndersen]] > I'm also working on a "report" plugin, which will basically apply a template like [[ftemplate]] does, but to a list of pages given from a pagespec, rather than the current page. -- cgit v1.2.3 From 1e0b724bac67d3f31bfb3620876937ec4291a326 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 31 Jan 2010 14:03:19 -0500 Subject: document that state variables are not available in the checkconfig hook --- doc/plugins/write.mdwn | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 45f083b42..082f0e38f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -68,20 +68,21 @@ In roughly the order they are called. This allows for plugins to perform their own processing of command-line options and so add options to the ikiwiki command line. It's called during -command line processing, with @ARGV full of any options that ikiwiki was +command line processing, with `@ARGV` full of any options that ikiwiki was not able to process on its own. The function should process any options it -can, removing them from @ARGV, and probably recording the configuration -settings in %config. It should take care not to abort if it sees +can, removing them from `@ARGV`, and probably recording the configuration +settings in `%config`. It should take care not to abort if it sees an option it cannot process, and should just skip over those options and -leave them in @ARGV. +leave them in `@ARGV`. ### checkconfig hook(type => "checkconfig", id => "foo", call => \&checkconfig); This is useful if the plugin needs to check for or modify ikiwiki's -configuration. It's called early in the startup process. The -function is passed no values. It's ok for the function to call +configuration. It's called early in the startup process. `%config` +is populated at this point, but other state has not yet been loaded. +The function is passed no values. It's ok for the function to call `error()` if something isn't configured right. ### refresh -- cgit v1.2.3 From b384af237df92e787f84f845d0d2bc182f7775ff Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Feb 2010 16:19:17 -0500 Subject: opendiscussion: This plugin will also now allow posting comments to otherwise locked-down sites. --- IkiWiki/Plugin/opendiscussion.pm | 1 + debian/changelog | 2 ++ doc/plugins/comments.mdwn | 4 ++-- doc/plugins/lockedit.mdwn | 11 +++-------- doc/plugins/opendiscussion.mdwn | 5 +++-- 5 files changed, 11 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 4b91f5d83..5a455940b 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -25,6 +25,7 @@ sub canedit ($$) { my $session=shift; return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/i; + return "" if pagespec_match($page, "postcomment(*)"); return undef; } diff --git a/debian/changelog b/debian/changelog index b4acac633..a65592277 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * Add link to userpage (or creation link) to top of preferences page. * auto-blog.setup: Lock all pages, so only admin can post to the blog by default. + * opendiscussion: This plugin will also now allow posting comments + to otherwise locked-down sites. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn index b6d4d252b..f933d32be 100644 --- a/doc/plugins/comments.mdwn +++ b/doc/plugins/comments.mdwn @@ -14,8 +14,8 @@ authorship should hopefully be unforgeable by CGI users. The intention is that on a non-wiki site (like a blog) you can lock all pages for admin-only access, then allow otherwise unprivileged (or perhaps even anonymous) users to comment on posts. See the documentation of the -[[lockedit]] and [[anonok]] pages for details on locking down a wiki so -users can only post comments. +[[opendiscussion]], [[lockedit]] and [[anonok]] pages for details on locking +down a wiki so readers can only post comments. Individual comments are stored as internal-use pages named something like `page/comment_1`, `page/comment_2`, etc. These pages internally use a diff --git a/doc/plugins/lockedit.mdwn b/doc/plugins/lockedit.mdwn index c8f64ea47..681163203 100644 --- a/doc/plugins/lockedit.mdwn +++ b/doc/plugins/lockedit.mdwn @@ -12,14 +12,9 @@ to lock. For example, you could choose to lock all pages created before 2006, or all pages that are linked to from the page named "locked". More usually though, you'll just list some names of pages to lock. -One handy thing to do if you're using ikiwiki for your blog is to lock -"* and !*/Discussion". This prevents others from adding to or modifying -posts in your blog, while still letting them comment via the Discussion -pages. - -Alternatively, if you're using the [[comments]] plugin, you can lock -"!postcomment(*)" to allow users to comment on pages, but not edit anything -else. +If you want to lock down a blog so only you can post to it, you can just +lock "*", and enable the [[opendiscussion]] plugin, so readers can still post +[[comments]]. Wiki administrators can always edit locked pages. The [[ikiwiki/PageSpec]] can specify that some pages are not locked for some users. For example, diff --git a/doc/plugins/opendiscussion.mdwn b/doc/plugins/opendiscussion.mdwn index b2ba68bf7..3b5ab4858 100644 --- a/doc/plugins/opendiscussion.mdwn +++ b/doc/plugins/opendiscussion.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=opendiscussion author="[[Joey]]"]] [[!tag type/auth]] -This plugin allows editing of Discussion pages by anonymous users who have -not logged into the wiki. +This plugin allows editing of Discussion pages, and posting of comments, +even when the [[lockedit]] plugin has been configured to otherwise prevent +editing. -- cgit v1.2.3 From 046095552ac231366d71a3c7a84bdc6d46662212 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 17:26:09 -0500 Subject: httpauth: When cgiauthurl is configured, httpauth can now be used alongside other authentication methods (like openid or anonok). Rather than always redirect to the cgiauthurl for authentication, there is now a button on the login form to use it. --- IkiWiki/Plugin/httpauth.pm | 35 +++++++++++++++++++++++++++++++---- IkiWiki/Plugin/openid.pm | 2 +- debian/changelog | 4 ++++ doc/bugs/anonok_vs._httpauth.mdwn | 2 ++ doc/plugins/httpauth.mdwn | 9 +++++---- 5 files changed, 43 insertions(+), 9 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index a18f8ca54..d0d4da0b7 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -11,6 +11,8 @@ sub import { hook(type => "auth", id => "httpauth", call => \&auth); hook(type => "canedit", id => "httpauth", call => \&canedit, last => 1); + hook(type => "formbuilder_setup", id => "httpauth", + call => \&formbuilder_setup); } sub getsetup () { @@ -27,6 +29,14 @@ sub getsetup () { rebuild => 0, }, } + +sub redir_cgiauthurl ($$) { + my $cgi=shift; + my $params=shift; + + IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$params); + exit; +} sub auth ($$) { my $cgi=shift; @@ -43,14 +53,31 @@ sub canedit ($$$) { my $session=shift; if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) { - return sub { - IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); - exit; - }; + return sub { redir_cgiauthurl($cgi, $cgi->query_string()) }; } else { return undef; } } +sub formbuilder_setup (@) { + my %params=@_; + + my $form=$params{form}; + my $session=$params{session}; + my $cgi=$params{cgi}; + my $buttons=$params{buttons}; + + if ($form->title eq "signin" && + ! defined $cgi->remote_user() && defined $config{cgiauthurl}) { + my $button_text="Login with HTTP auth"; + push @$buttons, $button_text; + + if ($form->submitted && $form->submitted eq $button_text) { + redir_cgiauthurl($cgi, "do=postsignin"); + exit; + } + } +} + 1 diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index b60740c0e..382d8286f 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -56,7 +56,7 @@ sub formbuilder_setup (@) { # OpenID fieldset. $form->fieldsets("OpenID"); - $form->field( + $form->field( name => "openid_url", label => gettext("Log in with")." ".htmllink("", "", "ikiwiki/OpenID", noimageinline => 1), fieldset => "OpenID", diff --git a/debian/changelog b/debian/changelog index 358a5dc5c..3dd68558e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,10 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * Fix color and format plugins to appear in the websetup interface. * amazon_s3: Fix to support the EU S3 datacenter, which is more picky about attempts to create already existing buckets. + * httpauth: When cgiauthurl is configured, httpauth can now be used + alongside other authentication methods (like openid or anonok). Rather + than always redirect to the cgiauthurl for authentication, there is now + a button on the login form to use it. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index b738e3b6c..bff37e18b 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -114,3 +114,5 @@ index 127c321..a18f8ca 100644 >> time that httpauth is redirecting to the cgiauthurl. As mentioned above, >> the only way to deal with that would be to add a link to the signin page >> that does the httpauth signin. --[[Joey]] + +>>> That's dealt with in final version. [[done]] --[[Joey]] diff --git a/doc/plugins/httpauth.mdwn b/doc/plugins/httpauth.mdwn index 77796a3d7..a7aac558b 100644 --- a/doc/plugins/httpauth.mdwn +++ b/doc/plugins/httpauth.mdwn @@ -14,10 +14,11 @@ signed into the wiki. This method is suitable only for private wikis. ## separate cgiauthurl To use httpauth for a wiki where the content is public, and where -the `ikiwiki.cgi` needs to be usable without authentication (for searching -and so on), you can configure a separate url that is used for -authentication, via the `cgiauthurl` option in the setup file. This -url will then be redirected to whenever authentication is needed. +the `ikiwiki.cgi` needs to be usable without authentication (for searching, +or logging in using other methods, and so on), you can configure a separate +url that is used for authentication, via the `cgiauthurl` option in the setup +file. This url will then be redirected to when a user chooses to log in using +httpauth. A typical setup is to make an `auth` subdirectory, and symlink `ikiwiki.cgi` into it. Then configure the web server to require authentication only for -- cgit v1.2.3 From e11876b7003c700fbc3717ca9c5af5aac3b72ac2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 18:25:10 -0500 Subject: httpauth: Add httpauth_pagespec setting that can be used to limit pages to only being edited via users authed with httpauth. --- IkiWiki.pm | 7 ++++- IkiWiki/Plugin/httpauth.pm | 75 +++++++++++++++++++++++++++++++++------------- debian/changelog | 2 ++ doc/plugins/httpauth.mdwn | 9 ++++++ 4 files changed, 72 insertions(+), 21 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 2a0132745..de7dbfc79 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -941,7 +941,12 @@ sub linkpage ($) { sub cgiurl (@) { my %params=@_; - return $config{cgiurl}."?". + my $cgiurl=$config{cgiurl}; + if (exists $params{cgiurl}) { + $cgiurl=$params{cgiurl}; + delete $params{cgiurl}; + } + return $cgiurl."?". join("&", map $_."=".uri_escape_utf8($params{$_}), keys %params); } diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index d0d4da0b7..202ca1153 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -9,10 +9,10 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "httpauth", call => \&getsetup); hook(type => "auth", id => "httpauth", call => \&auth); - hook(type => "canedit", id => "httpauth", call => \&canedit, - last => 1); hook(type => "formbuilder_setup", id => "httpauth", call => \&formbuilder_setup); + hook(type => "canedit", id => "httpauth", call => \&canedit); + hook(type => "pagetemplate", id => "httpauth", call => \&pagetemplate); } sub getsetup () { @@ -28,13 +28,20 @@ sub getsetup () { safe => 1, rebuild => 0, }, + httpauth_pagespec => { + type => "pagespec", + example => "!*/Discussion", + description => "PageSpec of pages where only httpauth will be used for authentication", + safe => 0, + rebuild => 0, + }, } -sub redir_cgiauthurl ($$) { +sub redir_cgiauthurl ($;@) { my $cgi=shift; - my $params=shift; - IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$params); + IkiWiki::redirect($cgi, + IkiWiki::cgiurl(cgiurl => $config{cgiauthurl}, @_)); exit; } @@ -47,19 +54,6 @@ sub auth ($$) { } } -sub canedit ($$$) { - my $page=shift; - my $cgi=shift; - my $session=shift; - - if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) { - return sub { redir_cgiauthurl($cgi, $cgi->query_string()) }; - } - else { - return undef; - } -} - sub formbuilder_setup (@) { my %params=@_; @@ -74,10 +68,51 @@ sub formbuilder_setup (@) { push @$buttons, $button_text; if ($form->submitted && $form->submitted eq $button_text) { - redir_cgiauthurl($cgi, "do=postsignin"); - exit; + # bounce thru cgiauthurl and then back to + # the stored postsignin action + redir_cgiauthurl($cgi, do => "postsignin"); } } } +sub test_httpauth_pagespec ($) { + my $page=shift; + + return defined $config{httpauth_pagespec} && + length $config{httpauth_pagespec} && + defined $config{cgiauthurl} && + pagespec_match($page, $config{httpauth_pagespec}); +} + +sub canedit ($$$) { + my $page=shift; + my $cgi=shift; + my $session=shift; + + if (! defined $cgi->remote_user() && test_httpauth_pagespec($page)) { + return sub { + IkiWiki::redirect($cgi, + $config{cgiauthurl}.'?'.$cgi->query_string()); + exit; + }; + } + else { + return undef; + } +} + +sub pagetemplate (@_) { + my %params=@_; + my $template=$params{template}; + + if ($template->param("editurl") && + test_httpauth_pagespec($params{page})) { + # go directly to cgiauthurl when editing a page matching + # the pagespec + $template->param(editurl => IkiWiki::cgiurl( + cgiurl => $config{cgiauthurl}, + do => "edit", page => $params{page})); + } +} + 1 diff --git a/debian/changelog b/debian/changelog index 3dd68558e..14be7ec69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low alongside other authentication methods (like openid or anonok). Rather than always redirect to the cgiauthurl for authentication, there is now a button on the login form to use it. + * httpauth: Add httpauth_pagespec setting that can be used to limit + pages to only being edited via users authed with httpauth. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 diff --git a/doc/plugins/httpauth.mdwn b/doc/plugins/httpauth.mdwn index a7aac558b..0eda5554f 100644 --- a/doc/plugins/httpauth.mdwn +++ b/doc/plugins/httpauth.mdwn @@ -24,3 +24,12 @@ A typical setup is to make an `auth` subdirectory, and symlink `ikiwiki.cgi` into it. Then configure the web server to require authentication only for access to the `auth` subdirectory. Then `cgiauthurl` is pointed at this symlink. + +## using only httpauth for some pages + +If you want to only use httpauth for editing some pages, while allowing +other authentication methods to be used for other pages, you can +configure `httpauth_pagespec` in the setup file. This makes Edit +links on pages that match the [[ikiwiki/PageSpec]] automatically use +the `cgiauthurl`, and prevents matching pages from being edited by +users authentication via other methods. -- cgit v1.2.3 From a63929f6cc7778ffc4ba57d784cdf2206ec650c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 22:24:15 -0500 Subject: Group related plugins into sections in the setup file, and drop unused rcs plugins from the setup file. --- IkiWiki/Plugin/anonok.pm | 1 + IkiWiki/Plugin/blogspam.pm | 1 + IkiWiki/Plugin/bzr.pm | 1 + IkiWiki/Plugin/conditional.pm | 1 + IkiWiki/Plugin/cvs.pm | 1 + IkiWiki/Plugin/darcs.pm | 1 + IkiWiki/Plugin/editpage.pm | 1 + IkiWiki/Plugin/git.pm | 1 + IkiWiki/Plugin/htmlscrubber.pm | 1 + IkiWiki/Plugin/httpauth.pm | 1 + IkiWiki/Plugin/inline.pm | 1 + IkiWiki/Plugin/link.pm | 1 + IkiWiki/Plugin/lockedit.pm | 1 + IkiWiki/Plugin/mdwn.pm | 1 + IkiWiki/Plugin/mercurial.pm | 1 + IkiWiki/Plugin/meta.pm | 1 + IkiWiki/Plugin/moderatedcomments.pm | 1 + IkiWiki/Plugin/monotone.pm | 1 + IkiWiki/Plugin/opendiscussion.pm | 1 + IkiWiki/Plugin/openid.pm | 1 + IkiWiki/Plugin/parentlinks.pm | 1 + IkiWiki/Plugin/passwordauth.pm | 1 + IkiWiki/Plugin/recentchanges.pm | 1 + IkiWiki/Plugin/signinedit.pm | 1 + IkiWiki/Plugin/svn.pm | 1 + IkiWiki/Plugin/tla.pm | 1 + IkiWiki/Setup.pm | 32 ++++++++++++++++++++++++++------ IkiWiki/Setup/Standard.pm | 8 ++++++++ debian/changelog | 2 ++ doc/plugins/write.mdwn | 13 ++++++++----- 30 files changed, 70 insertions(+), 11 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/anonok.pm b/IkiWiki/Plugin/anonok.pm index 243b98920..0e74cbfad 100644 --- a/IkiWiki/Plugin/anonok.pm +++ b/IkiWiki/Plugin/anonok.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, anonok_pagespec => { type => "pagespec", diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index 626c8ec42..c4e5cf390 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, blogspam_pagespec => { type => 'pagespec', diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 883007367..1ffdc2353 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -36,6 +36,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, bzr_wrapper => { type => "string", diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index aad617812..beeddc672 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -16,6 +16,7 @@ sub getsetup { plugin => { safe => 1, rebuild => undef, + section => "core", }, } diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index f6db8bc98..26a3e9dd2 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -85,6 +85,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, cvsrepo => { type => "string", diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 0d68f27e5..1c9538e83 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -92,6 +92,7 @@ sub getsetup() { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, darcs_wrapper => { type => "string", diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 9211cca89..44fe5514a 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "core", }, } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 1eec6aee6..b02f4a5ed 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -68,6 +68,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, git_wrapper => { type => "string", diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index a249cdf7a..ee284a45c 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -40,6 +40,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "core", }, htmlscrubber_skip => { type => "pagespec", diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index b2bb2701a..478f67446 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, cgiauthurl => { type => "string", diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 401852513..44919e58c 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -49,6 +49,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "core", }, rss => { type => "boolean", diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index 4c1add985..3838aec09 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "core", }, } diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index 74ddbb153..1466e8337 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, locked_pages => { type => "pagespec", diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 3de59ef3d..4ddf097ba 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "core", }, multimarkdown => { type => "boolean", diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index 11fdec529..ea00a3364 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -36,6 +36,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, mercurial_wrapper => { type => "string", diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 55c9ddbd1..5f046cb2a 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "core", }, } diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm index 2555927b7..afe1ceedf 100644 --- a/IkiWiki/Plugin/moderatedcomments.pm +++ b/IkiWiki/Plugin/moderatedcomments.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, moderate_users => { type => 'boolean', diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index 9502804f1..c33cf7e3a 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -68,6 +68,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, mtn_wrapper => { type => "string", diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 5a455940b..2805f60ef 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, } diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 382d8286f..bb99446b4 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -26,6 +26,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, openidsignup => { type => "string", diff --git a/IkiWiki/Plugin/parentlinks.pm b/IkiWiki/Plugin/parentlinks.pm index e678a057d..728bbc399 100644 --- a/IkiWiki/Plugin/parentlinks.pm +++ b/IkiWiki/Plugin/parentlinks.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "core", }, } diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index c07065b7d..4848b47bb 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, account_creation_password => { type => "string", diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 5c7b71aaa..04219b721 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -22,6 +22,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "core", }, recentchangespage => { type => "string", diff --git a/IkiWiki/Plugin/signinedit.pm b/IkiWiki/Plugin/signinedit.pm index 8b44a68f7..31160c02f 100644 --- a/IkiWiki/Plugin/signinedit.pm +++ b/IkiWiki/Plugin/signinedit.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "auth", }, } diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index 06b987f51..7d27ec842 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -44,6 +44,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, svnrepo => { type => "string", diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index f4b20a6ec..16d73b136 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -34,6 +34,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => undef, + section => "rcs", }, tla_wrapper => { type => "string", diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 8a25ecc57..b21bd7bfe 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -77,7 +77,6 @@ sub merge ($) { sub getsetup () { # Gets all available setup data from all plugins. Returns an # ordered list of [plugin, setup] pairs. - my @ret; # disable logging to syslog while dumping, broken plugins may # whine when loaded @@ -85,27 +84,48 @@ sub getsetup () { $config{syslog}=undef; # Load all plugins, so that all setup options are available. - my @plugins=grep { $_ ne $config{rcs} } sort(IkiWiki::listplugins()); - unshift @plugins, $config{rcs} if $config{rcs}; # rcs plugin 1st + my @plugins=IkiWiki::listplugins(); foreach my $plugin (@plugins) { eval { IkiWiki::loadplugin($plugin) }; if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) { my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() }; } } - + + my %sections; foreach my $plugin (@plugins) { if (exists $IkiWiki::hooks{getsetup}{$plugin}{call}) { # use an array rather than a hash, to preserve order my @s=eval { $IkiWiki::hooks{getsetup}{$plugin}{call}->() }; next unless @s; - push @ret, [ $plugin, \@s ], + + # set default section value (note use of shared + # hashref between array and hash) + my %s=@s; + if (! exists $s{plugin} || ! $s{plugin}->{section}) { + $s{plugin}->{section}="misc"; + } + + # only the selected rcs plugin is included + if ($config{rcs} && $plugin eq $config{rcs}) { + $s{plugin}->{section}="core"; + } + elsif ($s{plugin}->{section} eq "rcs") { + next; + } + + push @{$sections{$s{plugin}->{section}}}, [ $plugin, \@s ]; } } $config{syslog}=$syslog; - return @ret; + return map { sort { $a->[0] cmp $b->[0] } @{$sections{$_}} } + sort { # core first, then alphabetical + ($b eq "core") <=> ($a eq "core") + || + $a cmp $b + } keys %sections; } sub dump ($) { diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 951bcfc56..c99dbb620 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -90,10 +90,18 @@ sub gendump ($) { # disable logging to syslog while dumping $config{syslog}=undef; + my $curr_section; push @ret, dumpvalues(\%setup, IkiWiki::getsetup()); foreach my $pair (IkiWiki::Setup::getsetup()) { my $plugin=$pair->[0]; my $setup=$pair->[1]; + my %s=@{$setup}; + my $section=$s{plugin}->{section}; + if (! defined $curr_section || $curr_section ne $section) { + $curr_section=$section; + push @ret, "", "\t#", "\t# $section plugins", "\t#"; + } + my @values=dumpvalues(\%setup, @{$setup}); if (@values) { push @ret, "", "\t# $plugin plugin", @values; diff --git a/debian/changelog b/debian/changelog index d74abd0f9..f24a453c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * httpauth: Add httpauth_pagespec setting that can be used to limit pages to only being edited via users authed with httpauth. * Allow globs to be used in user() pagespecs. + * Group related plugins into sections in the setup file, and drop + unused rcs plugins from the setup file. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 082f0e38f..68454d56c 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -457,6 +457,12 @@ describing the option. There can also be an item named "plugin", which describes the plugin as a whole. For example: return + plugin => { + description => "description of this plugin", + safe => 1, + rebuild => 1, + section => "misc", + }, option_foo => { type => "boolean", description => "enable foo?", @@ -471,11 +477,6 @@ describes the plugin as a whole. For example: safe => 1, rebuild => 0, }, - plugin => { - description => "description of this plugin", - safe => 1, - rebuild => 1, - }, * `type` can be "boolean", "string", "integer", "pagespec", or "internal" (used for values that are not user-visible). The type is @@ -496,6 +497,8 @@ describes the plugin as a whole. For example: the plugin) will require a wiki rebuild, false if no rebuild is needed, and undef if a rebuild could be needed in some circumstances, but is not strictly required. +* `section` can optionally specify which section in the config file + the plugin fits in. ### genwrapper -- cgit v1.2.3 From 9cee2962e01ef0538cc8498951867a543f91b47d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 01:10:36 -0500 Subject: format plugin categorization --- IkiWiki/Plugin/creole.pm | 1 + IkiWiki/Plugin/highlight.pm | 1 + IkiWiki/Plugin/hnb.pm | 1 + IkiWiki/Plugin/html.pm | 1 + IkiWiki/Plugin/mdwn.pm | 2 +- IkiWiki/Plugin/otl.pm | 1 + IkiWiki/Plugin/po.pm | 3 ++- IkiWiki/Plugin/rawhtml.pm | 1 + IkiWiki/Plugin/textile.pm | 1 + IkiWiki/Plugin/txt.pm | 1 + IkiWiki/Plugin/wikitext.pm | 1 + doc/plugins/conditional.mdwn | 2 +- doc/plugins/format.mdwn | 2 +- doc/plugins/graphviz.mdwn | 2 +- doc/plugins/more.mdwn | 2 +- doc/plugins/shortcut.mdwn | 2 +- doc/plugins/table.mdwn | 2 +- doc/plugins/template.mdwn | 2 +- doc/plugins/typography.mdwn | 2 +- plugins/rst | 2 +- 20 files changed, 21 insertions(+), 11 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/creole.pm b/IkiWiki/Plugin/creole.pm index 425e71043..a1e4b31d3 100644 --- a/IkiWiki/Plugin/creole.pm +++ b/IkiWiki/Plugin/creole.pm @@ -17,6 +17,7 @@ sub getsetup { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index 9bdde85ae..947fb692e 100644 --- a/IkiWiki/Plugin/highlight.pm +++ b/IkiWiki/Plugin/highlight.pm @@ -23,6 +23,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, tohighlight => { type => "string", diff --git a/IkiWiki/Plugin/hnb.pm b/IkiWiki/Plugin/hnb.pm index bd2177a06..32c9cf3ad 100644 --- a/IkiWiki/Plugin/hnb.pm +++ b/IkiWiki/Plugin/hnb.pm @@ -23,6 +23,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/html.pm b/IkiWiki/Plugin/html.pm index a7d5e8ce9..4dbae081b 100644 --- a/IkiWiki/Plugin/html.pm +++ b/IkiWiki/Plugin/html.pm @@ -21,6 +21,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 4ddf097ba..b892eabee 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -16,7 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin - section => "core", + section => "format", }, multimarkdown => { type => "boolean", diff --git a/IkiWiki/Plugin/otl.pm b/IkiWiki/Plugin/otl.pm index 3ab2441bf..3801a6ec2 100644 --- a/IkiWiki/Plugin/otl.pm +++ b/IkiWiki/Plugin/otl.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f8801185e..2cbfb0a45 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -85,7 +85,8 @@ sub getsetup () { return plugin => { safe => 0, - rebuild => 1, + rebuild => 1, # format plugin + section => "format", }, po_master_language => { type => "string", diff --git a/IkiWiki/Plugin/rawhtml.pm b/IkiWiki/Plugin/rawhtml.pm index ad8a610c1..0838bcb22 100644 --- a/IkiWiki/Plugin/rawhtml.pm +++ b/IkiWiki/Plugin/rawhtml.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # changes file types + section => "format", }, } diff --git a/IkiWiki/Plugin/textile.pm b/IkiWiki/Plugin/textile.pm index 8cc5a7951..56bb4bffc 100644 --- a/IkiWiki/Plugin/textile.pm +++ b/IkiWiki/Plugin/textile.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/txt.pm b/IkiWiki/Plugin/txt.pm index 8599bdc8e..1ed9f0856 100644 --- a/IkiWiki/Plugin/txt.pm +++ b/IkiWiki/Plugin/txt.pm @@ -29,6 +29,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, } diff --git a/IkiWiki/Plugin/wikitext.pm b/IkiWiki/Plugin/wikitext.pm index accb03bbe..b24630b15 100644 --- a/IkiWiki/Plugin/wikitext.pm +++ b/IkiWiki/Plugin/wikitext.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 0, # format plugin rebuild => undef, + section => "format", }, } diff --git a/doc/plugins/conditional.mdwn b/doc/plugins/conditional.mdwn index 95ffb2764..27a99bb7c 100644 --- a/doc/plugins/conditional.mdwn +++ b/doc/plugins/conditional.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=conditional core=1 author="[[Joey]]"]] -[[!tag type/format]] +[[!tag type/special-purpose]] This plugin provides the [[ikiwiki/directive/if]] [[ikiwiki/directive]]. With this directive, you can make text be conditionally displayed on a page. diff --git a/doc/plugins/format.mdwn b/doc/plugins/format.mdwn index 91e707fcf..5ec0842ae 100644 --- a/doc/plugins/format.mdwn +++ b/doc/plugins/format.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=format core=0 author="[[Joey]]"]] -[[!tag type/format]] +[[!tag type/useful]] This plugin allows mixing different page formats together, by embedding text formatted one way inside a page formatted another way. This is done diff --git a/doc/plugins/graphviz.mdwn b/doc/plugins/graphviz.mdwn index b89f16b59..8237ae9dc 100644 --- a/doc/plugins/graphviz.mdwn +++ b/doc/plugins/graphviz.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=graphviz author="[[JoshTriplett]]"]] -[[!tag type/chrome type/format]] +[[!tag type/chrome]] This plugin provides the [[ikiwiki/directive/graph]] [[ikiwiki/directive]]. This directive allows embedding [graphviz](http://www.graphviz.org/) graphs in a diff --git a/doc/plugins/more.mdwn b/doc/plugins/more.mdwn index e9a971289..81a9e67e8 100644 --- a/doc/plugins/more.mdwn +++ b/doc/plugins/more.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=more author="Ben"]] -[[!tag type/format]] +[[!tag type/chrome]] This plugin provides the [[ikiwiki/directive/more]] [[ikiwiki/directive]], which is a way to have a "more" link on a post in a blog, that leads to the diff --git a/doc/plugins/shortcut.mdwn b/doc/plugins/shortcut.mdwn index cca1f4bdd..68896f4d3 100644 --- a/doc/plugins/shortcut.mdwn +++ b/doc/plugins/shortcut.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=shortcut author="[[Joey]]"]] -[[!tag type/format]] +[[!tag type/useful]] This plugin provides the [[ikiwiki/directive/shortcut]] [[ikiwiki/directive]]. It allows external links to commonly linked to sites to be made diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index 10a85bb2c..fb830044f 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=table author="[[VictorMoral]]"]] -[[!tag type/format]] +[[!tag type/useful]] This plugin provides the [[ikiwiki/directive/table]] [[ikiwiki/directive]]. It can build HTML tables from data in CSV (comma-separated values) diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index 3485fe64c..6675207b2 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=template author="[[Joey]]"]] -[[!tag type/format]] +[[!tag type/useful]] This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out diff --git a/doc/plugins/typography.mdwn b/doc/plugins/typography.mdwn index 030ef8052..9ff6c4ffd 100644 --- a/doc/plugins/typography.mdwn +++ b/doc/plugins/typography.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=typography author="[[Roktas]]"]] -[[!tag type/format]] +[[!tag type/chrome]] This plugin, also known as [SmartyPants](http://daringfireball.net/projects/smartypants/), translates diff --git a/plugins/rst b/plugins/rst index 9f64b33a0..838667507 100755 --- a/plugins/rst +++ b/plugins/rst @@ -33,7 +33,7 @@ def _to_dict(args): return dict((k, v) for k, v in zip(*[iter(args)]*2)) def getsetup(proxy, *kwargs): - return 'plugin', { 'safe' : 1, 'rebuild' : 1 } + return 'plugin', { 'safe' : 1, 'rebuild' : 1, 'section' : 'format' } import sys def debug(s): -- cgit v1.2.3 From 04a99c84406d7b1552b15fc0b5ea598644f94c23 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 03:38:00 -0500 Subject: plugin tag reorg --- doc/plugins/404.mdwn | 2 +- doc/plugins/aggregate.mdwn | 2 +- doc/plugins/autoindex.mdwn | 2 +- doc/plugins/calendar.mdwn | 2 +- doc/plugins/color.mdwn | 2 +- doc/plugins/comments.mdwn | 2 +- doc/plugins/contrib/postal.mdwn | 2 +- doc/plugins/cutpaste.mdwn | 2 +- doc/plugins/ddate.mdwn | 1 + doc/plugins/filecheck.mdwn | 2 +- doc/plugins/format.mdwn | 2 +- doc/plugins/fortune.mdwn | 1 + doc/plugins/goto.mdwn | 2 +- doc/plugins/graphviz.mdwn | 2 +- doc/plugins/haiku.mdwn | 1 + doc/plugins/img.mdwn | 2 +- doc/plugins/mirrorlist.mdwn | 2 +- doc/plugins/more.mdwn | 2 +- doc/plugins/poll.mdwn | 2 +- doc/plugins/polygen.mdwn | 1 + doc/plugins/prettydate.mdwn | 1 + doc/plugins/relativedate.mdwn | 1 + doc/plugins/repolist.mdwn | 2 +- doc/plugins/shortcut.mdwn | 2 +- doc/plugins/sparkline.mdwn | 2 +- doc/plugins/table.mdwn | 2 +- doc/plugins/template.mdwn | 2 +- doc/plugins/testpagespec.mdwn | 2 +- doc/plugins/teximg.mdwn | 2 +- doc/plugins/toc.mdwn | 2 +- doc/plugins/toggle.mdwn | 2 +- doc/plugins/type/chrome.mdwn | 2 +- doc/plugins/type/useful.mdwn | 1 - doc/plugins/type/widget.mdwn | 2 ++ doc/plugins/underlay.mdwn | 18 +++++++++--------- doc/plugins/wmd.mdwn | 2 +- 36 files changed, 44 insertions(+), 37 deletions(-) delete mode 100644 doc/plugins/type/useful.mdwn create mode 100644 doc/plugins/type/widget.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/404.mdwn b/doc/plugins/404.mdwn index ad332ee04..53dace3c9 100644 --- a/doc/plugins/404.mdwn +++ b/doc/plugins/404.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=404 author="[[Simon_McVittie|smcv]]"]] -[[!tag type/useful]] +[[!tag type/web]] This plugin lets you use the IkiWiki CGI script as an Apache 404 handler, to give the behaviour of various other wiki engines where visiting a diff --git a/doc/plugins/aggregate.mdwn b/doc/plugins/aggregate.mdwn index e2efcd83f..bb828b05c 100644 --- a/doc/plugins/aggregate.mdwn +++ b/doc/plugins/aggregate.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=aggregate author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] This plugin allows content from other feeds to be aggregated into the wiki. To specify feeds to aggregate, use the diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn index 03e2d12f3..d1133e4f5 100644 --- a/doc/plugins/autoindex.mdwn +++ b/doc/plugins/autoindex.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=autoindex core=0 author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent page, and generates the parent pages. The generated page content is diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index bc1bc6c71..49fd90627 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=calendar author="[[ManojSrivastava]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides a [[ikiwiki/directive/calendar]] [[ikiwiki/directive]]. The directive displays a calendar, similar to the typical calendars shown on diff --git a/doc/plugins/color.mdwn b/doc/plugins/color.mdwn index dbb8b870c..d639bf563 100644 --- a/doc/plugins/color.mdwn +++ b/doc/plugins/color.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=color core=0 author="[[ptecza]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides a [[ikiwiki/directive/color]] [[ikiwiki/directive]]. The directive can be used to color a piece of text on a page. diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn index f933d32be..775ef75a0 100644 --- a/doc/plugins/comments.mdwn +++ b/doc/plugins/comments.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=comments author="[[Simon_McVittie|smcv]]"]] -[[!tag type/useful]] +[[!tag type/web]] This plugin adds "blog-style" comments. Unlike the wiki-style freeform Discussion pages, these comments are posted by a simple form, cannot later diff --git a/doc/plugins/contrib/postal.mdwn b/doc/plugins/contrib/postal.mdwn index b2f875393..c522f8bcb 100644 --- a/doc/plugins/contrib/postal.mdwn +++ b/doc/plugins/contrib/postal.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=postal author="[[DavidBremner]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] The `postal` plugin allows users to send mail to a special address to comment on a page. It uses the [[mailbox]] diff --git a/doc/plugins/cutpaste.mdwn b/doc/plugins/cutpaste.mdwn index f74f8a269..ea3665c44 100644 --- a/doc/plugins/cutpaste.mdwn +++ b/doc/plugins/cutpaste.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=cutpaste author="[[Enrico]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/cut]], [[ikiwiki/directive/copy]] and [[ikiwiki/directive/paste]] diff --git a/doc/plugins/ddate.mdwn b/doc/plugins/ddate.mdwn index 741606a6e..17bb16cff 100644 --- a/doc/plugins/ddate.mdwn +++ b/doc/plugins/ddate.mdwn @@ -1,6 +1,7 @@ [[!template id=plugin name=ddate author="[[Joey]]"]] [[!tag type/fun]] [[!tag type/date]] +[[!tag type/chrome]] Enables use of Discordian dates. `--timeformat` can be used to change the date format; see `ddate(1)`. diff --git a/doc/plugins/filecheck.mdwn b/doc/plugins/filecheck.mdwn index f4563d58e..e5f68b29c 100644 --- a/doc/plugins/filecheck.mdwn +++ b/doc/plugins/filecheck.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=filecheck core=0 author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] This plugin enhances the regular [[ikiwiki/PageSpec]] syntax with some additional tests, for things like file size, mime type, and virus diff --git a/doc/plugins/format.mdwn b/doc/plugins/format.mdwn index 5ec0842ae..b41d365aa 100644 --- a/doc/plugins/format.mdwn +++ b/doc/plugins/format.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=format core=0 author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/widget]] This plugin allows mixing different page formats together, by embedding text formatted one way inside a page formatted another way. This is done diff --git a/doc/plugins/fortune.mdwn b/doc/plugins/fortune.mdwn index 9966f456d..3cb125ac1 100644 --- a/doc/plugins/fortune.mdwn +++ b/doc/plugins/fortune.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=fortune author="[[Joey]]"]] [[!tag type/fun]] +[[!tag type/widget]] This plugin implements the [[ikiwiki/directive/fortune]] [[ikiwiki/directive]]. This directive uses the `fortune` program to insert a fortune into the page. diff --git a/doc/plugins/goto.mdwn b/doc/plugins/goto.mdwn index 9c401c5d2..8e1de7a10 100644 --- a/doc/plugins/goto.mdwn +++ b/doc/plugins/goto.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=goto author="[[Simon_McVittie|smcv]]"]] -[[!tag type/useful]] +[[!tag type/web]] This plugin adds a `do=goto` mode for the IkiWiki CGI script. It's mainly for internal use by the [[404]], [[comments]] and [[recentchanges]] diff --git a/doc/plugins/graphviz.mdwn b/doc/plugins/graphviz.mdwn index 8237ae9dc..65130ae8c 100644 --- a/doc/plugins/graphviz.mdwn +++ b/doc/plugins/graphviz.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=graphviz author="[[JoshTriplett]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/graph]] [[ikiwiki/directive]]. This directive allows embedding [graphviz](http://www.graphviz.org/) graphs in a diff --git a/doc/plugins/haiku.mdwn b/doc/plugins/haiku.mdwn index 74eac1c29..448733d95 100644 --- a/doc/plugins/haiku.mdwn +++ b/doc/plugins/haiku.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=haiku author="[[Joey]]"]] [[!tag type/fun]] +[[!tag type/widget]] This plugin provides a [[ikiwiki/directive/haiku]] [[ikiwiki/directive]]. The directive allows inserting a randomly generated haiku into a wiki page. diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn index 114438765..a6cd90f28 100644 --- a/doc/plugins/img.mdwn +++ b/doc/plugins/img.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=img author="Christian Mock"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/img]] [[ikiwiki/directive]]. While ikiwiki supports inlining full-size images by making a diff --git a/doc/plugins/mirrorlist.mdwn b/doc/plugins/mirrorlist.mdwn index b371e8eb7..6e4964ed1 100644 --- a/doc/plugins/mirrorlist.mdwn +++ b/doc/plugins/mirrorlist.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=mirror author="[[Joey]]"]] -[[!tag type/special-purpose]] +[[!tag type/chrome]] This plugin allows adding links a list of mirrors to each page in the wiki. For each mirror, a name and an url should be specified. Pages are diff --git a/doc/plugins/more.mdwn b/doc/plugins/more.mdwn index 81a9e67e8..a0664e843 100644 --- a/doc/plugins/more.mdwn +++ b/doc/plugins/more.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=more author="Ben"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/more]] [[ikiwiki/directive]], which is a way to have a "more" link on a post in a blog, that leads to the diff --git a/doc/plugins/poll.mdwn b/doc/plugins/poll.mdwn index 510f67798..099cb399c 100644 --- a/doc/plugins/poll.mdwn +++ b/doc/plugins/poll.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=poll author="[[Joey]]"]] -[[!tag type/web]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/poll]] [[ikiwiki/directive]], which allows inserting an online poll into a page. diff --git a/doc/plugins/polygen.mdwn b/doc/plugins/polygen.mdwn index 6045c1ec9..f9cea1f4d 100644 --- a/doc/plugins/polygen.mdwn +++ b/doc/plugins/polygen.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=polygen author="Enrico Zini"]] [[!tag type/fun]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/polygen]] [[ikiwiki/directive]], which allows inserting text generated by polygen into a wiki page. diff --git a/doc/plugins/prettydate.mdwn b/doc/plugins/prettydate.mdwn index 11ad4252f..149b7c29c 100644 --- a/doc/plugins/prettydate.mdwn +++ b/doc/plugins/prettydate.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=prettydate author="[[Joey]]"]] [[!tag type/date]] +[[!tag type/chrome]] Enabling this plugin changes the dates displayed on pages in the wiki to a format that is nice and easy to read. Examples: "late Wednesday evening, diff --git a/doc/plugins/relativedate.mdwn b/doc/plugins/relativedate.mdwn index 50c96c5d7..d6e8eb08b 100644 --- a/doc/plugins/relativedate.mdwn +++ b/doc/plugins/relativedate.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=relativedate author="[[Joey]]"]] [[!tag type/date]] +[[!tag type/chrome]] This plugin lets dates be displayed in relative form. Examples: "2 days ago", "1 month and 3 days ago", "30 minutes ago". Hovering over the date will diff --git a/doc/plugins/repolist.mdwn b/doc/plugins/repolist.mdwn index 9b3a7575e..efd9c9352 100644 --- a/doc/plugins/repolist.mdwn +++ b/doc/plugins/repolist.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=repolist author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/web]] This plugin allows you to configure ikiwiki with the location of [[rcs]] repositories for your wiki's source. This is done via the diff --git a/doc/plugins/shortcut.mdwn b/doc/plugins/shortcut.mdwn index 68896f4d3..1e8e85ed8 100644 --- a/doc/plugins/shortcut.mdwn +++ b/doc/plugins/shortcut.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=shortcut author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/shortcut]] [[ikiwiki/directive]]. It allows external links to commonly linked to sites to be made diff --git a/doc/plugins/sparkline.mdwn b/doc/plugins/sparkline.mdwn index bcc5daec6..ee3928d7e 100644 --- a/doc/plugins/sparkline.mdwn +++ b/doc/plugins/sparkline.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=sparkline author="[[Joey]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/sparkline]] [[ikiwiki/directive]], which allows for easily embedding sparklines into diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index fb830044f..fe66f90a8 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=table author="[[VictorMoral]]"]] -[[!tag type/useful]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/table]] [[ikiwiki/directive]]. It can build HTML tables from data in CSV (comma-separated values) diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index 6675207b2..da775f232 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=template author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out diff --git a/doc/plugins/testpagespec.mdwn b/doc/plugins/testpagespec.mdwn index dabcb0bec..8180d5d4b 100644 --- a/doc/plugins/testpagespec.mdwn +++ b/doc/plugins/testpagespec.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=testpagespec author="[[Joey]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] This plugin provides a [[ikiwiki/directive/testpagespec]] [[ikiwiki/directive]]. The directive allows testing a [[ikiwiki/PageSpec]] to see if it matches a diff --git a/doc/plugins/teximg.mdwn b/doc/plugins/teximg.mdwn index ae052837f..f3cade85f 100644 --- a/doc/plugins/teximg.mdwn +++ b/doc/plugins/teximg.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=teximg author="[[PatrickWinnertz]]"]] -[[!tag type/chrome type/slow]] +[[!tag type/widget type/slow]] This plugin provides a [[ikiwiki/directive/teximg]] [[ikiwiki/directive]], that renders LaTeX formulas into images. diff --git a/doc/plugins/toc.mdwn b/doc/plugins/toc.mdwn index 2b7686681..a0ad3a5d0 100644 --- a/doc/plugins/toc.mdwn +++ b/doc/plugins/toc.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=toc author="[[Joey]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/toc]] [[ikiwiki/directive]], which adds a table of contents to a page. diff --git a/doc/plugins/toggle.mdwn b/doc/plugins/toggle.mdwn index 69ac613e0..d1500eba0 100644 --- a/doc/plugins/toggle.mdwn +++ b/doc/plugins/toggle.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=toggle author="[[Joey]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/toggle]] and [[ikiwiki/directive/toggleable]] [[directives|ikiwiki/directive]]. diff --git a/doc/plugins/type/chrome.mdwn b/doc/plugins/type/chrome.mdwn index d3f0eb3d3..a1c6d0728 100644 --- a/doc/plugins/type/chrome.mdwn +++ b/doc/plugins/type/chrome.mdwn @@ -1 +1 @@ -These plugins affect the look and feel of the wiki. +These plugins affect the look and feel of the overall wiki. diff --git a/doc/plugins/type/useful.mdwn b/doc/plugins/type/useful.mdwn deleted file mode 100644 index 92fcf5af1..000000000 --- a/doc/plugins/type/useful.mdwn +++ /dev/null @@ -1 +0,0 @@ -These plugins perform various miscellaneous useful functions. diff --git a/doc/plugins/type/widget.mdwn b/doc/plugins/type/widget.mdwn new file mode 100644 index 000000000..875829d0b --- /dev/null +++ b/doc/plugins/type/widget.mdwn @@ -0,0 +1,2 @@ +These plugins allow inserting various things into pages via a +[[ikiwiki/directive]]. diff --git a/doc/plugins/underlay.mdwn b/doc/plugins/underlay.mdwn index f7eafee7c..8836a394c 100644 --- a/doc/plugins/underlay.mdwn +++ b/doc/plugins/underlay.mdwn @@ -1,17 +1,17 @@ [[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]] -[[!tag type/useful]] +[[!tag type/special-purpose]] -This plugin adds an `add_underlays` option to the setup file. -Its value is a list of underlay directories whose content is added to the wiki. +This plugin adds an `add_underlays` option to the setup file. Its value is +a list of underlay directories whose content is added to the wiki. Multiple underlays are normally set up automatically by other plugins (for -instance, the images used by the [[plugins/smiley]] plugin), but they can also be -used as a way to pull in external files that you don't want in revision control, -like photos or software releases. +instance, the images used by the [[plugins/smiley]] plugin), but they can +also be used as a way to pull in external files that you don't want in +revision control, like photos or software releases. -Directories in `add_underlays` should usually be absolute. If relative, they're -interpreted as relative to the parent directory of the basewiki underlay, which -is probably not particularly useful in this context. +Directories in `add_underlays` should usually be absolute. If relative, +they're interpreted as relative to the parent directory of the basewiki +underlay, which is probably not particularly useful in this context. -- diff --git a/doc/plugins/wmd.mdwn b/doc/plugins/wmd.mdwn index dc9a30703..96c6e2e6c 100644 --- a/doc/plugins/wmd.mdwn +++ b/doc/plugins/wmd.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=wmd author="[[Will]]"]] -[[!tag type/chrome]] +[[!tag type/web]] [WMD](http://wmd-editor.com/) is a What You See Is What You Mean editor for [[mdwn]]. This plugin makes WMD be used for editing pages in the wiki. -- cgit v1.2.3 From 3ce8030dafc40a8188f6a32567c04d157b0ac39f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 03:43:01 -0500 Subject: more tag reorg --- doc/plugins/date.mdwn | 2 +- doc/plugins/linkmap.mdwn | 1 + doc/plugins/listdirectives.mdwn | 1 + doc/plugins/orphans.mdwn | 1 + doc/plugins/pagecount.mdwn | 1 + doc/plugins/pagestats.mdwn | 2 +- doc/plugins/progress.mdwn | 2 +- doc/plugins/version.mdwn | 1 + 8 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/date.mdwn b/doc/plugins/date.mdwn index b8dbdfee5..2a33f014c 100644 --- a/doc/plugins/date.mdwn +++ b/doc/plugins/date.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=date author="[[Joey]]"]] -[[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/date]] [[ikiwiki/directive]], which provides a way to display an arbitrary date diff --git a/doc/plugins/linkmap.mdwn b/doc/plugins/linkmap.mdwn index 89cb9d8ae..7e51cd935 100644 --- a/doc/plugins/linkmap.mdwn +++ b/doc/plugins/linkmap.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=linkmap author="[[Joey]]"]] [[!tag type/meta]] +[[!tag type/widget]] [[!tag type/slow]] This plugin provides the [[ikiwiki/directive/linkmap]] [[ikiwiki/directive]]. diff --git a/doc/plugins/listdirectives.mdwn b/doc/plugins/listdirectives.mdwn index 2d9bce01d..df854de52 100644 --- a/doc/plugins/listdirectives.mdwn +++ b/doc/plugins/listdirectives.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=listdirectives author="Will"]] [[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/listdirectives]] [[ikiwiki/directive]], which inserts a list of currently available diff --git a/doc/plugins/orphans.mdwn b/doc/plugins/orphans.mdwn index e403c2d18..09ad0a51d 100644 --- a/doc/plugins/orphans.mdwn +++ b/doc/plugins/orphans.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=orphans author="[[Joey]]"]] [[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/orphans]] [[ikiwiki/directive]], which generates a list of possibly orphaned pages -- diff --git a/doc/plugins/pagecount.mdwn b/doc/plugins/pagecount.mdwn index a56027e60..71872fae8 100644 --- a/doc/plugins/pagecount.mdwn +++ b/doc/plugins/pagecount.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=pagecount author="[[Joey]]"]] [[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/pagecount]] [[ikiwiki/directive]], which displays the number of pages diff --git a/doc/plugins/pagestats.mdwn b/doc/plugins/pagestats.mdwn index c3eba6363..347e39a89 100644 --- a/doc/plugins/pagestats.mdwn +++ b/doc/plugins/pagestats.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=pagestats author="Enrico Zini"]] -[[!tag type/meta type/tags]] +[[!tag type/meta type/tags type/widget]] This plugin provides the [[ikiwiki/directive/pagestats]] [[ikiwiki/directive]], which can generate stats about how pages link to diff --git a/doc/plugins/progress.mdwn b/doc/plugins/progress.mdwn index e1b560cc8..20736d18c 100644 --- a/doc/plugins/progress.mdwn +++ b/doc/plugins/progress.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=progress author="[[Will]]"]] -[[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/progress]] [[ikiwiki/directive]], which generates a progress bar. diff --git a/doc/plugins/version.mdwn b/doc/plugins/version.mdwn index 43027bdd7..326a2e7ce 100644 --- a/doc/plugins/version.mdwn +++ b/doc/plugins/version.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=version author="[[Joey]]"]] [[!tag type/meta]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/version]] [[ikiwiki/directive]], which inserts the current version -- cgit v1.2.3 From 21b4f11cbb0796e858f95dcee2ff117fb4e10afe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 03:47:21 -0500 Subject: more tag reorg --- doc/plugins/editpage.mdwn | 1 + doc/plugins/getsource.mdwn | 1 + doc/plugins/inline.mdwn | 1 + doc/plugins/mirrorlist.mdwn | 2 +- doc/plugins/parentlinks.mdwn | 2 +- doc/plugins/recentchanges.mdwn | 1 + doc/plugins/recentchangesdiff.mdwn | 1 + doc/plugins/rsync.mdwn | 1 + 8 files changed, 8 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/editpage.mdwn b/doc/plugins/editpage.mdwn index b830e51aa..346ee7c78 100644 --- a/doc/plugins/editpage.mdwn +++ b/doc/plugins/editpage.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=editpage core=1 author="[[Joey]]"]] +[[!tag type/web]] This plugin allows editing wiki pages in the web interface. It's enabled by default if [[cgi]] is enabled; disable it if you want cgi for other things diff --git a/doc/plugins/getsource.mdwn b/doc/plugins/getsource.mdwn index 20040ccee..d5404a628 100644 --- a/doc/plugins/getsource.mdwn +++ b/doc/plugins/getsource.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=getsource author="[[Will_Uther|Will]]"]] +[[!tag type/web]] This plugin adds a "Source" link to the top of each page that uses the CGI to display the page's source. diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn index 6c3282576..3eb849fdb 100644 --- a/doc/plugins/inline.mdwn +++ b/doc/plugins/inline.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=inline core=1 author="[[Joey]]"]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/inline]] [[ikiwiki/directive]], which allows including one wiki page diff --git a/doc/plugins/mirrorlist.mdwn b/doc/plugins/mirrorlist.mdwn index 6e4964ed1..aedc1f4a0 100644 --- a/doc/plugins/mirrorlist.mdwn +++ b/doc/plugins/mirrorlist.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=mirror author="[[Joey]]"]] -[[!tag type/chrome]] +[[!tag type/web]] This plugin allows adding links a list of mirrors to each page in the wiki. For each mirror, a name and an url should be specified. Pages are diff --git a/doc/plugins/parentlinks.mdwn b/doc/plugins/parentlinks.mdwn index ef262a30c..c2d364bef 100644 --- a/doc/plugins/parentlinks.mdwn +++ b/doc/plugins/parentlinks.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=parentlinks core=1 author="[[intrigeri]]"]] -[[!tag type/link]] +[[!tag type/link type/chrome]] This plugin generates the links to a page's parents that typically appear at the top of a wiki page. diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn index 9375296a4..823f68502 100644 --- a/doc/plugins/recentchanges.mdwn +++ b/doc/plugins/recentchanges.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=recentchanges core=1 author="[[Joey]]"]] +[[!tag type/meta]] This plugin examines the [[revision_control_system|rcs]] history and generates a page describing each recent change made to the wiki. These diff --git a/doc/plugins/recentchangesdiff.mdwn b/doc/plugins/recentchangesdiff.mdwn index a7b113ade..57299f92d 100644 --- a/doc/plugins/recentchangesdiff.mdwn +++ b/doc/plugins/recentchangesdiff.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=recentchangesdiff core=0 author="[[Joey]]"]] +[[!tag type/meta]] This plugin extends the [[recentchanges]] plugin, adding a diff for each change. The diffs are by default hidden from display on the recentchanges diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn index 315b663c0..e48886168 100644 --- a/doc/plugins/rsync.mdwn +++ b/doc/plugins/rsync.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=rsync author="[[schmonz]]"]] +[[!tag type/special-purpose]] This plugin allows ikiwiki to push generated pages to another host by running a command such as `rsync`. -- cgit v1.2.3 From 1db0dd855ae49e4bb7b74e1158fc0356836d45a7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 03:56:56 -0500 Subject: one more --- doc/plugins/map.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/map.mdwn b/doc/plugins/map.mdwn index 8f5a9f15e..b164d5ca8 100644 --- a/doc/plugins/map.mdwn +++ b/doc/plugins/map.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=map author="Alessandro Dotti Contra"]] -[[!tag type/meta]] +[[!tag type/meta type/widget]] This plugin provides the [[ikiwiki/directive/map]] [[ikiwiki/directive]], which generates a hierarchical page map for the wiki. -- cgit v1.2.3 From a7eb434afd216e0b473ac82777544c9c45852792 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 04:10:11 -0500 Subject: another (last?) tag change --- doc/plugins/postsparkline.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/postsparkline.mdwn b/doc/plugins/postsparkline.mdwn index c81f91bdc..b0733e343 100644 --- a/doc/plugins/postsparkline.mdwn +++ b/doc/plugins/postsparkline.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=postsparkline author="[[Joey]]"]] -[[!tag type/chrome]] +[[!tag type/widget]] This plugin provides the [[ikiwiki/directive/postsparkline]] [[ikiwiki/directive]]. It uses the [[sparkline]] plugin to create a sparkline of -- cgit v1.2.3 From 20ba12802b3897bf48d8a7704a57e9cede2466bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 04:22:15 -0500 Subject: add section information --- IkiWiki/Plugin/404.pm | 1 + IkiWiki/Plugin/aggregate.pm | 1 + IkiWiki/Plugin/amazon_s3.pm | 1 + IkiWiki/Plugin/attachment.pm | 1 + IkiWiki/Plugin/autoindex.pm | 1 + IkiWiki/Plugin/comments.pm | 1 + IkiWiki/Plugin/editdiff.pm | 1 + IkiWiki/Plugin/edittemplate.pm | 1 + IkiWiki/Plugin/getsource.pm | 1 + IkiWiki/Plugin/google.pm | 1 + IkiWiki/Plugin/goto.pm | 1 + IkiWiki/Plugin/mirrorlist.pm | 1 + IkiWiki/Plugin/norcs.pm | 1 + IkiWiki/Plugin/pingee.pm | 1 + IkiWiki/Plugin/pinger.pm | 1 + IkiWiki/Plugin/remove.pm | 1 + IkiWiki/Plugin/rename.pm | 1 + IkiWiki/Plugin/repolist.pm | 1 + IkiWiki/Plugin/rsync.pm | 1 + IkiWiki/Plugin/search.pm | 1 + IkiWiki/Plugin/testpagespec.pm | 1 + IkiWiki/Plugin/underlay.pm | 1 + IkiWiki/Plugin/websetup.pm | 1 + IkiWiki/Plugin/wmd.pm | 2 ++ doc/plugins/write.mdwn | 3 ++- 25 files changed, 27 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/404.pm b/IkiWiki/Plugin/404.pm index 85486e559..8adfd5dd9 100644 --- a/IkiWiki/Plugin/404.pm +++ b/IkiWiki/Plugin/404.pm @@ -21,6 +21,7 @@ sub getsetup () { # server admin action too safe => 0, rebuild => 0, + section => "web", } } diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 5a9eb433d..c18d413e6 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -43,6 +43,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "special-purpose", }, aggregateinternal => { type => "boolean", diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm index cfd8cd347..f2f4dbcf2 100644 --- a/IkiWiki/Plugin/amazon_s3.pm +++ b/IkiWiki/Plugin/amazon_s3.pm @@ -45,6 +45,7 @@ sub getsetup () { plugin => { safe => 0, rebuild => 0, + section => "special-purpose", }, amazon_s3_key_id => { type => "string", diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index cbe6efc21..ad1dd9bca 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", }, allowed_attachments => { type => "pagespec", diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 555856b11..e50464dca 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index caed0d58c..1e71749a4 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -38,6 +38,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "web", }, comments_pagespec => { type => 'pagespec', diff --git a/IkiWiki/Plugin/editdiff.pm b/IkiWiki/Plugin/editdiff.pm index 7df6a9ffb..d8f53a42e 100644 --- a/IkiWiki/Plugin/editdiff.pm +++ b/IkiWiki/Plugin/editdiff.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", }, } diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index a163b0d84..5f0551d92 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -23,6 +23,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "web", }, } diff --git a/IkiWiki/Plugin/getsource.pm b/IkiWiki/Plugin/getsource.pm index d1555430e..b362de726 100644 --- a/IkiWiki/Plugin/getsource.pm +++ b/IkiWiki/Plugin/getsource.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "web", }, getsource_mimetype => { type => "string", diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 483fa1707..48ad4c8ce 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "web", }, } diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm index 439552f62..03bd682b3 100644 --- a/IkiWiki/Plugin/goto.pm +++ b/IkiWiki/Plugin/goto.pm @@ -14,6 +14,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", } } diff --git a/IkiWiki/Plugin/mirrorlist.pm b/IkiWiki/Plugin/mirrorlist.pm index d0a6107ef..92be7913e 100644 --- a/IkiWiki/Plugin/mirrorlist.pm +++ b/IkiWiki/Plugin/mirrorlist.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "web", }, mirrorlist => { type => "string", diff --git a/IkiWiki/Plugin/norcs.pm b/IkiWiki/Plugin/norcs.pm index bfe84c0e1..e6a05a3c5 100644 --- a/IkiWiki/Plugin/norcs.pm +++ b/IkiWiki/Plugin/norcs.pm @@ -25,6 +25,7 @@ sub getsetup () { plugin => { safe => 0, # rcs plugin rebuild => 0, + section => "rcs", }, } diff --git a/IkiWiki/Plugin/pingee.pm b/IkiWiki/Plugin/pingee.pm index f5386d0ca..aafce9e70 100644 --- a/IkiWiki/Plugin/pingee.pm +++ b/IkiWiki/Plugin/pingee.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/pinger.pm b/IkiWiki/Plugin/pinger.pm index c20ecb5d4..a797fc7bd 100644 --- a/IkiWiki/Plugin/pinger.pm +++ b/IkiWiki/Plugin/pinger.pm @@ -21,6 +21,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "special-purpose", }, pinger_timeout => { type => "integer", diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 3c1e0c713..f59d0269e 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", }, } diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 8213d21f6..3908443ca 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", }, } diff --git a/IkiWiki/Plugin/repolist.pm b/IkiWiki/Plugin/repolist.pm index f69ec3988..ba7c5f0aa 100644 --- a/IkiWiki/Plugin/repolist.pm +++ b/IkiWiki/Plugin/repolist.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "web", }, repositories => { type => "string", diff --git a/IkiWiki/Plugin/rsync.pm b/IkiWiki/Plugin/rsync.pm index e38801e4a..8dd983be7 100644 --- a/IkiWiki/Plugin/rsync.pm +++ b/IkiWiki/Plugin/rsync.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 0, rebuild => 0, + section => "special-purpose", }, rsync_command => { type => "string", diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 393c17e0f..fb68396a1 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, + section => "web", }, omega_cgi => { type => "string", diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 440fca33b..17a77cb69 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index 116fe7324..ab74fc37e 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 0, rebuild => undef, + section => "special-purpose", }, add_underlays => { type => "string", diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 445552e40..5c19c9b63 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, + section => "web", }, websetup_force_plugins => { type => "string", diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 9ddd237ab..5361d2914 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -17,6 +17,8 @@ sub getsetup () { return plugin => { safe => 1, + rebuild => 0, + section => "web", }, } diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 68454d56c..fbaabb6a0 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -498,7 +498,8 @@ describes the plugin as a whole. For example: and undef if a rebuild could be needed in some circumstances, but is not strictly required. * `section` can optionally specify which section in the config file - the plugin fits in. + the plugin fits in. The convention is to name the sections the + same as the tags used for [[plugins|plugin]] on this wiki. ### genwrapper -- cgit v1.2.3 From 5d566d8b32e7ec260df996366b471631d6a3b47c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 14:38:43 -0500 Subject: reorg and expand docs of some variables --- doc/plugins/write.mdwn | 99 ++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 44 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index fbaabb6a0..712dda8bf 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -31,7 +31,7 @@ they're the same as far as how they hook into ikiwiki. This document will explain how to write both sorts of plugins, albeit with an emphasis on perl plugins. -## Considerations +## Remember: Ikiwiki is a compiler One thing to keep in mind when writing a plugin is that ikiwiki is a wiki *compiler*. So plugins influence pages when they are built, not when they @@ -40,7 +40,23 @@ example, will insert the build time. Also, as a compiler, ikiwiki avoids rebuilding pages unless they have changed, so a plugin that prints some random or changing thing on a page will generate a static page that won't change until ikiwiki rebuilds the page for some other reason, like the page -being edited. +being edited. The [[tutorial]] has some other examples of ways that ikiwiki +being a compiler may trip up the unwary. + +## Plugin interface + +To import the ikiwiki plugin interface: + + use IkiWiki '3.00'; + +This will import several variables and functions into your plugin's +namespace. These variables and functions are the ones most plugins need, +and a special effort will be made to avoid changing them in incompatible +ways, and to document any changes that have to be made in the future. + +Note that IkiWiki also provides other variables and functions that are not +exported by default. No guarantee is made about these in the future, so if +it's not exported, the wise choice is to not use it. ## Registering plugins @@ -508,28 +524,17 @@ describes the plugin as a whole. For example: This hook is used to inject C code (which it returns) into the `main` function of the ikiwiki wrapper when it is being generated. -## Plugin interface - -To import the ikiwiki plugin interface: +### Exported variables - use IkiWiki '3.00'; +Several variables are exported to your plugin when you `use IkiWiki;` -This will import several variables and functions into your plugin's -namespace. These variables and functions are the ones most plugins need, -and a special effort will be made to avoid changing them in incompatible -ways, and to document any changes that have to be made in the future. - -Note that IkiWiki also provides other variables and functions that are not -exported by default. No guarantee is made about these in the future, so if -it's not exported, the wise choice is to not use it. - -### %config +#### %config A plugin can access the wiki's configuration via the `%config` hash. The best way to understand the contents of the hash is to look at your ikiwiki setup file, which sets the hash content to configure the wiki. -### %pagestate +#### %pagestate The `%pagestate` hash can be used by plugins to save state that they will need next time ikiwiki is run. The hash holds per-page state, so to set a value, @@ -547,7 +552,7 @@ When pages are deleted, ikiwiki automatically deletes their pagestate too. Note that page state does not persist across wiki rebuilds, only across wiki updates. -### %wikistate +#### %wikistate The `%wikistate` hash can be used by a plugin to store persistant state that is not bound to any one page. To set a value, use @@ -556,19 +561,25 @@ serialize, `$key` is any string you like, and `$id` must be the same as the "id" parameter passed to `hook()` when registering the plugin, so that the state can be dropped if the plugin is no longer used. -### Other variables +#### %links + +The `%links` hash can be used to look up the names of each page that +a page links to. The name of the page is the key; the value is an array +reference. Do not modify this hash directly; call `add_link()`. + +#### %destsources -If your plugin needs to access data about other pages in the wiki. It can -use the following hashes, using a page name as the key: +The `%destsources` hash records the name of the source file used to +create each destination file. The key is the output filename (ie, +"foo/index.html"), and the value is the source filename that it was built +from (eg, "foo.mdwn"). Note that a single source file may create multiple +destination files. Do not modify this hash directly; call `will_render()`. -* `%links` lists the names of each page that a page links to, in an array - reference. -* `%destsources` contains the name of the source file used to create each - destination file. -* `%pagesources` contains the name of the source file for each page. +#### %pagesources -Also, the `%IkiWiki::version` variable contains the version number for the -ikiwiki program. +The `%pagesources` has can be used to look up the source filename +of a page. So the key is the page name, and the value is the source +filename. Do not modify this hash. ### Library functions @@ -614,22 +625,6 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -### `deptype(@)` - -Use this function to generate ikiwiki's internal representation of a -dependency type from one or more of these keywords: - -* `content` is the default. Any change to the content - of a page triggers the dependency. -* `presence` is only triggered by a change to the presence - of a page. -* `links` is only triggered by a change to the links of a page. - This includes when a link is added, removed, or changes what - it points to due to other changes. It does not include the - addition or removal of a duplicate link. - -If multiple types are specified, they are combined. - #### `pagespec_match_list($$;@)` Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages @@ -683,6 +678,22 @@ The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match relative to the top of the wiki. +#### `deptype(@)` + +Use this function to generate ikiwiki's internal representation of a +dependency type from one or more of these keywords: + +* `content` is the default. Any change to the content + of a page triggers the dependency. +* `presence` is only triggered by a change to the presence + of a page. +* `links` is only triggered by a change to the links of a page. + This includes when a link is added, removed, or changes what + it points to due to other changes. It does not include the + addition or removal of a duplicate link. + +If multiple types are specified, they are combined. + #### `bestlink($$)` Given a page and the text of a link on the page, determine which -- cgit v1.2.3 From b1c47b4065b245ccf46b99292d7de61800468237 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 14:41:28 -0500 Subject: heading tweaks --- doc/plugins/write.mdwn | 64 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 712dda8bf..17c54ffc7 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -524,17 +524,17 @@ describes the plugin as a whole. For example: This hook is used to inject C code (which it returns) into the `main` function of the ikiwiki wrapper when it is being generated. -### Exported variables +## Exported variables Several variables are exported to your plugin when you `use IkiWiki;` -#### %config +### %config A plugin can access the wiki's configuration via the `%config` hash. The best way to understand the contents of the hash is to look at your ikiwiki setup file, which sets the hash content to configure the wiki. -#### %pagestate +### %pagestate The `%pagestate` hash can be used by plugins to save state that they will need next time ikiwiki is run. The hash holds per-page state, so to set a value, @@ -552,7 +552,7 @@ When pages are deleted, ikiwiki automatically deletes their pagestate too. Note that page state does not persist across wiki rebuilds, only across wiki updates. -#### %wikistate +### %wikistate The `%wikistate` hash can be used by a plugin to store persistant state that is not bound to any one page. To set a value, use @@ -561,13 +561,13 @@ serialize, `$key` is any string you like, and `$id` must be the same as the "id" parameter passed to `hook()` when registering the plugin, so that the state can be dropped if the plugin is no longer used. -#### %links +### %links The `%links` hash can be used to look up the names of each page that a page links to. The name of the page is the key; the value is an array reference. Do not modify this hash directly; call `add_link()`. -#### %destsources +### %destsources The `%destsources` hash records the name of the source file used to create each destination file. The key is the output filename (ie, @@ -575,15 +575,15 @@ create each destination file. The key is the output filename (ie, from (eg, "foo.mdwn"). Note that a single source file may create multiple destination files. Do not modify this hash directly; call `will_render()`. -#### %pagesources +### %pagesources The `%pagesources` has can be used to look up the source filename of a page. So the key is the page name, and the value is the source filename. Do not modify this hash. -### Library functions +## Library functions -#### `hook(@)` +### `hook(@)` Hook into ikiwiki's processing. See the discussion of hooks above. @@ -592,12 +592,12 @@ named `no_override` is supported, If it's set to a true value, then this hook will not override any existing hook with the same id. This is useful if the id can be controled by the user. -#### `debug($)` +### `debug($)` Logs a debugging message. These are supressed unless verbose mode is turned on. -#### `error($;$)` +### `error($;$)` Aborts with an error message. If the second parameter is passed, it is a function that is called after the error message is printed, to do any final @@ -611,13 +611,13 @@ In other hooks, error() is a fatal error, so use with care. Try to avoid dying on bad input when building a page, as that will halt the entire wiki build and make the wiki unusable. -#### `template($;@)` +### `template($;@)` Creates and returns a [[!cpan HTML::Template]] object. The first parameter is the name of the file in the template directory. The optional remaining parameters are passed to `HTML::Template->new`. -#### `htmlpage($)` +### `htmlpage($)` Passed a page name, returns the base name that will be used for a the html page created from it. (Ie, it appends ".html".) @@ -625,7 +625,7 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -#### `pagespec_match_list($$;@)` +### `pagespec_match_list($$;@)` Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages in the wiki that match the [[ikiwiki/PageSpec]]. @@ -656,7 +656,7 @@ Additional named parameters can be specified: Any other named parameters are passed on to `pagespec_match`, to further limit the match. -#### `add_depends($$;$)` +### `add_depends($$;$)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. @@ -678,7 +678,7 @@ The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match relative to the top of the wiki. -#### `deptype(@)` +### `deptype(@)` Use this function to generate ikiwiki's internal representation of a dependency type from one or more of these keywords: @@ -730,7 +730,7 @@ control some options. These are: * class - set to add a css class to the link * title - set to add a title attribute to the link -#### `readfile($;$)` +### `readfile($;$)` Given a filename, reads and returns the entire file. @@ -739,7 +739,7 @@ in binary mode. A failure to read the file will result in it dying with an error. -#### `writefile($$$;$$)` +### `writefile($$$;$$)` Given a filename, a directory to put it in, and the file's content, writes a file. @@ -767,7 +767,7 @@ generally the directory parameter is a trusted toplevel directory like the srcdir or destdir, and any subdirectories of this are included in the filename parameter. -#### `will_render($$)` +### `will_render($$)` Given a page name and a destination file name (not including the base destination directory), register that the page will result in that file @@ -783,34 +783,34 @@ Ikiwiki uses this information to automatically clean up rendered files when the page that rendered them goes away or is changed to no longer render them. will_render also does a few important security checks. -#### `pagetype($)` +### `pagetype($)` Given the name of a source file, returns the type of page it is, if it's a type that ikiwiki knowns how to htmlize. Otherwise, returns undef. -#### `pagename($)` +### `pagename($)` Given the name of a source file, returns the name of the wiki page that corresponds to that file. -#### `pagetitle($)` +### `pagetitle($)` Give the name of a wiki page, returns a version suitable to be displayed as the page's title. This is accomplished by de-escaping escaped characters in the page name. "_" is replaced with a space, and '__NN__' is replaced by the UTF character with code NN. -#### `titlepage($)` +### `titlepage($)` This performs the inverse of `pagetitle`, ie, it converts a page title into a wiki page name. -#### `linkpage($)` +### `linkpage($)` This converts text that could have been entered by the user as a [[ikiwiki/WikiLink]] into a wiki page name. -#### `srcfile($;$)` +### `srcfile($;$)` Given the name of a source file in the wiki, searches for the file in the source directory and the underlay directories (most recently added @@ -820,7 +820,7 @@ Normally srcfile will fail with an error message if the source file cannot be found. The second parameter can be set to a true value to make it return undef instead. -#### `add_underlay($)` +### `add_underlay($)` Adds a directory to the set of underlay directories that ikiwiki will search for files. @@ -828,18 +828,18 @@ search for files. If the directory name is not absolute, ikiwiki will assume it is in the parent directory of the configured underlaydir. -#### `displaytime($;$)` +### `displaytime($;$)` Given a time, formats it for display. The optional second parameter is a strftime format to use to format the time. -#### `gettext` +### `gettext` This is the standard gettext function, although slightly optimised. -#### `urlto($$;$)` +### `urlto($$;$)` Construct a relative url to the first parameter from the page named by the second. The first parameter can be either a page name, or some other @@ -848,13 +848,13 @@ destination file, as registered by `will_render`. If the third parameter is passed and is true, an absolute url will be constructed instead of the default relative url. -#### `newpagefile($$)` +### `newpagefile($$)` This can be called when creating a new page, to determine what filename to save the page to. It's passed a page name, and its type, and returns the name of the file to create, relative to the srcdir. -#### `targetpage($$;$)` +### `targetpage($$;$)` Passed a page and an extension, returns the filename that page will be rendered to. @@ -863,7 +863,7 @@ Optionally, a third parameter can be passed, to specify the preferred filename of the page. For example, `targetpage("foo", "rss", "feed")` will yield something like `foo/feed.rss`. -#### `add_link($$)` +### `add_link($$)` This adds a link to `%links`, ensuring that duplicate links are not added. Pass it the page that contains the link, and the link text. -- cgit v1.2.3 From ba19f940bd071f7065246594751dd49041cbbaba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 14:44:26 -0500 Subject: move note to sidebox --- doc/plugins/write.mdwn | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 17c54ffc7..07bfd72ac 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -3,6 +3,20 @@ written to extend ikiwiki in many ways. Despite the length of this page, it's not really hard. This page is a complete reference to everything a plugin might want to do. There is also a quick [[tutorial]]. +[[!template type="note" text=""" +Ikiwiki is a compiler + +One thing to keep in mind when writing a plugin is that ikiwiki is a wiki +*compiler*. So plugins influence pages when they are built, not when they +are loaded. A plugin that inserts the current time into a page, for +example, will insert the build time. Also, as a compiler, ikiwiki avoids +rebuilding pages unless they have changed, so a plugin that prints some +random or changing thing on a page will generate a static page that won't +change until ikiwiki rebuilds the page for some other reason, like the page +being edited. The [[tutorial]] has some other examples of ways that ikiwiki +being a compiler may trip up the unwary. +"""]] + [[!toc levels=2]] ## Types of plugins @@ -31,18 +45,6 @@ they're the same as far as how they hook into ikiwiki. This document will explain how to write both sorts of plugins, albeit with an emphasis on perl plugins. -## Remember: Ikiwiki is a compiler - -One thing to keep in mind when writing a plugin is that ikiwiki is a wiki -*compiler*. So plugins influence pages when they are built, not when they -are loaded. A plugin that inserts the current time into a page, for -example, will insert the build time. Also, as a compiler, ikiwiki avoids -rebuilding pages unless they have changed, so a plugin that prints some -random or changing thing on a page will generate a static page that won't -change until ikiwiki rebuilds the page for some other reason, like the page -being edited. The [[tutorial]] has some other examples of ways that ikiwiki -being a compiler may trip up the unwary. - ## Plugin interface To import the ikiwiki plugin interface: -- cgit v1.2.3 From 60410369daef9ce990d516f0d538571db4623ceb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 14:48:22 -0500 Subject: add variable value examples --- doc/plugins/write.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 07bfd72ac..f2b96b6d9 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -3,7 +3,7 @@ written to extend ikiwiki in many ways. Despite the length of this page, it's not really hard. This page is a complete reference to everything a plugin might want to do. There is also a quick [[tutorial]]. -[[!template type="note" text=""" +[[!template id="note" text=""" Ikiwiki is a compiler One thing to keep in mind when writing a plugin is that ikiwiki is a wiki @@ -569,6 +569,8 @@ The `%links` hash can be used to look up the names of each page that a page links to. The name of the page is the key; the value is an array reference. Do not modify this hash directly; call `add_link()`. + $links{"foo"} = ["bar", "baz"]; + ### %destsources The `%destsources` hash records the name of the source file used to @@ -576,6 +578,8 @@ create each destination file. The key is the output filename (ie, "foo/index.html"), and the value is the source filename that it was built from (eg, "foo.mdwn"). Note that a single source file may create multiple destination files. Do not modify this hash directly; call `will_render()`. + + $destsources{"foo/index.html"} = "foo.mdwn"; ### %pagesources @@ -583,6 +587,8 @@ The `%pagesources` has can be used to look up the source filename of a page. So the key is the page name, and the value is the source filename. Do not modify this hash. + $pagesources{"foo"} = "foo.mdwn"; + ## Library functions ### `hook(@)` -- cgit v1.2.3 From 4a7558539cd9d0f1ed5c586c29811035f7c14d14 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 15:38:07 -0500 Subject: add highlevel view of when hooks are called during compile and cgi phases --- doc/plugins/write.mdwn | 97 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 19 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index f2b96b6d9..d94216e17 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -9,16 +9,73 @@ Ikiwiki is a compiler One thing to keep in mind when writing a plugin is that ikiwiki is a wiki *compiler*. So plugins influence pages when they are built, not when they are loaded. A plugin that inserts the current time into a page, for -example, will insert the build time. Also, as a compiler, ikiwiki avoids -rebuilding pages unless they have changed, so a plugin that prints some -random or changing thing on a page will generate a static page that won't -change until ikiwiki rebuilds the page for some other reason, like the page -being edited. The [[tutorial]] has some other examples of ways that ikiwiki -being a compiler may trip up the unwary. +example, will insert the build time. + +Also, as a compiler, ikiwiki avoids rebuilding pages unless they have +changed, so a plugin that prints some random or changing thing on a page +will generate a static page that won't change until ikiwiki rebuilds the +page for some other reason, like the page being edited. + +The [[tutorial]] has some other examples of ways that ikiwiki being a +compiler may trip up the unwary. """]] [[!toc levels=2]] +## Highlevel view of ikiwiki + +Ikiwiki mostly has two modes of operation. It can either be running +as a compiler, building or updating a wiki; or as a cgi program, providing +user interface for editing pages, etc. Almost everything ikiwiki does +is accomplished by calling various hooks provided by plugins. + +### compiler + +As a compiler, starts by calling the `refresh` hook. Then it checks +the wiki's source to find new or changed pages. The `needsbuild` hook is +then called to allow manipulation of the list of pages that need to be +built. + +Now that it knows what pages it needs to build, ikiwiki runs two +compile passes. First, it runs `scan` hooks, which collect metadata about +the pages. Then it runs a page rendering pipeline, by calling in turn these +hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `postscan`, +`pagetemplate`, `sanitize`, `format`. + +After all necessary pages are built, it calls the `change` hook. Finally, +if a page is was deleted, the `delete` hook is called, and the files that +page had previously produced are removed. + +### cgi + +The flow between hooks when ikiwiki is run as a cgi is best illistrated by +an example. + +* *Alice browses to a page and clicks Edit.* +* Ikiwiki is run as a cgi. It assigns Alice a session cookie, and, + by calling the `auth` hooks, sees that she is not yet logged in. +* The `sessioncgi` hooks are then called, and one of them, + from the [[editpage]] plugin, notices that the cgi has been told "do=edit". +* The [[editpage]] plugin calls the `canedit` hook to check if this + page edit is allowed. The [[signinedit]] plugin has a hook that says not: + Alice is not signed in. +* The [[signinedit]] plugin then launches the signin process. A signin + page is built by calling the `formbuilder_setup` hook. +* *Alice signs in with her openid.* +* The [[openid]] plugin's `formbuilder` hook sees that an openid was + entered in the signin form, and redirects to Alice's openid provider. +* Alice's openid provider calls back to ikiwiki. The [[openid]] plugin + has an `auth` hook that finishes the openid signin process. +* Signin complete, ikiwiki returns to what Alice was doing before; editing + a page. +* Now all the `canedit` hooks are happy. The [[editpage]] plugin calls + `formbuilder_setup` to display the page editing form. +* *Alice saves her change to the page.* +* The [[editpage]] plugin's `formbuilder` hook sees that the Save button + was pressed, and calls the `checkcontent` and `editcontent` hooks. + Then it saves the page to disk, and branches into the compiler part + of ikiwiki to refresh the wiki. + ## Types of plugins Most ikiwiki [[plugins]] are written in perl, like ikiwiki. This gives the @@ -530,13 +587,13 @@ function of the ikiwiki wrapper when it is being generated. Several variables are exported to your plugin when you `use IkiWiki;` -### %config +### `%config` A plugin can access the wiki's configuration via the `%config` hash. The best way to understand the contents of the hash is to look at your ikiwiki setup file, which sets the hash content to configure the wiki. -### %pagestate +### `%pagestate` The `%pagestate` hash can be used by plugins to save state that they will need next time ikiwiki is run. The hash holds per-page state, so to set a value, @@ -554,7 +611,7 @@ When pages are deleted, ikiwiki automatically deletes their pagestate too. Note that page state does not persist across wiki rebuilds, only across wiki updates. -### %wikistate +### `%wikistate` The `%wikistate` hash can be used by a plugin to store persistant state that is not bound to any one page. To set a value, use @@ -563,7 +620,7 @@ serialize, `$key` is any string you like, and `$id` must be the same as the "id" parameter passed to `hook()` when registering the plugin, so that the state can be dropped if the plugin is no longer used. -### %links +### `%links` The `%links` hash can be used to look up the names of each page that a page links to. The name of the page is the key; the value is an array @@ -571,7 +628,15 @@ reference. Do not modify this hash directly; call `add_link()`. $links{"foo"} = ["bar", "baz"]; -### %destsources +### `%pagesources` + +The `%pagesources` has can be used to look up the source filename +of a page. So the key is the page name, and the value is the source +filename. Do not modify this hash. + + $pagesources{"foo"} = "foo.mdwn"; + +### `%destsources` The `%destsources` hash records the name of the source file used to create each destination file. The key is the output filename (ie, @@ -581,16 +646,10 @@ destination files. Do not modify this hash directly; call `will_render()`. $destsources{"foo/index.html"} = "foo.mdwn"; -### %pagesources - -The `%pagesources` has can be used to look up the source filename -of a page. So the key is the page name, and the value is the source -filename. Do not modify this hash. - - $pagesources{"foo"} = "foo.mdwn"; - ## Library functions +Several functions are exported to your plugin when you `use IkiWiki;` + ### `hook(@)` Hook into ikiwiki's processing. See the discussion of hooks above. -- cgit v1.2.3 From 7b07286a6f4a9903d5a346205b8eaaf93dbb9d0d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 15:41:19 -0500 Subject: layout --- doc/plugins/write.mdwn | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index d94216e17..4fd9c4369 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -31,7 +31,7 @@ is accomplished by calling various hooks provided by plugins. ### compiler -As a compiler, starts by calling the `refresh` hook. Then it checks +As a compiler, ikiwiki starts by calling the `refresh` hook. Then it checks the wiki's source to find new or changed pages. The `needsbuild` hook is then called to allow manipulation of the list of pages that need to be built. @@ -48,10 +48,11 @@ page had previously produced are removed. ### cgi -The flow between hooks when ikiwiki is run as a cgi is best illistrated by +The flow between hooks when ikiwiki is run as a cgi is best illustrated by an example. -* *Alice browses to a page and clicks Edit.* +Alice browses to a page and clicks Edit. + * Ikiwiki is run as a cgi. It assigns Alice a session cookie, and, by calling the `auth` hooks, sees that she is not yet logged in. * The `sessioncgi` hooks are then called, and one of them, @@ -61,7 +62,9 @@ an example. Alice is not signed in. * The [[signinedit]] plugin then launches the signin process. A signin page is built by calling the `formbuilder_setup` hook. -* *Alice signs in with her openid.* + +Alice signs in with her openid. + * The [[openid]] plugin's `formbuilder` hook sees that an openid was entered in the signin form, and redirects to Alice's openid provider. * Alice's openid provider calls back to ikiwiki. The [[openid]] plugin @@ -70,7 +73,9 @@ an example. a page. * Now all the `canedit` hooks are happy. The [[editpage]] plugin calls `formbuilder_setup` to display the page editing form. -* *Alice saves her change to the page.* + +Alice saves her change to the page. + * The [[editpage]] plugin's `formbuilder` hook sees that the Save button was pressed, and calls the `checkcontent` and `editcontent` hooks. Then it saves the page to disk, and branches into the compiler part -- cgit v1.2.3 From f4c517110e1bc1ab9bf6e931073959cdcff1302b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 15:52:03 -0500 Subject: formatting --- doc/plugins/write.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 4fd9c4369..a8c9de2d3 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -536,7 +536,7 @@ The data returned is a list of `%config` options, followed by a hash describing the option. There can also be an item named "plugin", which describes the plugin as a whole. For example: - return + return plugin => { description => "description of this plugin", safe => 1, @@ -736,7 +736,7 @@ By default, dependencies are full content dependencies, meaning that the page will be updated whenever anything matching the PageSpec is modified. This can be overridden by passing a `deptype` value as the third parameter. -#### `pagespec_match($$;@)` +### `pagespec_match($$;@)` Passed a page name, and [[ikiwiki/PageSpec]], returns a true value if the [[ikiwiki/PageSpec]] matches the page. @@ -766,7 +766,7 @@ dependency type from one or more of these keywords: If multiple types are specified, they are combined. -#### `bestlink($$)` +### `bestlink($$)` Given a page and the text of a link on the page, determine which existing page that link best points to. Prefers pages under a @@ -774,7 +774,7 @@ subdirectory with the same name as the source page, failing that goes down the directory tree to the base looking for matching pages, as described in [[ikiwiki/SubPage/LinkingRules]]. -#### `htmllink($$$;@)` +### `htmllink($$$;@)` Many plugins need to generate html links and add them to a page. This is done by using the `htmllink` function. The usual way to call -- cgit v1.2.3 From f1183cbf0c9c09725192dcc8384381f9112ae222 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Feb 2010 17:25:30 -0500 Subject: add ngettext support & optimize gettext handling As I was adding ngettext support, I realized I could optimize the gettext functions by memoizing the creation of the gettext object. Note that the object creation is still deferred until a gettext function is called, to avoid unnecessary startup penalties on code paths that do not need gettext. A side benefit is that separate stub functions are no longer needed to handle the C language case. --- IkiWiki.pm | 44 ++++++++++++++++++++++++++++++-------------- doc/plugins/write.mdwn | 4 ++++ 2 files changed, 34 insertions(+), 14 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index a96ff1236..b9a419d1d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -20,7 +20,7 @@ use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype add_depends pagespec_match pagespec_match_list bestlink htmllink readfile writefile pagetype srcfile pagename - displaytime will_render gettext urlto targetpage + displaytime will_render gettext ngettext urlto targetpage add_underlay pagetitle titlepage linkpage newpagefile inject add_link %config %links %pagestate %wikistate %renderedfiles @@ -1820,27 +1820,38 @@ sub file_pruned ($;$) { sub define_gettext () { # If translation is needed, redefine the gettext function to do it. # Otherwise, it becomes a quick no-op. - no warnings 'redefine'; + my $gettext_obj; + my $getobj; if ((exists $ENV{LANG} && length $ENV{LANG}) || (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) || (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES})) { - *gettext=sub { - my $gettext_obj=eval q{ + $getobj=sub { + $gettext_obj=eval q{ use Locale::gettext q{textdomain}; Locale::gettext->domain('ikiwiki') }; - - if ($gettext_obj) { - $gettext_obj->get(shift); - } - else { - return shift; - } }; } - else { - *gettext=sub { return shift }; - } + + no warnings 'redefine'; + *gettext=sub { + $getobj->() if $getobj; + if ($gettext_obj) { + $gettext_obj->get(shift); + } + else { + return shift; + } + }; + *ngettext=sub { + $getobj->() if $getobj; + if ($gettext_obj) { + $gettext_obj->nget(@_); + } + else { + return ($_[2] == 1 ? $_[0] : $_[1]) + } + }; } sub gettext { @@ -1848,6 +1859,11 @@ sub gettext { gettext(@_); } +sub ngettext { + define_gettext(); + ngettext(@_); +} + sub yesno ($) { my $val=shift; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index a8c9de2d3..96a2aa16d 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -911,6 +911,10 @@ time. This is the standard gettext function, although slightly optimised. +### `ngettext` + +This is the standard ngettext function, although slightly optimised. + ### `urlto($$;$)` Construct a relative url to the first parameter from the page named by the -- cgit v1.2.3 From 4be426ab1ad01a2a90151d741f737d41a12a6cbe Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 1 Mar 2010 10:28:59 +0000 Subject: wl from report to field plugin pages --- doc/plugins/contrib/report.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report.mdwn b/doc/plugins/contrib/report.mdwn index 7130bcb5f..e8cbd0486 100644 --- a/doc/plugins/contrib/report.mdwn +++ b/doc/plugins/contrib/report.mdwn @@ -18,7 +18,7 @@ IkiWiki::Plugin::report - Produce templated reports from page field data. This plugin provides the **report** directive. This enables one to report on the structured data ("field" values) of multiple pages; the output is formatted -via a template. This depends on the "field" plugin. +via a template. This depends on the [[plugins/contrib/field]] plugin. The pages to report on are selected by a PageSpec given by the "pages" parameter. The template is given by the "template" parameter. -- cgit v1.2.3 From 0284ccf5eb6163d4fe49ac829a1f976336bc5908 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Mon, 1 Mar 2010 14:43:55 +0000 Subject: fixed typo --- doc/plugins/contrib/report.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report.mdwn b/doc/plugins/contrib/report.mdwn index e8cbd0486..c364d4a3a 100644 --- a/doc/plugins/contrib/report.mdwn +++ b/doc/plugins/contrib/report.mdwn @@ -89,7 +89,7 @@ The "mood_summary" template might be like this: ##
    ### - () \[[) \[[]] ### Advanced Options -- cgit v1.2.3 From fe571e959007e7e4f895869c980b474f5ee6e995 Mon Sep 17 00:00:00 2001 From: "http://liw.fi/" Date: Mon, 1 Mar 2010 21:12:48 +0000 Subject: --- doc/plugins/rename.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/rename.mdwn b/doc/plugins/rename.mdwn index ddaede8b0..abb361329 100644 --- a/doc/plugins/rename.mdwn +++ b/doc/plugins/rename.mdwn @@ -2,7 +2,8 @@ [[!tag type/web]] This plugin allows pages or other files to be renamed using the web -interface. +interface. Following Unix tradition, renaming also allows moving to a +different directory. Users can only rename things that they are allowed to edit or upload. -- cgit v1.2.3 From 837b04759c0895d6341a6a51fc05be1c3e5ef2ca Mon Sep 17 00:00:00 2001 From: Thiana Date: Mon, 1 Mar 2010 21:17:09 +0000 Subject: --- doc/plugins/creole/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/creole/discussion.mdwn b/doc/plugins/creole/discussion.mdwn index 38ee2bd78..eab41349a 100644 --- a/doc/plugins/creole/discussion.mdwn +++ b/doc/plugins/creole/discussion.mdwn @@ -12,4 +12,9 @@ I've installed Text::WikiCreole 0.05 and enabled the plugin, but I get an error >>> forgot, done now --[[Joey]] +--- +## External Links + I'm moving over a really stinkingly old UseMod and creole seems the nearest match. I've worked out that Bare /Subpage links need to become \[\[Subpage\]\], and Top/Sub links need to be \[\[Top/Sub\]\] (or \[\[Top/Sub|Top/Sub\]\], to display in exactly the same way), but I'm stuck on generic hyperlinks. The creole cheat sheet says I should be able to do \[\[http://url.path/foo|LinkText\]\], but that comes out as a link to create the "linktext" page, and Markdown-style \[Link Text\](http://url.path/foo) just gets rendered as is. Any suggestions? --[[schmonz]] + +> Was this problem ever solved? -- Thiana -- cgit v1.2.3 From 159471c92359c2da77bd0025f1718acbe7ff2a0c Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/schmonz" Date: Mon, 1 Mar 2010 21:23:00 +0000 Subject: response --- doc/plugins/creole/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/creole/discussion.mdwn b/doc/plugins/creole/discussion.mdwn index eab41349a..7f47c2c97 100644 --- a/doc/plugins/creole/discussion.mdwn +++ b/doc/plugins/creole/discussion.mdwn @@ -18,3 +18,5 @@ I've installed Text::WikiCreole 0.05 and enabled the plugin, but I get an error I'm moving over a really stinkingly old UseMod and creole seems the nearest match. I've worked out that Bare /Subpage links need to become \[\[Subpage\]\], and Top/Sub links need to be \[\[Top/Sub\]\] (or \[\[Top/Sub|Top/Sub\]\], to display in exactly the same way), but I'm stuck on generic hyperlinks. The creole cheat sheet says I should be able to do \[\[http://url.path/foo|LinkText\]\], but that comes out as a link to create the "linktext" page, and Markdown-style \[Link Text\](http://url.path/foo) just gets rendered as is. Any suggestions? --[[schmonz]] > Was this problem ever solved? -- Thiana + +>> Not by me. If I were looking at the problem now, with fresh eyes, I'd probably bite the bullet and just convert everything to Markdown. --[[schmonz]] -- cgit v1.2.3 From 9d6a755d3983d1d7cd1c67c923c8907e09108a70 Mon Sep 17 00:00:00 2001 From: Thiana Date: Tue, 9 Mar 2010 00:50:45 +0000 Subject: --- doc/plugins/conditional/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/conditional/discussion.mdwn b/doc/plugins/conditional/discussion.mdwn index 629d05940..e34df70a1 100644 --- a/doc/plugins/conditional/discussion.mdwn +++ b/doc/plugins/conditional/discussion.mdwn @@ -1,3 +1,11 @@ +## Conditional broken? + +Using \[\[!if test="tagged(plugin)" then="= Tagged as plugin =" else="*No plugins found*"]] on this wiki *should* present the 'Tagged as plugin' heading, instead it emits 'no plugins found'. Is the conditional plugin currently broken for tags or am I misusing it? Thanks. + +-- Thiana + +---- + Would there be a way for this plugin to emit fewer blank lines (i.e. *none at all*)? For example, having a look at [this page](http://www.bddebian.com/~wiki/Hurd/)'s sidebar. -- cgit v1.2.3 From 376d0dc9b76a384bc505b4ebc8c70dde4134c220 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Mar 2010 20:27:30 -0500 Subject: response --- doc/plugins/conditional/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/conditional/discussion.mdwn b/doc/plugins/conditional/discussion.mdwn index e34df70a1..09e3df923 100644 --- a/doc/plugins/conditional/discussion.mdwn +++ b/doc/plugins/conditional/discussion.mdwn @@ -4,6 +4,10 @@ Using \[\[!if test="tagged(plugin)" then="= Tagged as plugin =" else="*No plugin -- Thiana +> This wiki has no page named "plugin", so nothing links to it; tags are a species of link +> so tagging a large number of pages with a tag that doesn't exist (which change has +> been reverted) doesn't make the pagespec match. It would if the tag's page existed. --[[Joey]] + ---- Would there be a way for this plugin to emit fewer blank lines (i.e. *none at all*)? -- cgit v1.2.3 From 20635d3610619814e3c36bec913d53cb83d41640 Mon Sep 17 00:00:00 2001 From: Thiana Date: Tue, 9 Mar 2010 03:55:28 +0000 Subject: Clarification request --- doc/plugins/conditional/discussion.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/conditional/discussion.mdwn b/doc/plugins/conditional/discussion.mdwn index 09e3df923..6e84fdfc1 100644 --- a/doc/plugins/conditional/discussion.mdwn +++ b/doc/plugins/conditional/discussion.mdwn @@ -8,6 +8,19 @@ Using \[\[!if test="tagged(plugin)" then="= Tagged as plugin =" else="*No plugin > so tagging a large number of pages with a tag that doesn't exist (which change has > been reverted) doesn't make the pagespec match. It would if the tag's page existed. --[[Joey]] +>> So if I understand this correctly... Assuming the tags Tag_A and Tag_B, the existence of +>> @wiki-home@/tags/Tag_A.creole, and a number of files with a \[\[!tag Tag_A Tag_B]] the +>> following is correct? +>> +>> * \[\[!if test="tagged(Tag_A)" then="OK" else="Fail"]] => OK +>> * \[\[!if test="tagged(Tag_B)" then="OK" else="Fail"]] => Fail +>> * \[\[!if test="tagged(Tag_A) and tagged(Tag_B)" then="OK" else="Fail"]] => Fail +>> +>> Is that the expected behaviour? If so, that's not what I'm seeing here since they all result +>> in a Fail. If not, what exactly is wrong with those conditionals? Thanks. +>> +>> -- Thiana + ---- Would there be a way for this plugin to emit fewer blank lines (i.e. *none at all*)? -- cgit v1.2.3 From 03c2cf94e28ac8b90e92dbd18181d52f2338385c Mon Sep 17 00:00:00 2001 From: "http://adam.shand.net/" Date: Thu, 11 Mar 2010 05:32:00 +0000 Subject: --- doc/plugins/getsource/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/plugins/getsource/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/getsource/discussion.mdwn b/doc/plugins/getsource/discussion.mdwn new file mode 100644 index 000000000..45a1d62b5 --- /dev/null +++ b/doc/plugins/getsource/discussion.mdwn @@ -0,0 +1 @@ +It would be very cool if this plugin was enabled by default. One of the best ways to learn how to do various advanced things is to be able to "view source" on other wiki's which do things you like. -- [[AdamShand]] -- cgit v1.2.3 From ac3aac560f74457ded48ba3b5a14d0bbbf9b6d92 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Mar 2010 15:44:10 -0500 Subject: moderatedcomments: Added moderate_pagespec * moderatedcomments: Added moderate_pagespec that can be used to control which users or comment locations are moderated. This can be used, just for example, to moderate http://myopenid.com/* if you're getting a lot of spammers from one particular openid provider (who should perhaps answer your emails about them), while not moderating other users. * moderatedcomments: The moderate_users setting is deprecated. Instead, set moderate_pagespec to "!admin()" or "user(*)" instead. --- IkiWiki/Plugin/moderatedcomments.pm | 37 ++++++++++++++++++++++++++++--------- debian/changelog | 8 ++++++++ doc/plugins/moderatedcomments.mdwn | 8 +++++--- 3 files changed, 41 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm index afe1ceedf..b0a328a06 100644 --- a/IkiWiki/Plugin/moderatedcomments.pm +++ b/IkiWiki/Plugin/moderatedcomments.pm @@ -17,10 +17,11 @@ sub getsetup () { rebuild => 0, section => "auth", }, - moderate_users => { - type => 'boolean', - example => 1, - description => 'Moderate comments of logged-in users?', + moderate_pagespec => { + type => 'pagespec', + example => 'user(http://*)', + description => 'PageSpec matching users or comment locations to moderate', + link => 'ikiwiki/PageSpec', safe => 1, rebuild => 0, }, @@ -32,14 +33,32 @@ sub checkcontent (@) { # only handle comments return undef unless pagespec_match($params{page}, "postcomment(*)", location => $params{page}); + + # backwards compatability + if (exists $config{moderate_users} && + ! exists $config{moderate_pagespec}) { + $config{moderate_pagespec} = $config{moderate_users} + ? "!admin()" + : "!user(*)"; + } + + # default is to moderate all except admins + if (! exists $config{moderate_pagespec}) { + $config{moderate_pagespec}="!admin()"; + } - # admins and maybe users can comment w/o moderation my $session=$params{session}; my $user=$session->param("name") if $session; - return undef if defined $user && (IkiWiki::is_admin($user) || - (exists $config{moderate_users} && ! $config{moderate_users})); - - return gettext("comment needs moderation"); + if (pagespec_match($params{page}, $config{moderate_pagespec}, + location => $params{page}, + (defined $user ? (user => $user) : ()), + (defined $ENV{REMOTE_ADDR} ? (ip => $ENV{REMOTE_ADDR}) : ()), + )) { + return gettext("comment needs moderation"); + } + else { + return undef; + } } 1 diff --git a/debian/changelog b/debian/changelog index d1253c079..c58e612db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,14 @@ ikiwiki (3.20100303) UNRELEASED; urgency=low * Fix utf8 issues in calls to md5_hex. + * moderatedcomments: Added moderate_pagespec that can be used + to control which users or comment locations are moderated. + This can be used, just for example, to moderate http://myopenid.com/* + if you're getting a lot of spammers from one particular openid + provider (who should perhaps answer your emails about them), + while not moderating other users. + * moderatedcomments: The moderate_users setting is deprecated. Instead, + set moderate_pagespec to "!admin()" or "user(*)" instead. -- Joey Hess Tue, 09 Mar 2010 19:46:35 -0500 diff --git a/doc/plugins/moderatedcomments.mdwn b/doc/plugins/moderatedcomments.mdwn index 97924d742..c29b0b052 100644 --- a/doc/plugins/moderatedcomments.mdwn +++ b/doc/plugins/moderatedcomments.mdwn @@ -5,6 +5,8 @@ This plugin causes [[comments]] to be held for manual moderation. Admins can access the comment moderation queue via their preferences page. By default, all comments made by anyone who is not an admin will be held -for moderation. The `moderate_users` setting can be set to false to avoid -moderating comments of logged-in users, while still moderating anonymous -comments. +for moderation. The `moderate_pagespec` setting can be used to specify a +[[ikiwiki/PageSpec]] to match comments and users who should be moderated. +For example, to avoid moderating comments from logged-in users, set +`moderate_pagespec` to "!user(*)". Or to moderate everyone except for +admins, set it to "!admin(*)". -- cgit v1.2.3 From e56ec7a96c3a2064941a82619bf6cb0d2e8392e0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 13 Mar 2010 15:08:00 -0500 Subject: websetup: Add websetup_unsafe to allow marking other settings as unsafe. --- IkiWiki/Plugin/websetup.pm | 22 ++++++++++++++++++---- debian/changelog | 7 +++++++ doc/plugins/websetup.mdwn | 3 ++- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 5c19c9b63..d444c0a3d 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -27,6 +27,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + websetup_unsafe => { + type => "string", + example => [], + description => "list of additional setup field keys to treat as unsafe", + safe => 0, + rebuild => 0, + }, websetup_show_unsafe => { type => "boolean", example => 1, @@ -57,6 +64,12 @@ sub formatexample ($$) { } } +sub issafe ($) { + my $key=shift; + + return ! grep { $_ eq $key } @{$config{websetup_unsafe}}; +} + sub showfields ($$$@) { my $form=shift; my $plugin=shift; @@ -78,7 +91,8 @@ sub showfields ($$$@) { # XXX hashes not handled yet next if ref $config{$key} && ref $config{$key} eq 'HASH' || ref $info{example} eq 'HASH'; # maybe skip unsafe settings - next if ! $info{safe} && ! ($config{websetup_show_unsafe} && $config{websetup_advanced}); + next if ! ($config{websetup_show_unsafe} && $config{websetup_advanced}) && + (! $info{safe} || ! issafe($key)); # maybe skip advanced settings next if $info{advanced} && ! $config{websetup_advanced}; # these are handled specially, so don't show @@ -156,7 +170,7 @@ sub showfields ($$$@) { if (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY') { $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) } @{$value} : "")]; - push @$value, "", "" if $info{safe}; # blank items for expansion + push @$value, "", "" if $info{safe} && issafe($key); # blank items for expansion } else { $value=Encode::encode_utf8($value); @@ -210,7 +224,7 @@ sub showfields ($$$@) { } } - if (! $info{safe}) { + if (! $info{safe} || ! issafe($key)) { $form->field(name => $name, disabled => 1); } else { @@ -346,7 +360,7 @@ sub showform ($$) { @value=0; } - if (! $info{safe}) { + if (! $info{safe} || ! issafe($key)) { error("unsafe field $key"); # should never happen } diff --git a/debian/changelog b/debian/changelog index 7fdbbcb63..9e779bb18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100313) UNRELEASED; urgency=low + + * websetup: Add websetup_unsafe to allow marking other settings + as unsafe. + + -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 + ikiwiki (3.20100312) unstable; urgency=HIGH * Fix utf8 issues in calls to md5_hex. diff --git a/doc/plugins/websetup.mdwn b/doc/plugins/websetup.mdwn index f1756ba8f..b4d23ba9c 100644 --- a/doc/plugins/websetup.mdwn +++ b/doc/plugins/websetup.mdwn @@ -16,7 +16,8 @@ enabled and disabled using it too. Some settings are not considered safe enough to be manipulated over the web; these are still shown, by default, but cannot be modified. To hide them, set `websetup_show_unsafe` to false in the setup file. A few settings have too complex a data type to be -configured via the web. +configured via the web. To mark additional settings as unsafe, you can +list them in `websetup_unsafe`. Plugins that should not be enabled/disabled via the web interface can be listed in `websetup_force_plugins` in the setup file. -- cgit v1.2.3 From 0f433ed01c58978ba6d7845d5aaebb1ec8cefc9e Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 17 Mar 2010 00:42:38 +0000 Subject: link to highlight --- doc/plugins/contrib/highlightcode.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/highlightcode.mdwn b/doc/plugins/contrib/highlightcode.mdwn index 8abb76583..f1df204bb 100644 --- a/doc/plugins/contrib/highlightcode.mdwn +++ b/doc/plugins/contrib/highlightcode.mdwn @@ -1,6 +1,8 @@ [[!template id=plugin name=highlightcode author="[[sabr]]"]] [[!tag type/format]] +(An alternative to this plugin, [[plugins/highlight]], is now provided with IkiWiki. --[[smcv]]) + A small plugin to allow Ikiwiki to display source files complete with syntax highlighting. Files with recognized extensions (i.e. my-file.cpp) are be rendered just like any other Ikiwiki page. You can even edit your source files with Ikiwiki's editor. It uses the Syntax::Highlight::Engine::Kate Perl module to do the highlighting. -- cgit v1.2.3 From e67a9382f67e745af3be7d367fe7a0d36c1777e6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 24 Mar 2010 00:29:10 +0000 Subject: Allow hooks to add sorting functions to pagespec_match_list --- IkiWiki.pm | 6 +++++- doc/ikiwiki/pagespec/sorting.mdwn | 2 ++ doc/plugins/write.mdwn | 15 +++++++++++++++ t/pagespec_match_list.t | 6 +++++- 4 files changed, 27 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 022bfe3bd..1a4dc47dd 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2035,7 +2035,11 @@ sub pagespec_match_list ($$;@) { if (defined $params{sort}) { my $f; - if ($params{sort} eq 'title') { + + if (exists $hooks{sort}{$params{sort}}{call}) { + $f = sub { $hooks{sort}{$params{sort}}{call}($a, $b) }; + } + elsif ($params{sort} eq 'title') { $f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) }; } elsif ($params{sort} eq 'title_natural') { diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index 697818a2a..9007c23bf 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -10,4 +10,6 @@ orders can be specified. installed. Orders by title, but numbers in the title are treated as such, ("1 2 9 10 20" instead of "1 10 2 20 9") +Plugins can add additional sort orders. + [[!meta robots="noindex, follow"]] diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 96a2aa16d..bfa6617bd 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -588,6 +588,21 @@ describes the plugin as a whole. For example: This hook is used to inject C code (which it returns) into the `main` function of the ikiwiki wrapper when it is being generated. +### sort + + hook(type => "sort", id => "foo", call => \&sort_by_foo); + +This hook adds an additional [[ikiwiki/pagespec/sorting]] order or overrides +an existing one. The callback is given two page names as arguments, and +returns negative, zero or positive if the first page should come before, +close to (i.e. undefined order), or after the second page. + +For instance, the built-in `title` sort order could be reimplemented as + + sub sort_by_title { + pagetitle(basename($_[0])) cmp pagetitle(basename($_[1])); + } + ## Exported variables Several variables are exported to your plugin when you `use IkiWiki;` diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index dd5dcc5b0..b34ee769f 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 88; +use Test::More tests => 89; BEGIN { use_ok("IkiWiki"); } @@ -9,6 +9,8 @@ BEGIN { use_ok("IkiWiki"); } $config{srcdir}=$config{destdir}="/dev/null"; IkiWiki::checkconfig(); +hook(type => "sort", id => "path", call => sub { $_[0] cmp $_[1] }); + %pagesources=( foo => "foo.mdwn", foo2 => "foo2.mdwn", @@ -34,6 +36,8 @@ is_deeply([pagespec_match_list("foo", "post/*", sort => "title", num => 50)], is_deeply([pagespec_match_list("foo", "post/*", sort => "title", filter => sub { $_[0] =~ /3/}) ], ["post/1", "post/2"]); +is_deeply([pagespec_match_list("foo", "*", sort => "path", num => 2)], + ["bar", "foo"]); my $r=eval { pagespec_match_list("foo", "beep") }; ok(eval { pagespec_match_list("foo", "beep") } == 0); ok(! $@, "does not fail with error when unable to match anything"); -- cgit v1.2.3 From 3b08b19b4e36f82864c73ca035cfdec83b3a43aa Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 24 Mar 2010 21:33:03 +0000 Subject: use `` to avoid markdown eating example pagespecs --- doc/plugins/moderatedcomments.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/moderatedcomments.mdwn b/doc/plugins/moderatedcomments.mdwn index c29b0b052..f9466e833 100644 --- a/doc/plugins/moderatedcomments.mdwn +++ b/doc/plugins/moderatedcomments.mdwn @@ -8,5 +8,5 @@ By default, all comments made by anyone who is not an admin will be held for moderation. The `moderate_pagespec` setting can be used to specify a [[ikiwiki/PageSpec]] to match comments and users who should be moderated. For example, to avoid moderating comments from logged-in users, set -`moderate_pagespec` to "!user(*)". Or to moderate everyone except for -admins, set it to "!admin(*)". +`moderate_pagespec` to "`!user(*)`". Or to moderate everyone except for +admins, set it to "`!admin(*)`". -- cgit v1.2.3 From 60edd2dc3157f756f4f7a213ee15836fe7bbb769 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 24 Mar 2010 23:51:48 +0000 Subject: Allow sorting to be combined and/or reversed --- IkiWiki.pm | 84 ++++++++++++++++++++++++++++----------- doc/ikiwiki/pagespec/sorting.mdwn | 4 ++ doc/plugins/write.mdwn | 17 +++++++- t/pagespec_match_list.t | 12 +++++- 4 files changed, 91 insertions(+), 26 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 1a4dc47dd..ce8fdd454 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2005,6 +2005,64 @@ sub pagespec_match ($$;@) { return $sub->($page, @params); } +sub get_sort_function { + my $method = $_[0]; + + if ($method =~ m/\s/) { + my @methods = map { get_sort_function($_) } split(' ', $method); + + return sub { + foreach my $method (@methods) { + my $answer = $method->($_[0], $_[1]); + return $answer if $answer; + } + + return 0; + }; + } + + my $sense = 1; + + if ($method =~ s/^-//) { + $sense = -1; + } + + my $token = $method; + my $parameter = undef; + + if ($method =~ m/^(\w+)\((.*)\)$/) { + $token = $1; + $parameter = $2; + } + + if (exists $hooks{sort}{$token}{call}) { + my $callback = $hooks{sort}{$token}{call}; + return sub { $sense * $callback->($_[0], $_[1], $parameter) }; + } + + if ($method eq 'title') { + return sub { $sense * (pagetitle(basename($_[0])) cmp pagetitle(basename($_[1]))) }; + } + + if ($method eq 'title_natural') { + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } + return sub { $sense * Sort::Naturally::ncmp(pagetitle(basename($_[0])), pagetitle(basename($_[1]))) }; + } + + if ($method eq 'mtime') { + return sub { $sense * ($pagemtime{$_[1]} <=> $pagemtime{$_[0]}) }; + } + + if ($method eq 'age') { + return sub { $sense * ($pagectime{$_[1]} <=> $pagectime{$_[0]}) }; + } + + error sprintf(gettext("unknown sort type %s"), $method); +} + sub pagespec_match_list ($$;@) { my $page=shift; my $pagespec=shift; @@ -2034,31 +2092,9 @@ sub pagespec_match_list ($$;@) { } if (defined $params{sort}) { - my $f; + my $f = get_sort_function($params{sort}); - if (exists $hooks{sort}{$params{sort}}{call}) { - $f = sub { $hooks{sort}{$params{sort}}{call}($a, $b) }; - } - elsif ($params{sort} eq 'title') { - $f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) }; - } - elsif ($params{sort} eq 'title_natural') { - eval q{use Sort::Naturally}; - if ($@) { - error(gettext("Sort::Naturally needed for title_natural sort")); - } - $f=sub { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) }; - } - elsif ($params{sort} eq 'mtime') { - $f=sub { $pagemtime{$b} <=> $pagemtime{$a} }; - } - elsif ($params{sort} eq 'age') { - $f=sub { $pagectime{$b} <=> $pagectime{$a} }; - } - else { - error sprintf(gettext("unknown sort type %s"), $params{sort}); - } - @candidates = sort { &$f } @candidates; + @candidates = sort { $f->($a, $b) } @candidates; } @candidates=reverse(@candidates) if $params{reverse}; diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index 61516bec5..f27972d4e 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -15,6 +15,10 @@ orders can be specified. full title was set. """]] +In addition, you can combine several sort orders and/or reverse the order of +sorting, with a string like `age -title` (which would sort by age, then by +title in reverse order if two pages have the same age). + Plugins can add additional sort orders, so more might be available on this wiki. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index bfa6617bd..1010e76e4 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -593,7 +593,9 @@ function of the ikiwiki wrapper when it is being generated. hook(type => "sort", id => "foo", call => \&sort_by_foo); This hook adds an additional [[ikiwiki/pagespec/sorting]] order or overrides -an existing one. The callback is given two page names as arguments, and +an existing one. + +The callback is given two page names followed by the parameter as arguments, and returns negative, zero or positive if the first page should come before, close to (i.e. undefined order), or after the second page. @@ -603,6 +605,19 @@ For instance, the built-in `title` sort order could be reimplemented as pagetitle(basename($_[0])) cmp pagetitle(basename($_[1])); } +and to sort by an arbitrary `meta` value, you could use: + + # usage: sort="meta(description)" + sub sort_by_meta { + my $param = $_[2]; + error "sort=meta requires a parameter" unless defined $param; + my $left = $pagestate{$_[0]}{meta}{$param}; + $left = "" unless defined $left; + my $right = $pagestate{$_[1]}{meta}{$param}; + $right = "" unless defined $right; + return $left cmp $right; + } + ## Exported variables Several variables are exported to your plugin when you `use IkiWiki;` diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index b34ee769f..309961f1c 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 89; +use Test::More tests => 90; BEGIN { use_ok("IkiWiki"); } @@ -20,6 +20,13 @@ hook(type => "sort", id => "path", call => sub { $_[0] cmp $_[1] }); "post/2" => "post/2.mdwn", "post/3" => "post/3.mdwn", ); +$IkiWiki::pagectime{foo} = 2; +$IkiWiki::pagectime{foo2} = 2; +$IkiWiki::pagectime{foo3} = 1; +$IkiWiki::pagectime{bar} = 3; +$IkiWiki::pagectime{"post/1"} = 6; +$IkiWiki::pagectime{"post/2"} = 6; +$IkiWiki::pagectime{"post/3"} = 6; $links{foo}=[qw{post/1 post/2}]; $links{foo2}=[qw{bar}]; $links{foo3}=[qw{bar}]; @@ -38,6 +45,9 @@ is_deeply([pagespec_match_list("foo", "post/*", sort => "title", ["post/1", "post/2"]); is_deeply([pagespec_match_list("foo", "*", sort => "path", num => 2)], ["bar", "foo"]); +is_deeply([pagespec_match_list("foo", "foo* or bar*", + sort => "-age title")], # oldest first, break ties by title + ["foo3", "foo", "foo2", "bar"]); my $r=eval { pagespec_match_list("foo", "beep") }; ok(eval { pagespec_match_list("foo", "beep") } == 0); ok(! $@, "does not fail with error when unable to match anything"); -- cgit v1.2.3 From b86276ffed7ee001b35cd610e5d56e5afb4088cf Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 25 Mar 2010 23:31:53 +0000 Subject: Reimplement extensible sorting mechanisms, in the same way as pagespecs --- IkiWiki.pm | 145 ++++++++++++++++++++++++++++-------------------- IkiWiki/Plugin/meta.pm | 11 ++-- doc/plugins/write.mdwn | 53 ++++++++---------- t/pagespec_match_list.t | 6 +- 4 files changed, 120 insertions(+), 95 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index ce8fdd454..a89c14058 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -37,6 +37,7 @@ our $DEPEND_LINKS=4; # Optimisation. use Memoize; memoize("abs2rel"); +memoize("cmpspec_translate"); memoize("pagespec_translate"); memoize("template_file"); @@ -1934,6 +1935,70 @@ sub add_link ($$) { unless grep { $_ eq $link } @{$links{$page}}; } +sub cmpspec_translate ($) { + my $spec = shift; + + my $code = ""; + my @data; + while ($spec =~ m{ + \s* + (-?) # group 1: perhaps negated + \s* + ( # group 2: a word + \w+\([^\)]*\) # command(params) + | + [^\s]+ # or anything else + ) + \s* + }gx) { + my $negated = $1; + my $word = $2; + my $params = undef; + + if ($word =~ m/^(\w+)\((.*)\)$/) { + # command with parameters + $params = $2; + $word = $1; + } + elsif ($word !~ m/^\w+$/) { + error(sprintf(gettext("invalid sort type %s"), $word)); + } + + if (length $code) { + $code .= " || "; + } + + if ($negated) { + $code .= "-"; + } + + if (exists $IkiWiki::PageSpec::{"cmp_$word"}) { + if (exists $IkiWiki::PageSpec::{"check_cmp_$word"}) { + $IkiWiki::PageSpec::{"check_cmp_$word"}->($params); + } + + if (defined $params) { + push @data, $params; + $code .= "IkiWiki::PageSpec::cmp_$word(\@_, \$data[$#data])"; + } + else { + $code .= "IkiWiki::PageSpec::cmp_$word(\@_, undef)"; + } + } + else { + error(sprintf(gettext("unknown sort type %s"), $word)); + } + } + + if (! length $code) { + # undefined sorting method... sort arbitrarily + return sub { 0 }; + } + + no warnings; + return eval 'sub { '.$code.' }'; +} + sub pagespec_translate ($) { my $spec=shift; @@ -2005,64 +2070,6 @@ sub pagespec_match ($$;@) { return $sub->($page, @params); } -sub get_sort_function { - my $method = $_[0]; - - if ($method =~ m/\s/) { - my @methods = map { get_sort_function($_) } split(' ', $method); - - return sub { - foreach my $method (@methods) { - my $answer = $method->($_[0], $_[1]); - return $answer if $answer; - } - - return 0; - }; - } - - my $sense = 1; - - if ($method =~ s/^-//) { - $sense = -1; - } - - my $token = $method; - my $parameter = undef; - - if ($method =~ m/^(\w+)\((.*)\)$/) { - $token = $1; - $parameter = $2; - } - - if (exists $hooks{sort}{$token}{call}) { - my $callback = $hooks{sort}{$token}{call}; - return sub { $sense * $callback->($_[0], $_[1], $parameter) }; - } - - if ($method eq 'title') { - return sub { $sense * (pagetitle(basename($_[0])) cmp pagetitle(basename($_[1]))) }; - } - - if ($method eq 'title_natural') { - eval q{use Sort::Naturally}; - if ($@) { - error(gettext("Sort::Naturally needed for title_natural sort")); - } - return sub { $sense * Sort::Naturally::ncmp(pagetitle(basename($_[0])), pagetitle(basename($_[1]))) }; - } - - if ($method eq 'mtime') { - return sub { $sense * ($pagemtime{$_[1]} <=> $pagemtime{$_[0]}) }; - } - - if ($method eq 'age') { - return sub { $sense * ($pagectime{$_[1]} <=> $pagectime{$_[0]}) }; - } - - error sprintf(gettext("unknown sort type %s"), $method); -} - sub pagespec_match_list ($$;@) { my $page=shift; my $pagespec=shift; @@ -2092,7 +2099,7 @@ sub pagespec_match_list ($$;@) { } if (defined $params{sort}) { - my $f = get_sort_function($params{sort}); + my $f = cmpspec_translate($params{sort}); @candidates = sort { $f->($a, $b) } @candidates; } @@ -2407,4 +2414,24 @@ sub match_ip ($$;@) { } } +sub cmp_title { + IkiWiki::pagetitle(IkiWiki::basename($_[0])) + cmp + IkiWiki::pagetitle(IkiWiki::basename($_[1])) +} + +sub cmp_mtime { $IkiWiki::pagemtime{$_[1]} <=> $IkiWiki::pagemtime{$_[0]} } +sub cmp_age { $IkiWiki::pagectime{$_[1]} <=> $IkiWiki::pagectime{$_[0]} } + +sub check_cmp_title_natural { + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } +} +sub cmp_title_natural { + Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])), + IkiWiki::pagetitle(IkiWiki::basename($_[1]))) +} + 1 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index a470041c9..e8cc1e392 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -13,7 +13,6 @@ sub import { hook(type => "needsbuild", id => "meta", call => \&needsbuild); hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1); hook(type => "pagetemplate", id => "meta", call => \&pagetemplate); - hook(type => "sort", id => "meta_title", call => \&sort_meta_title); } sub getsetup () { @@ -299,10 +298,6 @@ sub titlesort { return pagetitle(IkiWiki::basename($_[0])); } -sub sort_meta_title { - return titlesort($_[0]) cmp titlesort($_[1]); -} - sub match { my $field=shift; my $page=shift; @@ -353,4 +348,10 @@ sub match_copyright ($$;@) { IkiWiki::Plugin::meta::match("copyright", @_); } +sub cmp_meta_title { + IkiWiki::Plugin::meta::titlesort($_[0]) + cmp + IkiWiki::Plugin::meta::titlesort($_[1]) +} + 1 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 1010e76e4..de2b47015 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -588,36 +588,6 @@ describes the plugin as a whole. For example: This hook is used to inject C code (which it returns) into the `main` function of the ikiwiki wrapper when it is being generated. -### sort - - hook(type => "sort", id => "foo", call => \&sort_by_foo); - -This hook adds an additional [[ikiwiki/pagespec/sorting]] order or overrides -an existing one. - -The callback is given two page names followed by the parameter as arguments, and -returns negative, zero or positive if the first page should come before, -close to (i.e. undefined order), or after the second page. - -For instance, the built-in `title` sort order could be reimplemented as - - sub sort_by_title { - pagetitle(basename($_[0])) cmp pagetitle(basename($_[1])); - } - -and to sort by an arbitrary `meta` value, you could use: - - # usage: sort="meta(description)" - sub sort_by_meta { - my $param = $_[2]; - error "sort=meta requires a parameter" unless defined $param; - my $left = $pagestate{$_[0]}{meta}{$param}; - $left = "" unless defined $left; - my $right = $pagestate{$_[1]}{meta}{$param}; - $right = "" unless defined $right; - return $left cmp $right; - } - ## Exported variables Several variables are exported to your plugin when you `use IkiWiki;` @@ -1140,6 +1110,29 @@ For example, "backlink(foo)" is influenced by the contents of page foo; they match; "created_before(foo)" is influenced by the metadata of foo; while "glob(*)" is not influenced by the contents of any page. +### Sorting plugins + +Similarly, it's possible to write plugins that add new functions as +[[ikiwiki/pagespec/sorting]] methods. To achieve this, add a function to +the IkiWiki::PageSpec package named `cmp_foo`, which will be used when sorting +by `foo` or `foo(...)` is requested. + +The function will be passed three or more parameters. The first two are +page names, and the third is `undef` if invoked as `foo`, or the parameter +`"bar"` if invoked as `foo(bar)`. It may also be passed additional, named +parameters. + +It should return the same thing as Perl's `cmp` and `<=>` operators: negative +if the first argument is less than the second, positive if the first argument +is greater, or zero if they are considered equal. It may also raise an +error using `error`, for instance if it needs a parameter but one isn't +provided. + +You can also define a function called `check_cmp_foo` in the same package. +If you do, it will be called while preparing to sort by `foo` or `foo(bar)`, +with argument `undef` or `"bar"` respectively; it may raise an error using +`error`, if sorting like that isn't going to work. + ### Setup plugins The ikiwiki setup file is loaded using a pluggable mechanism. If you look diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index 309961f1c..743ae4637 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -9,7 +9,11 @@ BEGIN { use_ok("IkiWiki"); } $config{srcdir}=$config{destdir}="/dev/null"; IkiWiki::checkconfig(); -hook(type => "sort", id => "path", call => sub { $_[0] cmp $_[1] }); +{ + package IkiWiki::PageSpec; + + sub cmp_path { $_[0] cmp $_[1] } +} %pagesources=( foo => "foo.mdwn", -- cgit v1.2.3 From 0f28f310472a333134af63a18b73372f044b8278 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Mar 2010 00:12:22 -0400 Subject: security? --- doc/plugins/contrib/pod/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/plugins/contrib/pod/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod/discussion.mdwn b/doc/plugins/contrib/pod/discussion.mdwn new file mode 100644 index 000000000..8f4b625ee --- /dev/null +++ b/doc/plugins/contrib/pod/discussion.mdwn @@ -0,0 +1,8 @@ +My one concern about this plugin is the `=for` markup in POD. + +> Some format names that formatters currently are known to +> accept include "roff", "man", "latex", "tex", "text", and "html". + +I don't know which of these [[!cpan Pod::Xml]] supports. If it currently +supports, or later support latex, that could be problimatic since that +could maybe be used to include files or run code. --[[Joey]] -- cgit v1.2.3 From 3cea3eb5da0a8f09a495deea9f2a2c73dc76deab Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 26 Mar 2010 04:30:43 +0000 Subject: response --- doc/plugins/contrib/pod/discussion.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod/discussion.mdwn b/doc/plugins/contrib/pod/discussion.mdwn index 8f4b625ee..76e858680 100644 --- a/doc/plugins/contrib/pod/discussion.mdwn +++ b/doc/plugins/contrib/pod/discussion.mdwn @@ -3,6 +3,8 @@ My one concern about this plugin is the `=for` markup in POD. > Some format names that formatters currently are known to > accept include "roff", "man", "latex", "tex", "text", and "html". -I don't know which of these [[!cpan Pod::Xml]] supports. If it currently +I don't know which of these [[!cpan Pod::Xhtml]] supports. If it currently supports, or later support latex, that could be problimatic since that could maybe be used to include files or run code. --[[Joey]] + +> I don't know, either; the documentation for [[!cpan Pod:Xhtml]] is silent on this subject. --[[KathrynAndersen]] -- cgit v1.2.3 From d88af43011193bb0eef79b749ae9a93eda5d266e Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 26 Mar 2010 13:20:33 +0000 Subject: brief review of field; fieldsort plugin --- doc/plugins/contrib/field/discussion.mdwn | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 doc/plugins/contrib/field/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn new file mode 100644 index 000000000..fc1759fab --- /dev/null +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -0,0 +1,62 @@ +Having tried out `field`, some comments (from [[smcv]]): + +The general concept looks great. + +The `pagetemplate` hook seems quite namespace-polluting: on a site containing +a list of books, I'd like to have an `author` field, but that would collide +with IkiWiki's use of `` for the author of the *page* +(i.e. me). Perhaps it'd be better if the pagetemplate hook was only active for +`` or something? (For those who want the current +behaviour, an auxiliary plugin would be easy.) + +From a coding style point of view, the `$CamelCase` variable names aren't +IkiWiki style, and the `match_foo` functions look as though they could benefit +from being thin wrappers around a common `&IkiWiki::Plugin::field::match` +function (see `meta` for a similar approach). + +I think the documentation would probably be clearer in a less manpage-like +and more ikiwiki-like style? + +If one of my branches from [[todo/allow_plugins_to_add_sorting_methods]] is +accepted, a `field()` cmp type would mean that [[plugins/contrib/report]] can +stop reimplementing sorting. Here's the implementation I'm using, with +your "sortspec" concept (a sort-hook would be very similar): if merged, +I think it should just be part of `field` rather than a separate plugin. + + # Copyright © 2010 Simon McVittie, released under GNU LGPL >= 2.1 + package IkiWiki::Plugin::fieldsort; + use warnings; + use strict; + use IkiWiki 3.00; + use IkiWiki::Plugin::field; + + sub import { + hook(type => "getsetup", id => "fieldsort", call => \&getsetup); + } + + sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, + } + + package IkiWiki::PageSpec; + + sub check_cmp_field { + if (!length $_[0]) { + error("sort=field requires a parameter"); + } + } + + sub cmp_field { + my $left = IkiWiki::Plugin::field::field_get_value($_[2], $_[0]); + my $right = IkiWiki::Plugin::field::field_get_value($_[2], $_[1]); + + $left = "" unless defined $left; + $right = "" unless defined $right; + return $left cmp $right; + } + + 1; -- cgit v1.2.3 From bea828a2f6b455c46f2b5d6c16805958a2e3412a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 26 Mar 2010 13:30:52 +0000 Subject: doesn't field+template already cover this? --- doc/plugins/contrib/ftemplate/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc/plugins/contrib/ftemplate/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn new file mode 100644 index 000000000..851ccf960 --- /dev/null +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -0,0 +1,6 @@ +Is this actually necessary? Doesn't the combination of [[plugins/template]] +with [[plugins/contrib/field]]'s `pagetemplate` hook provide the same +functionality? I suppose one missing thing is that `ftemplate` looks in +the "system" templates directories, not just in the wiki, but that +seems orthogonal (and might even be a good enhancement to `template`). +--[[smcv]] -- cgit v1.2.3 From fffd7e7e026f61e03b2fa052acdf7130889f6343 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 26 Mar 2010 13:43:37 +0000 Subject: oh, my mistake... this *is* necessary, but could perhaps be done better? --- doc/plugins/contrib/ftemplate/discussion.mdwn | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index 851ccf960..eb2ec6f13 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -1,6 +1,13 @@ -Is this actually necessary? Doesn't the combination of [[plugins/template]] -with [[plugins/contrib/field]]'s `pagetemplate` hook provide the same -functionality? I suppose one missing thing is that `ftemplate` looks in +I initially thought this wasn't actually necessary - the combination +of [[plugins/template]] with [[plugins/contrib/field]]'s `pagetemplate` +hook ought to provide the same functionality. However, `template` +doesn't run `pagetemplate` hooks; a more general version of this +plugin would be to have a variant of `template` that runs `pagetemplate` +hooks (probably easiest to just patch `template` to implement a +second directive, or have a special parameter `run_hooks="yes"`, +or something). + +Another missing thing is that `ftemplate` looks in the "system" templates directories, not just in the wiki, but that -seems orthogonal (and might even be a good enhancement to `template`). +seems orthogonal (and might be a good enhancement to `template` anyway). --[[smcv]] -- cgit v1.2.3 From b9958fe3cf1a27b58d3e2bd59c76553eb0046782 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 26 Mar 2010 14:09:04 +0000 Subject: brief review of report --- doc/plugins/contrib/report/discussion.mdwn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/plugins/contrib/report/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn new file mode 100644 index 000000000..6b1e28f6a --- /dev/null +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -0,0 +1,23 @@ +Wow, this plugin does a lot... it seems to be `inline` (but without the feeds +or the ability to not have `archive="yes"`), plus part of +[[plugins/contrib/trail]], plus some sorting, plus an ingenious workaround +for template evaluation being relatively stateless. + +A large part of this plugin would just fall off if one of the versions of +[[todo/allow_add_plugins_to_add_sorting_methods]] was merged, which was a +large part of the idea of that feature request :-) To make use of that +you'd have to use `pagespec_match_list` in the trail case too, but that's +easy enough - just add `list => [@the_trail_pages]` to the arguments. + +Another large part would fall off if this plugin required, and internally +invoked, `inline` (like my `comments` plugin does) - `inline` runs +`pagetemplate` hooks, and in particular, it'll run the `field` hook. +Alternatively, this plugin could invoke `pagetemplate` hooks itself, +removing the special case for `field`. + +Perhaps the `headers` thing could migrate into inline somehow? That might +lead to making inline too big, though. + +Is the intention that the `trail` part is a performance hack, or a way +to select pages? How does it relate to [[todo/wikitrails]] or +[[plugins/contrib/trail]]? --[[smcv]] -- cgit v1.2.3 From 3c98cf653f6d6950a425620acf0279df902d004b Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Fri, 26 Mar 2010 15:09:11 +0000 Subject: fix link --- doc/plugins/contrib/report/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index 6b1e28f6a..918d0779b 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -4,7 +4,7 @@ or the ability to not have `archive="yes"`), plus part of for template evaluation being relatively stateless. A large part of this plugin would just fall off if one of the versions of -[[todo/allow_add_plugins_to_add_sorting_methods]] was merged, which was a +"[[todo/allow_plugins_to_add_sorting_methods]]" was merged, which was a large part of the idea of that feature request :-) To make use of that you'd have to use `pagespec_match_list` in the trail case too, but that's easy enough - just add `list => [@the_trail_pages]` to the arguments. -- cgit v1.2.3 From ba05b907e3563f9aa25a4322abd9ab2d5b56b36b Mon Sep 17 00:00:00 2001 From: "http://oneingray.myopenid.com/" Date: Sun, 28 Mar 2010 15:58:37 +0000 Subject: More wishlist items for the `xslt` plugin. --- doc/plugins/contrib/xslt/discussion.mdwn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/xslt/discussion.mdwn b/doc/plugins/contrib/xslt/discussion.mdwn index 9cda02f88..72cce083c 100644 --- a/doc/plugins/contrib/xslt/discussion.mdwn +++ b/doc/plugins/contrib/xslt/discussion.mdwn @@ -20,3 +20,30 @@ possible. Can it also read other arbitrary files, run other programs, etc? > For the second point, I think the main concern would be resource usage. XSLT is a pretty limited language; it can read other XML files, but it can't run other programs so far as I know. > -- [[KathrynAndersen]] + +>> XSLT is, indeed, a Turing-complete programming language. + However, [XML::LibXSLT][] provides a set of functions to help + to minimize the damage that may be caused by running a random + program. + +>> In particular, `max_depth ()` allows for the maximum + recursion depth to be set, while + `read_file ()`, `write_file ()`, `create_dir ()`, + `read_net ()` and `write_net ()` + are the callbacks that allow any of the possible file + operations to be denied. + +>> To be honest, I'd prefer for the `read_file ()` callback to + only grant access to the files below the Ikiwiki source + directory, and for all the `write_`… and + …`_net` callbacks to deny the access unconditionally. + +>> One more wishlist item: allow the set of locations to take + `.xsl` files from to be preconfigured, so that, e. g., + one could allow (preasumably trusted) system stylesheets, + while disallowing any stylesheets that are placed on the Wiki + itself. + +>> — Ivan Shmakov, 2010-03-28Z. + +[XML::LibXSLT]: http://search.cpan.org/~PAJAS/XML-LibXSLT/LibXSLT.pm -- cgit v1.2.3 From 386e464188d817f90e1cb6535da2db6bcfaa3fa0 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 30 Mar 2010 05:31:10 +0000 Subject: quick response --- doc/plugins/contrib/field/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index fc1759fab..4bb285a50 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -9,6 +9,10 @@ with IkiWiki's use of `` for the author of the *page* `` or something? (For those who want the current behaviour, an auxiliary plugin would be easy.) +> No, please. The idea is to be *able* to override field names if one wishes to, and choose, for yourself, non-colliding field names if one wishes not to. I don't wish to lose the power of being able to, say, define a page title with YAML format if I want to, or to write a site-specific plugin which calculates a page title, or other nifty things. +>It's not like one is going to lose the fields defined by the meta plugin; if "author" is defined by \[[!meta author=...]] then that's what will be found by "field" (provided the "meta" plugin is registered; that's what the "field_register" option is for). +>--[[KathrynAndersen]] + From a coding style point of view, the `$CamelCase` variable names aren't IkiWiki style, and the `match_foo` functions look as though they could benefit from being thin wrappers around a common `&IkiWiki::Plugin::field::match` @@ -17,6 +21,8 @@ function (see `meta` for a similar approach). I think the documentation would probably be clearer in a less manpage-like and more ikiwiki-like style? +> I don't think ikiwiki *has* a "style" for docs, does it? So I followed the Perl Module style. And I'm rather baffled as to why having the docs laid out in clear sections... make them less clear. --[[KathrynAndersen]] + If one of my branches from [[todo/allow_plugins_to_add_sorting_methods]] is accepted, a `field()` cmp type would mean that [[plugins/contrib/report]] can stop reimplementing sorting. Here's the implementation I'm using, with -- cgit v1.2.3 From 2d1e4cce45024f6b2c384eaf7b5276c448cb3a05 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 30 Mar 2010 05:38:31 +0000 Subject: response --- doc/plugins/contrib/ftemplate/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index eb2ec6f13..adb66ee6a 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -7,7 +7,11 @@ hooks (probably easiest to just patch `template` to implement a second directive, or have a special parameter `run_hooks="yes"`, or something). +> I got the impression that `pagetemplate` hooks are intended to be completely independent of `template` variables; page-template is for the actual `page.tmpl` template, while `template` is for other templates which are used inside the page content. So I don't understand why one would need a run_hooks option. --[[KathrynAndersen]] + Another missing thing is that `ftemplate` looks in the "system" templates directories, not just in the wiki, but that seems orthogonal (and might be a good enhancement to `template` anyway). --[[smcv]] + +> Yes, I added that because I wanted the option of not having to make all my templates work as wiki pages also. --[[KathrynAndersen]] -- cgit v1.2.3 From 90c444d9f197a5a9b87d3e70248279ac68e351a6 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 30 Mar 2010 06:44:04 +0000 Subject: response --- doc/plugins/contrib/report/discussion.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index 918d0779b..42a1009cb 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -18,6 +18,17 @@ removing the special case for `field`. Perhaps the `headers` thing could migrate into inline somehow? That might lead to making inline too big, though. +> I think inline is *already* too big, honestly. --[[KathrynAndersen]] + Is the intention that the `trail` part is a performance hack, or a way to select pages? How does it relate to [[todo/wikitrails]] or [[plugins/contrib/trail]]? --[[smcv]] + +> The `trail` part is *both* a performance hack, and a way to select pages. I have over 5000 pages on my site, I need all the performance hacks I can get. +> For the performance hack, it is a way of reducing the need to iterate through every single page in the wiki in order to find matching pages. +> For the way-to-select-pages, yes, it is intended to be similar to [[todo/wikitrails]] and [[plugins/contrib/trail]] (and will be more similar with the new release which will be happening soon; it will add prev_* and next_* variables). +> The idea is that, rather than having to add special "trail" links on PageA to indicate that a page is part of the trail, +> it takes advantage of the `%links` hash, which already contains, for each page, an array of the links from that page to other pages. No need for special markup, just use what's there; a trail is defined as "all the pages linked to from page X", and since it's an array, it has an order already. +> But to avoid that being too limiting, one can use a `pages=...` pagespec to filter that list to a subset; only the pages one is interested in. +> And one can also sort it, if one so desires. +> --[[KathrynAndersen]] -- cgit v1.2.3 From 026355cfa24dc911a247dcafca10c6ea74ae515b Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 30 Mar 2010 12:09:59 +0000 Subject: respond and attempt to invoke Joey :-) --- doc/plugins/contrib/ftemplate/discussion.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index adb66ee6a..de4b35ef0 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -9,9 +9,24 @@ or something). > I got the impression that `pagetemplate` hooks are intended to be completely independent of `template` variables; page-template is for the actual `page.tmpl` template, while `template` is for other templates which are used inside the page content. So I don't understand why one would need a run_hooks option. --[[KathrynAndersen]] +>> `Render`, `inline`, `comments` and `recentchanges` run `pagetemplate` +>> hooks, as does anything that uses `IkiWiki::misctemplate`. From that +>> quick survey, it seems as though `template` is the only thing that +>> uses `HTML::Template` but *doesn't* run `pagetemplate` hooks? +>> +>> It just seems strange to me that `field` needs to have its own +>> of `template` (this), its own variant of `inline` (`report`), +>> and so on - I'd tend to lean more towards having `field` +>> enhance the existing plugins. I'm not an ikiwiki committer, +>> mind... Joey, your opinion would be appreciated! --[[smcv]] + Another missing thing is that `ftemplate` looks in the "system" templates directories, not just in the wiki, but that seems orthogonal (and might be a good enhancement to `template` anyway). --[[smcv]] > Yes, I added that because I wanted the option of not having to make all my templates work as wiki pages also. --[[KathrynAndersen]] + +>> Yeah, that's something that annoys me about `template` too. I've +>> opened a todo: [[todo/user-defined_templates_outside_the_wiki]]. +>> --s -- cgit v1.2.3 From 0503bf7c8824d941b26da4c91b4ee1f721fcf54c Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 30 Mar 2010 12:10:40 +0000 Subject: --- doc/plugins/contrib/ftemplate/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index de4b35ef0..6a1d9f685 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -15,7 +15,7 @@ or something). >> uses `HTML::Template` but *doesn't* run `pagetemplate` hooks? >> >> It just seems strange to me that `field` needs to have its own ->> of `template` (this), its own variant of `inline` (`report`), +>> variant of `template` (this), its own variant of `inline` (`report`), >> and so on - I'd tend to lean more towards having `field` >> enhance the existing plugins. I'm not an ikiwiki committer, >> mind... Joey, your opinion would be appreciated! --[[smcv]] -- cgit v1.2.3 From edcea2b98100aa1ff18b91038a33e2ea55f13850 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 30 Mar 2010 12:27:18 +0000 Subject: respond --- doc/plugins/contrib/report/discussion.mdwn | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index 42a1009cb..a6cb6f8bd 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -20,6 +20,13 @@ lead to making inline too big, though. > I think inline is *already* too big, honestly. --[[KathrynAndersen]] +>> A fair point; perhaps my complaint should be that *inline* does +>> too many orthogonal things. I suppose the headers feature wouldn't +>> really make sense in an inline that didn't have `archive="yes"`, +>> so it'd make sense to recommend this plugin as a replacement +>> for inlining with archive=yes (for which I now realise "inline" +>> is the wrong verb anyway :-) ) --s + Is the intention that the `trail` part is a performance hack, or a way to select pages? How does it relate to [[todo/wikitrails]] or [[plugins/contrib/trail]]? --[[smcv]] @@ -32,3 +39,18 @@ to select pages? How does it relate to [[todo/wikitrails]] or > But to avoid that being too limiting, one can use a `pages=...` pagespec to filter that list to a subset; only the pages one is interested in. > And one can also sort it, if one so desires. > --[[KathrynAndersen]] + +>> That's an interesting approach to trails; I'd missed the fact that +>> links are already ordered. +>> +>> This does have the same problems as tags, though: see +>> [[bugs/tagged()_matching_wikilinks]] and +>> [[todo/matching_different_kinds_of_links]]. I suppose the question +>> now is whether new code should be consistent with `tag` (and +>> potentially be fixed at the same time as tag itself), or try to +>> avoid those problems? +>> +>> The combination of `trail` with another pagespec in this plugin +>> does provide a neat way for it to work around having unwanted +>> pages in the report, by limiting by a suitable tag or subdirectory +>> or something. --s -- cgit v1.2.3 From bb8b941bfc3d3564324a23bba14dc8112d8ea6c7 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 30 Mar 2010 12:48:03 +0000 Subject: respond; correct license of fieldsort plugin to match IkiWiki --- doc/plugins/contrib/field/discussion.mdwn | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 4bb285a50..7e94a4029 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -13,6 +13,19 @@ behaviour, an auxiliary plugin would be easy.) >It's not like one is going to lose the fields defined by the meta plugin; if "author" is defined by \[[!meta author=...]] then that's what will be found by "field" (provided the "meta" plugin is registered; that's what the "field_register" option is for). >--[[KathrynAndersen]] +>> Hmm. I suppose if you put the title (or whatever) in the YAML, then +>> "almost" all the places in IkiWiki that respect titles will do the +>> right thing due to the pagetemplate hook, with the exception being +>> anything that has special side-effects inside `meta` (like `date`), +>> or anything that looks in `$pagestate{foo}{meta}` directly +>> (like `map`). Is your plan that `meta` should register itself by +>> default, and `map` and friends should be adapted to +>> work based on `getfield()` instead of `$pagestate{foo}{meta}`, then? +>> +>> (On the site I mentioned, I'm using an unmodified version of `field`, +>> and currently working around the collision by tagging books' pages +>> with `bookauthor` instead of `author` in the YAML.) --s + From a coding style point of view, the `$CamelCase` variable names aren't IkiWiki style, and the `match_foo` functions look as though they could benefit from being thin wrappers around a common `&IkiWiki::Plugin::field::match` @@ -23,13 +36,20 @@ and more ikiwiki-like style? > I don't think ikiwiki *has* a "style" for docs, does it? So I followed the Perl Module style. And I'm rather baffled as to why having the docs laid out in clear sections... make them less clear. --[[KathrynAndersen]] +>> I keep getting distracted by the big shouty headings :-) +>> I suppose what I was really getting at was that when this plugin +>> is merged, its docs will end up split between its plugin +>> page, [[plugins/write]] and [[ikiwiki/PageSpec]]; on some of the +>> contrib plugins I've added I've tried to separate the docs +>> according to how they'll hopefully be laid out after merge. --s + If one of my branches from [[todo/allow_plugins_to_add_sorting_methods]] is accepted, a `field()` cmp type would mean that [[plugins/contrib/report]] can stop reimplementing sorting. Here's the implementation I'm using, with your "sortspec" concept (a sort-hook would be very similar): if merged, I think it should just be part of `field` rather than a separate plugin. - # Copyright © 2010 Simon McVittie, released under GNU LGPL >= 2.1 + # Copyright © 2010 Simon McVittie, released under GNU GPL >= 2 package IkiWiki::Plugin::fieldsort; use warnings; use strict; -- cgit v1.2.3 From fc5445b90677489642e4ae8d5b2f6c54cdd847c5 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 31 Mar 2010 03:01:41 +0000 Subject: response --- doc/plugins/contrib/ftemplate/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index 6a1d9f685..eb84dd09b 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -20,6 +20,8 @@ or something). >> enhance the existing plugins. I'm not an ikiwiki committer, >> mind... Joey, your opinion would be appreciated! --[[smcv]] +>>> I did it that way basically because I needed the functionality ASAP, and I didn't want to step on anyone's toes, so I made them as separate plugins. If Joey wants to integrate the functionality into IkiWiki proper, I would be very happy, but I don't want to put pressure on him. --[[KathrynAndersen]] + Another missing thing is that `ftemplate` looks in the "system" templates directories, not just in the wiki, but that seems orthogonal (and might be a good enhancement to `template` anyway). -- cgit v1.2.3 From 4eed0abc8c181a027fa802d209fd95d8c10ee9f0 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 1 Apr 2010 00:23:31 +0000 Subject: response; thoughts about inline and tags --- doc/plugins/contrib/report/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index a6cb6f8bd..953509297 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -27,6 +27,8 @@ lead to making inline too big, though. >> for inlining with archive=yes (for which I now realise "inline" >> is the wrong verb anyway :-) ) --s +>>> I think *inline* would be a bit less unwieldy if there was some way of factoring out the feed stuff into a separate plugin, but I don't know if that's possible. --K.A. + Is the intention that the `trail` part is a performance hack, or a way to select pages? How does it relate to [[todo/wikitrails]] or [[plugins/contrib/trail]]? --[[smcv]] @@ -54,3 +56,7 @@ to select pages? How does it relate to [[todo/wikitrails]] or >> does provide a neat way for it to work around having unwanted >> pages in the report, by limiting by a suitable tag or subdirectory >> or something. --s + +>>> Either that, or somehow combine tagging with fields, such that one could declare a tag, and it would create both a link and a field with a given value. (I've been working on something like that, but it still has bugs). +>>> That way, the test for whether something is tagged would be something like "link(tag/foo) and field(tag foo)". +>>> --K.A. -- cgit v1.2.3 From 63bc057690d388a81e643d4556c6a001d886b59c Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 1 Apr 2010 01:35:35 +0000 Subject: --- doc/plugins/contrib/report/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index 953509297..a257198c0 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -60,3 +60,10 @@ to select pages? How does it relate to [[todo/wikitrails]] or >>> Either that, or somehow combine tagging with fields, such that one could declare a tag, and it would create both a link and a field with a given value. (I've been working on something like that, but it still has bugs). >>> That way, the test for whether something is tagged would be something like "link(tag/foo) and field(tag foo)". >>> --K.A. + +>>>> I can see that this'd work well for 1:1 relationships like next +>>>> and previous, but I don't think that'd work for pages with more than +>>>> one tag - as far as I can see, `field`'s data model is that each +>>>> page has no more than one value for each field? +>>>> [[todo/Matching_different_kinds_of_links]] has some thoughts about +>>>> how it could be implemented, though. --s -- cgit v1.2.3 From a682df9a1f14ea873c7103f80108330840a15cd0 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 1 Apr 2010 07:22:37 +0000 Subject: considering tags and fields --- doc/plugins/contrib/report/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn index a257198c0..e23a4ced4 100644 --- a/doc/plugins/contrib/report/discussion.mdwn +++ b/doc/plugins/contrib/report/discussion.mdwn @@ -67,3 +67,9 @@ to select pages? How does it relate to [[todo/wikitrails]] or >>>> page has no more than one value for each field? >>>> [[todo/Matching_different_kinds_of_links]] has some thoughts about >>>> how it could be implemented, though. --s + +>>>>> You have a point there. I'm not sure what would be better: to add the concept of arrays/sets to `field`, or to think of tags as a special case. Problem is, I find tags as they currently exist to be too limiting. I prefer something that can be used for Faceted Tagging ; that is, things like Author:Fred Nurk, Genre:Historical, Rating:Good, and so on. Of course, that doesn't mean that each tag is limited to only one value, either; just to take the above examples, something might have more than one author, or have multiple genres (such as Historical + Romance). + +>>>>> It might be that adding arrays to the `field` plugin is a good way to go: after all, even though field=value is the most common, with the flexibility of things like YAML, one could define all sorts of things. What I'm not so sure about is how to return the values when queried, since some things would be expecting scalars all the time. Ah, perhaps I could use wantarray? +>>>>> Is there a way of checking a HTML::Template template to see if it expecting an array for a particular value? +>>>>> --[[KathrynAndersen]] -- cgit v1.2.3 From 0dad28b3530d70830456a3f8d57b0e3f3d52ee2d Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sat, 3 Apr 2010 00:45:16 +0000 Subject: reduced difference --- doc/plugins/contrib/ftemplate/discussion.mdwn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn index eb84dd09b..1e0bca5d8 100644 --- a/doc/plugins/contrib/ftemplate/discussion.mdwn +++ b/doc/plugins/contrib/ftemplate/discussion.mdwn @@ -29,6 +29,5 @@ seems orthogonal (and might be a good enhancement to `template` anyway). > Yes, I added that because I wanted the option of not having to make all my templates work as wiki pages also. --[[KathrynAndersen]] ->> Yeah, that's something that annoys me about `template` too. I've ->> opened a todo: [[todo/user-defined_templates_outside_the_wiki]]. ->> --s +>> Joey has added support for +>> [[todo/user-defined_templates_outside_the_wiki]] now. --s -- cgit v1.2.3 From a875ee8be702bd4575e009dc652015c1157c7c2e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 3 Apr 2010 13:48:30 +0100 Subject: Split out sortnaturally into a plugin --- IkiWiki.pm | 11 ----------- IkiWiki/Plugin/sortnaturally.pm | 32 ++++++++++++++++++++++++++++++++ debian/NEWS | 8 ++++++++ doc/ikiwiki/pagespec/sorting.mdwn | 5 +++-- doc/plugins/sortnaturally.mdwn | 5 +++++ 5 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 IkiWiki/Plugin/sortnaturally.pm create mode 100644 doc/plugins/sortnaturally.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index a89c14058..8f36f5818 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2423,15 +2423,4 @@ sub cmp_title { sub cmp_mtime { $IkiWiki::pagemtime{$_[1]} <=> $IkiWiki::pagemtime{$_[0]} } sub cmp_age { $IkiWiki::pagectime{$_[1]} <=> $IkiWiki::pagectime{$_[0]} } -sub check_cmp_title_natural { - eval q{use Sort::Naturally}; - if ($@) { - error(gettext("Sort::Naturally needed for title_natural sort")); - } -} -sub cmp_title_natural { - Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])), - IkiWiki::pagetitle(IkiWiki::basename($_[1]))) -} - 1 diff --git a/IkiWiki/Plugin/sortnaturally.pm b/IkiWiki/Plugin/sortnaturally.pm new file mode 100644 index 000000000..0023f31f9 --- /dev/null +++ b/IkiWiki/Plugin/sortnaturally.pm @@ -0,0 +1,32 @@ +#!/usr/bin/perl +# Sort::Naturally-powered title_natural sort order for IkiWiki +package IkiWiki::Plugin::sortnaturally; + +use IkiWiki 3.00; +no warnings; + +sub import { + hook(type => "getsetup", id => "sortnaturally", call => \&getsetup); +} + +sub getsetup { + return + plugin => { + safe => 1, + rebuild => 1, + }, +} + +sub checkconfig () { + eval q{use Sort::Naturally}; + error $@ if $@; +} + +package IkiWiki::PageSpec; + +sub cmp_title_natural { + Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])), + IkiWiki::pagetitle(IkiWiki::basename($_[1]))) +} + +1; diff --git a/debian/NEWS b/debian/NEWS index 50332670f..614eb11f8 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,11 @@ +ikiwiki (3.20100320) UNRELEASED; urgency=low + + The sort="title_natural" option on [[!inline]] etc. now requires the + new sortnaturally plugin. This is not enabled by default, because it requires + the Sort::Naturally module. + + -- Simon McVittie Sat, 03 Apr 2010 13:46:08 +0100 + ikiwiki (3.20091017) unstable; urgency=low To take advantage of significant performance improvements, all diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index f27972d4e..ba995a521 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -6,9 +6,10 @@ orders can be specified. * `age` - List pages from the most recently created to the oldest. * `mtime` - List pages with the most recently modified first. * `title` - Order by title (page name). -* `title_natural` - Only available if [[!cpan Sort::Naturally]] is - installed. Orders by title, but numbers in the title are treated +[[!if test="enabled(sortnaturally)" then=""" +* `title_natural` - Orders by title, but numbers in the title are treated as such, ("1 2 9 10 20" instead of "1 10 2 20 9") +"""]] [[!if test="enabled(meta)" then=""" * `meta_title` - Order according to the `\[[!meta title="foo" sort="bar"]]` or `\[[!meta title="foo"]]` [[ikiwiki/directive]], or the page name if no diff --git a/doc/plugins/sortnaturally.mdwn b/doc/plugins/sortnaturally.mdwn new file mode 100644 index 000000000..91f373f6b --- /dev/null +++ b/doc/plugins/sortnaturally.mdwn @@ -0,0 +1,5 @@ +[[!template id=plugin name=sortnaturally core=1 author="[[chrysn]], [[smcv]]"]] +[[!tag type/meta]] + +This plugin provides the `title_natural` [[ikiwiki/pagespec/sorting]] order, +which uses Sort::Naturally to sort numbered pages in a more natural order. -- cgit v1.2.3 From 75fd08046548940c443c46bcdf9a5b0b6968b175 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 3 Apr 2010 13:49:20 +0100 Subject: Remove support for check_cmp_foo (pre-sort checks) --- IkiWiki.pm | 4 ---- doc/plugins/write.mdwn | 5 ----- 2 files changed, 9 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 8f36f5818..7547f1751 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1973,10 +1973,6 @@ sub cmpspec_translate ($) { } if (exists $IkiWiki::PageSpec::{"cmp_$word"}) { - if (exists $IkiWiki::PageSpec::{"check_cmp_$word"}) { - $IkiWiki::PageSpec::{"check_cmp_$word"}->($params); - } - if (defined $params) { push @data, $params; $code .= "IkiWiki::PageSpec::cmp_$word(\@_, \$data[$#data])"; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index de2b47015..06c8f8e44 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1128,11 +1128,6 @@ is greater, or zero if they are considered equal. It may also raise an error using `error`, for instance if it needs a parameter but one isn't provided. -You can also define a function called `check_cmp_foo` in the same package. -If you do, it will be called while preparing to sort by `foo` or `foo(bar)`, -with argument `undef` or `"bar"` respectively; it may raise an error using -`error`, if sorting like that isn't going to work. - ### Setup plugins The ikiwiki setup file is loaded using a pluggable mechanism. If you look -- cgit v1.2.3 From 04a59b3c65e8e60805b6ed6d11d448b1d5babe64 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 3 Apr 2010 13:57:38 +0100 Subject: Move sort hooks to the IkiWiki::SortSpec namespace Also rename cmpspec_translate (internal function) to sortspec_translate for consistency. --- IkiWiki.pm | 14 ++++++++------ IkiWiki/Plugin/meta.pm | 2 ++ IkiWiki/Plugin/sortnaturally.pm | 2 +- doc/plugins/write.mdwn | 2 +- t/pagespec_match_list.t | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 7547f1751..d716e8b39 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -37,7 +37,7 @@ our $DEPEND_LINKS=4; # Optimisation. use Memoize; memoize("abs2rel"); -memoize("cmpspec_translate"); +memoize("sortspec_translate"); memoize("pagespec_translate"); memoize("template_file"); @@ -1935,7 +1935,7 @@ sub add_link ($$) { unless grep { $_ eq $link } @{$links{$page}}; } -sub cmpspec_translate ($) { +sub sortspec_translate ($) { my $spec = shift; my $code = ""; @@ -1972,13 +1972,13 @@ sub cmpspec_translate ($) { $code .= "-"; } - if (exists $IkiWiki::PageSpec::{"cmp_$word"}) { + if (exists $IkiWiki::SortSpec::{"cmp_$word"}) { if (defined $params) { push @data, $params; - $code .= "IkiWiki::PageSpec::cmp_$word(\@_, \$data[$#data])"; + $code .= "IkiWiki::SortSpec::cmp_$word(\@_, \$data[$#data])"; } else { - $code .= "IkiWiki::PageSpec::cmp_$word(\@_, undef)"; + $code .= "IkiWiki::SortSpec::cmp_$word(\@_, undef)"; } } else { @@ -2095,7 +2095,7 @@ sub pagespec_match_list ($$;@) { } if (defined $params{sort}) { - my $f = cmpspec_translate($params{sort}); + my $f = sortspec_translate($params{sort}); @candidates = sort { $f->($a, $b) } @candidates; } @@ -2410,6 +2410,8 @@ sub match_ip ($$;@) { } } +package IkiWiki::SortSpec; + sub cmp_title { IkiWiki::pagetitle(IkiWiki::basename($_[0])) cmp diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index e8cc1e392..cd7d0d127 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -348,6 +348,8 @@ sub match_copyright ($$;@) { IkiWiki::Plugin::meta::match("copyright", @_); } +package IkiWiki::SortSpec; + sub cmp_meta_title { IkiWiki::Plugin::meta::titlesort($_[0]) cmp diff --git a/IkiWiki/Plugin/sortnaturally.pm b/IkiWiki/Plugin/sortnaturally.pm index 0023f31f9..f498820a5 100644 --- a/IkiWiki/Plugin/sortnaturally.pm +++ b/IkiWiki/Plugin/sortnaturally.pm @@ -22,7 +22,7 @@ sub checkconfig () { error $@ if $@; } -package IkiWiki::PageSpec; +package IkiWiki::SortSpec; sub cmp_title_natural { Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])), diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 06c8f8e44..b67142230 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1114,7 +1114,7 @@ while "glob(*)" is not influenced by the contents of any page. Similarly, it's possible to write plugins that add new functions as [[ikiwiki/pagespec/sorting]] methods. To achieve this, add a function to -the IkiWiki::PageSpec package named `cmp_foo`, which will be used when sorting +the IkiWiki::SortSpec package named `cmp_foo`, which will be used when sorting by `foo` or `foo(...)` is requested. The function will be passed three or more parameters. The first two are diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index 743ae4637..68112f5c0 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -10,7 +10,7 @@ $config{srcdir}=$config{destdir}="/dev/null"; IkiWiki::checkconfig(); { - package IkiWiki::PageSpec; + package IkiWiki::SortSpec; sub cmp_path { $_[0] cmp $_[1] } } -- cgit v1.2.3 From c1a42e76bc6667bfb2882a12d53c25d9f952ca82 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 2 Apr 2010 00:28:02 +0100 Subject: implement typed links; add tagged_is_strict config option --- IkiWiki.pm | 58 ++++++++++++++++++---- IkiWiki/Plugin/tag.pm | 36 +++++++++----- IkiWiki/Render.pm | 33 ++++++++++++ .../tagged__40____41___matching_wikilinks.mdwn | 3 ++ doc/ikiwiki/pagespec.mdwn | 3 ++ doc/plugins/tag.mdwn | 5 ++ doc/plugins/write.mdwn | 21 +++++++- t/index.t | 17 +++++-- t/tag.t | 45 +++++++++++++++++ 9 files changed, 193 insertions(+), 28 deletions(-) create mode 100755 t/tag.t (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 6739ba56c..25e9247b2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -14,7 +14,7 @@ use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %wikistate %renderedfiles %oldrenderedfiles %pagesources %destsources %depends %depends_simple %hooks - %forcerebuild %loaded_plugins}; + %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype @@ -24,7 +24,7 @@ our @EXPORT = qw(hook debug error template htmlpage deptype add_underlay pagetitle titlepage linkpage newpagefile inject add_link %config %links %pagestate %wikistate %renderedfiles - %pagesources %destsources); + %pagesources %destsources %typedlinks); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE our $installdir='/usr'; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE @@ -1503,7 +1503,7 @@ sub loadindex () { if (! $config{rebuild}) { %pagesources=%pagemtime=%oldlinks=%links=%depends= %destsources=%renderedfiles=%pagecase=%pagestate= - %depends_simple=(); + %depends_simple=%typedlinks=%oldtypedlinks=(); } my $in; if (! open ($in, "<", "$config{wikistatedir}/indexdb")) { @@ -1569,6 +1569,14 @@ sub loadindex () { if (exists $d->{state}) { $pagestate{$page}=$d->{state}; } + if (exists $d->{typedlinks}) { + $typedlinks{$page}=$d->{typedlinks}; + + while (my ($type, $links) = each %{$typedlinks{$page}}) { + next unless %$links; + $oldtypedlinks{$page}{$type} = {%$links}; + } + } } $oldrenderedfiles{$page}=[@{$d->{dest}}]; } @@ -1617,6 +1625,10 @@ sub saveindex () { $index{page}{$src}{depends_simple} = $depends_simple{$page}; } + if (exists $typedlinks{$page} && %{$typedlinks{$page}}) { + $index{page}{$src}{typedlinks} = $typedlinks{$page}; + } + if (exists $pagestate{$page}) { foreach my $id (@hookids) { foreach my $key (keys %{$pagestate{$page}{$id}}) { @@ -1926,12 +1938,17 @@ sub inject { use warnings; } -sub add_link ($$) { +sub add_link ($$;$) { my $page=shift; my $link=shift; + my $type=shift; push @{$links{$page}}, $link unless grep { $_ eq $link } @{$links{$page}}; + + if (defined $type) { + $typedlinks{$page}{$type}{$link} = 1; + } } sub pagespec_translate ($) { @@ -2212,6 +2229,11 @@ sub match_link ($$;@) { $link=derel($link, $params{location}); my $from=exists $params{location} ? $params{location} : ''; + my $linktype=$params{linktype}; + my $qualifier=''; + if (defined $linktype) { + $qualifier=" with type $linktype"; + } my $links = $IkiWiki::links{$page}; return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS, "" => 1) @@ -2219,19 +2241,33 @@ sub match_link ($$;@) { my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { if (length $bestlink) { - return IkiWiki::SuccessReason->new("$page links to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) - if $bestlink eq IkiWiki::bestlink($page, $p); + if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && $bestlink eq IkiWiki::bestlink($page, $p)) { + return IkiWiki::SuccessReason->new("$page links to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1) + } } else { - return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) - if match_glob($p, $link, %params); + if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && match_glob($p, $link, %params)) { + return IkiWiki::SuccessReason->new("$page links to page $p$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) + } my ($p_rel)=$p=~/^\/?(.*)/; $link=~s/^\///; - return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) - if match_glob($p_rel, $link, %params); + if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p_rel}) && match_glob($p_rel, $link, %params)) { + return IkiWiki::SuccessReason->new("$page links to page $p_rel$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) + } } } - return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1); + return IkiWiki::FailReason->new("$page does not link to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1); +} + +sub match_typedlink($$;@) { + my $page = shift; + my $args = shift; + + if ($args =~ /^(\w+)\s+(.*)$/) { + return match_link($page, $2, @_, linktype => $1); + } + + return IkiWiki::ErrorReason->new("typedlink expects e.g. 'tag *' but got: $args"); } sub match_backlink ($$;@) { diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index cdcfaf536..af4bff1bc 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -6,8 +6,6 @@ use warnings; use strict; use IkiWiki 3.00; -my %tags; - sub import { hook(type => "getopt", id => "tag", call => \&getopt); hook(type => "getsetup", id => "tag", call => \&getsetup); @@ -36,6 +34,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + tagged_is_strict => { + type => "boolean", + default => 0, + description => "if 1, tagged() doesn't match normal WikiLinks to tag pages", + safe => 1, + rebuild => 1, + }, } sub tagpage ($) { @@ -71,9 +76,8 @@ sub preprocess_tag (@) { foreach my $tag (keys %params) { $tag=linkpage($tag); - $tags{$page}{$tag}=1; # hidden WikiLink - add_link($page, tagpage($tag)); + add_link($page, tagpage($tag), 'tag'); } return ""; @@ -87,15 +91,13 @@ sub preprocess_taglink (@) { return join(" ", map { if (/(.*)\|(.*)/) { my $tag=linkpage($2); - $tags{$params{page}}{$tag}=1; - add_link($params{page}, tagpage($tag)); + add_link($params{page}, tagpage($tag), 'tag'); return taglink($params{page}, $params{destpage}, $tag, linktext => pagetitle($1)); } else { my $tag=linkpage($_); - $tags{$params{page}}{$tag}=1; - add_link($params{page}, tagpage($tag)); + add_link($params{page}, tagpage($tag), 'tag'); return taglink($params{page}, $params{destpage}, $tag); } } @@ -110,17 +112,19 @@ sub pagetemplate (@) { my $destpage=$params{destpage}; my $template=$params{template}; + my $tags = $typedlinks{$page}{tag}; + $template->param(tags => [ map { link => taglink($page, $destpage, $_, rel => "tag") - }, sort keys %{$tags{$page}} - ]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags"); + }, sort keys %$tags + ]) if defined $tags && %$tags && $template->query(name => "tags"); if ($template->query(name => "categories")) { # It's an rss/atom template. Add any categories. - if (exists $tags{$page} && %{$tags{$page}}) { + if (defined $tags && %$tags) { $template->param(categories => [map { category => $_ }, - sort keys %{$tags{$page}}]); + sort keys %$tags]); } } } @@ -130,7 +134,13 @@ package IkiWiki::PageSpec; sub match_tagged ($$;@) { my $page = shift; my $glob = shift; - return match_link($page, IkiWiki::Plugin::tag::tagpage($glob)); + + if ($IkiWiki::config{tagged_is_strict}) { + return match_link($page, IkiWiki::Plugin::tag::tagpage($glob), linktype => 'tag'); + } + else { + return match_link($page, IkiWiki::Plugin::tag::tagpage($glob)); + } } 1 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index abafb0887..5810fc974 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -167,6 +167,7 @@ sub scan ($) { else { $links{$page}=[]; } + delete $typedlinks{$page}; run_hooks(scan => sub { shift->( @@ -398,6 +399,7 @@ sub find_del_files ($) { push @del, $pagesources{$page}; } $links{$page}=[]; + delete $typedlinks{$page}; $renderedfiles{$page}=[]; $pagemtime{$page}=0; } @@ -499,6 +501,29 @@ sub remove_unrendered () { } } +sub link_types_changed ($$) { + # each is of the form { type => { link => 1 } } + my $new = shift; + my $old = shift; + + return 0 if !defined $new && !defined $old; + return 1 if !defined $new || !defined $old; + + while (my ($type, $links) = each %$new) { + foreach my $link (keys %$links) { + return 1 unless exists $old{$type}{$link}; + } + } + + while (my ($type, $links) = each %$old) { + foreach my $link (keys %$links) { + return 1 unless exists $new{$type}{$link}; + } + } + + return 0; +} + sub calculate_changed_links ($$$) { my ($changed, $del, $oldlink_targets)=@_; @@ -525,6 +550,14 @@ sub calculate_changed_links ($$$) { } $linkchangers{lc($page)}=1; } + + # we currently assume that changing the type of a link doesn't + # change backlinks + if (!exists $linkchangers{lc($page)}) { + if (link_types_changed($typedlinks{$page}, $oldlinktypes{$page})) { + $linkchangers{lc($page)}=1; + } + } } return \%backlinkchanged, \%linkchangers; diff --git a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn index e7e4af7c3..9037d6c02 100644 --- a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn +++ b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn @@ -28,6 +28,9 @@ rationale on this, or what am I doing wrong, and how to achieve what I want? >> is valid. [[todo/matching_different_kinds_of_links]] is probably >> how it will eventually be solved. --[[Joey]] +>>> [[Done]]: you can now set the `tagged_is_strict` config option to `1` +>>> if you don't want `tagged` to match other wikilinks. --[[smcv]] + > And this is an illustration why a clean work-around (without changing the software) is not possible: while thinking about [[todo/matching_different_kinds_of_links]], I thought one could work around the problem by simply explicitly including the kind of the relation into the link target (like the tagbase in tags), and by having a separate page without the "tagbase" to link to when one wants simply to refer to the tag without tagging. But this won't work: one has to at least once refer to the real tag page if one wants to talk about it, and this reference will count as tagging (unwanted). --Ivan Z. > But well, perhaps there is a workaround without introducing different kinds of links. One could modify the [[tag plugin|plugins/tag]] so that it adds 2 links to a page: for tagging -- `tagbase/TAG`, and for navigation -- `tagdescription/TAG` (displayed at the bottom). Then the `tagdescription/TAG` page would hold whatever list one wishes (with `tagged(TAG)` in the pagespec), and whenever one wants to merely refer to the tag, one should link to `tagdescription/TAG`--this link won't count as tagging. So, `tagbase/TAG` would become completely auxiliary (internal) link targets for ikiwiki, the users would edit or link to only `tagdescription/TAG`. --Ivan Z. diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn index 5c191f23f..ca6693024 100644 --- a/doc/ikiwiki/pagespec.mdwn +++ b/doc/ikiwiki/pagespec.mdwn @@ -52,6 +52,9 @@ Some more elaborate limits can be added to what matches using these functions: specified IP address. * "`postcomment(glob)`" - matches only when comments are being posted to a page matching the specified glob +* "`typedlink(type glob)`" - matches pages that link to a given page (or glob) + with a given link type. Plugins can create links with a specific type: + for instance, the tag plugin creates links of type `tag`. For example, to match all pages in a blog that link to the page about music and were written in 2005: diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 8ff70a069..8cd79da41 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,6 +8,11 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. +If the `tagged_is_strict` config option is set, `tagged()` will only match +tags explicitly set with [[ikiwiki/directive/tag]] or +[[ikiwiki/directive/taglink]]; if not (the default), it will also match +any other [[WikiLinks|ikiwiki/WikiLink]] to the tag page. + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 96a2aa16d..fe7cf0183 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -633,6 +633,22 @@ reference. Do not modify this hash directly; call `add_link()`. $links{"foo"} = ["bar", "baz"]; +### `%typedlinks` + +The `%typedlinks` hash records links of specific types. Do not modify this +hash directly; call `add_link()`. The keys are page names, and the values +are hash references. In each page's hash reference, the keys are link types +defined by plugins, and the values are hash references with link targets +as keys, and 1 as a dummy value, something like this: + + $typedlinks{"foo"} = { + tag => { short_word => 1, metasyntactic_variable => 1 }, + next_page => { bar => 1 }, + }; + +Ordinary [[WikiLinks|ikiwiki/WikiLink]] appear in `%links`, but not in +`%typedlinks`. + ### `%pagesources` The `%pagesources` has can be used to look up the source filename @@ -939,11 +955,14 @@ Optionally, a third parameter can be passed, to specify the preferred filename of the page. For example, `targetpage("foo", "rss", "feed")` will yield something like `foo/feed.rss`. -### `add_link($$)` +### `add_link($$;$)` This adds a link to `%links`, ensuring that duplicate links are not added. Pass it the page that contains the link, and the link text. +An optional third parameter sets the link type (`undef` produces an ordinary +[[ikiwiki/WikiLink]]). + ## Miscellaneous ### Internal use pages diff --git a/t/index.t b/t/index.t index 2f23524a7..44273059d 100755 --- a/t/index.t +++ b/t/index.t @@ -4,7 +4,7 @@ use strict; use IkiWiki; package IkiWiki; # use internal variables -use Test::More tests => 27; +use Test::More tests => 31; $config{wikistatedir}="/tmp/ikiwiki-test.$$"; system "rm -rf $config{wikistatedir}"; @@ -31,6 +31,7 @@ $renderedfiles{"bar"}=["bar.html", "bar.rss", "sparkline-foo.gif"]; $renderedfiles{"bar.png"}=["bar.png"]; $links{"Foo"}=["bar.png"]; $links{"bar"}=["Foo", "new-page"]; +$typedlinks{"bar"}={tag => {"Foo" => 1}}; $links{"bar.png"}=[]; $depends{"Foo"}={}; $depends{"bar"}={"foo*" => 1}; @@ -45,7 +46,7 @@ ok(-s "$config{wikistatedir}/indexdb", "index file created"); # Clear state. %oldrenderedfiles=%pagectime=(); -%pagesources=%pagemtime=%oldlinks=%links=%depends= +%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks= %destsources=%renderedfiles=%pagecase=%pagestate=(); ok(loadindex(), "load index"); @@ -104,10 +105,16 @@ is_deeply(\%destsources, { "sparkline-foo.gif" => "bar", "bar.png" => "bar.png", }, "%destsources generated correctly"); +is_deeply(\%typedlinks, { + bar => {tag => {"Foo" => 1}}, +}, "%typedlinks loaded correctly"); +is_deeply(\%oldtypedlinks, { + bar => {tag => {"Foo" => 1}}, +}, "%oldtypedlinks loaded correctly"); # Clear state. %oldrenderedfiles=%pagectime=(); -%pagesources=%pagemtime=%oldlinks=%links=%depends= +%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks= %destsources=%renderedfiles=%pagecase=%pagestate=(); # When state is loaded for a wiki rebuild, only ctime and oldrenderedfiles @@ -140,5 +147,9 @@ is_deeply(\%pagecase, { }, "%pagecase generated correctly"); is_deeply(\%destsources, { }, "%destsources generated correctly"); +is_deeply(\%typedlinks, { +}, "%typedlinks cleared correctly"); +is_deeply(\%oldtypedlinks, { +}, "%oldtypedlinks cleared correctly"); system "rm -rf $config{wikistatedir}"; diff --git a/t/tag.t b/t/tag.t new file mode 100755 index 000000000..3383fd475 --- /dev/null +++ b/t/tag.t @@ -0,0 +1,45 @@ +#!/usr/bin/perl +package IkiWiki; + +use warnings; +use strict; +use Test::More tests => 10; + +BEGIN { use_ok("IkiWiki"); } +BEGIN { use_ok("IkiWiki::Plugin::tag"); } + +ok(! system("rm -rf t/tmp; mkdir t/tmp")); + +$config{userdir} = "users"; +$config{tagbase} = "tags"; +$config{tagged_is_strict} = 1; + +%oldrenderedfiles=%pagectime=(); +%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks= +%destsources=%renderedfiles=%pagecase=%pagestate=(); + +foreach my $page (qw(tags/numbers tags/letters one two alpha beta)) { + $pagesources{$page} = "$page.mdwn"; + $pagemtime{$page} = $pagectime{$page} = 1000000; +} + +$links{one}=[qw(tags/numbers alpha tags/letters)]; +$links{two}=[qw(tags/numbers)]; +$links{alpha}=[qw(tags/letters one)]; +$links{beta}=[qw(tags/letters)]; +$typedlinks{one}={tag => {"tags/numbers" => 1 }}; +$typedlinks{two}={tag => {"tags/numbers" => 1 }}; +$typedlinks{alpha}={tag => {"tags/letters" => 1 }}; +$typedlinks{beta}={tag => {"tags/letters" => 1 }}; + +ok(pagespec_match("one", "tagged(numbers)")); +ok(!pagespec_match("two", "tagged(alpha)")); +ok(pagespec_match("one", "link(tags/numbers)")); +ok(pagespec_match("one", "link(alpha)")); + +ok(pagespec_match("one", "typedlink(tag tags/numbers)")); +ok(!pagespec_match("one", "typedlink(tag tags/letters)")); +# invalid syntax +ok(pagespec_match("one", "typedlink(tag)")->isa("IkiWiki::ErrorReason")); + +1; -- cgit v1.2.3 From ef6344144051ed70649ccbff01bcc4fce927ee2f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 4 Apr 2010 00:24:27 +0100 Subject: Remove tagged_is_strict option, and just behave as though it was enabled Jon was worried about the backwards-compatibility break involved in making tagged() not match non-tag links, but Joey seems less concerned about it. --- IkiWiki/Plugin/tag.pm | 17 +---------------- doc/bugs/tagged__40____41___matching_wikilinks.mdwn | 3 +-- doc/plugins/tag.mdwn | 5 ----- t/tag.t | 1 - 4 files changed, 2 insertions(+), 24 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index af4bff1bc..7a85874f6 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -34,13 +34,6 @@ sub getsetup () { safe => 1, rebuild => 1, }, - tagged_is_strict => { - type => "boolean", - default => 0, - description => "if 1, tagged() doesn't match normal WikiLinks to tag pages", - safe => 1, - rebuild => 1, - }, } sub tagpage ($) { @@ -132,15 +125,7 @@ sub pagetemplate (@) { package IkiWiki::PageSpec; sub match_tagged ($$;@) { - my $page = shift; - my $glob = shift; - - if ($IkiWiki::config{tagged_is_strict}) { - return match_link($page, IkiWiki::Plugin::tag::tagpage($glob), linktype => 'tag'); - } - else { - return match_link($page, IkiWiki::Plugin::tag::tagpage($glob)); - } + return match_link($_[0], IkiWiki::Plugin::tag::tagpage($_[1]), linktype => 'tag'); } 1 diff --git a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn index 9037d6c02..a211654f1 100644 --- a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn +++ b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn @@ -28,8 +28,7 @@ rationale on this, or what am I doing wrong, and how to achieve what I want? >> is valid. [[todo/matching_different_kinds_of_links]] is probably >> how it will eventually be solved. --[[Joey]] ->>> [[Done]]: you can now set the `tagged_is_strict` config option to `1` ->>> if you don't want `tagged` to match other wikilinks. --[[smcv]] +>>> [[Done]]: `tagged` no longer matches other wikilinks. --[[smcv]] > And this is an illustration why a clean work-around (without changing the software) is not possible: while thinking about [[todo/matching_different_kinds_of_links]], I thought one could work around the problem by simply explicitly including the kind of the relation into the link target (like the tagbase in tags), and by having a separate page without the "tagbase" to link to when one wants simply to refer to the tag without tagging. But this won't work: one has to at least once refer to the real tag page if one wants to talk about it, and this reference will count as tagging (unwanted). --Ivan Z. diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 8cd79da41..8ff70a069 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,11 +8,6 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. -If the `tagged_is_strict` config option is set, `tagged()` will only match -tags explicitly set with [[ikiwiki/directive/tag]] or -[[ikiwiki/directive/taglink]]; if not (the default), it will also match -any other [[WikiLinks|ikiwiki/WikiLink]] to the tag page. - [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/t/tag.t b/t/tag.t index 3383fd475..cf3bbdf01 100755 --- a/t/tag.t +++ b/t/tag.t @@ -12,7 +12,6 @@ ok(! system("rm -rf t/tmp; mkdir t/tmp")); $config{userdir} = "users"; $config{tagbase} = "tags"; -$config{tagged_is_strict} = 1; %oldrenderedfiles=%pagectime=(); %pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks= -- cgit v1.2.3 From 20040772cecbddf07ab6369a22ab2fe1ad794b48 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 4 Apr 2010 00:27:20 +0000 Subject: update fieldsort plugin to be compatible with the latest version of my branch --- doc/plugins/contrib/field/discussion.mdwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 7e94a4029..ad17f87e6 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -68,15 +68,13 @@ I think it should just be part of `field` rather than a separate plugin. }, } - package IkiWiki::PageSpec; + package IkiWiki::SortSpec; - sub check_cmp_field { + sub cmp_field { if (!length $_[0]) { error("sort=field requires a parameter"); } - } - sub cmp_field { my $left = IkiWiki::Plugin::field::field_get_value($_[2], $_[0]); my $right = IkiWiki::Plugin::field::field_get_value($_[2], $_[1]); -- cgit v1.2.3 From 834936a408d0d9f481071fbcaefc67273eabb60c Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 4 Apr 2010 14:03:51 +0000 Subject: bug report + patch: unnecessary YAML::Any dependency --- doc/plugins/contrib/field/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index ad17f87e6..c2b75a76d 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -84,3 +84,11 @@ I think it should just be part of `field` rather than a separate plugin. } 1; + +------- + +Bug report: `field` has an unnecessary `use YAML::Any`, presumably from before +you separated out `ymlfront`. Trivial patch available from +field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: +) +--[[smcv]] -- cgit v1.2.3 From f6dde92957f8b21d8823f2e51d9e3c48bbad7146 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 4 Apr 2010 14:05:42 +0000 Subject: advertise some bugfixes --- doc/plugins/contrib/ymlfront/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/plugins/contrib/ymlfront/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn new file mode 100644 index 000000000..f437624b6 --- /dev/null +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -0,0 +1,4 @@ +My field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: +) +has some fixes for compatibility with old YAML modules, mostly done by imitating +Joey's code in IkiWiki::Setup::Yaml. Please consider merging :-) --[[smcv]] -- cgit v1.2.3 From a01028ae8156679a108a40c62aa6b4cc3e2b3ae7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Apr 2010 17:02:10 -0400 Subject: txt: Add a special case for robots.txt. --- IkiWiki/Plugin/txt.pm | 9 ++++++++- debian/changelog | 1 + doc/plugins/txt.mdwn | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/txt.pm b/IkiWiki/Plugin/txt.pm index 1ed9f0856..0d9a0b35b 100644 --- a/IkiWiki/Plugin/txt.pm +++ b/IkiWiki/Plugin/txt.pm @@ -39,7 +39,14 @@ sub filter (@) { my %params = @_; my $content = $params{content}; - if (defined $pagesources{$params{page}} && $pagesources{$params{page}} =~ /\.txt$/) { + if (defined $pagesources{$params{page}} && + $pagesources{$params{page}} =~ /\.txt$/) { + if ($pagesources{$params{page}} eq 'robots.txt' && + $params{page} eq $params{destpage}) { + will_render($params{page}, 'robots.txt'); + writefile('robots.txt', $config{destdir}, $content); + } + encode_entities($content, "<>&"); if ($findurl) { my $finder = URI::Find->new(sub { diff --git a/debian/changelog b/debian/changelog index be89d0918..77d17f566 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.20100404) UNRELEASED; urgency=low * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) * comments: Fix missing entity encoding in title. + * txt: Add a special case for robots.txt. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/plugins/txt.mdwn b/doc/plugins/txt.mdwn index 420898d09..a3087c9e0 100644 --- a/doc/plugins/txt.mdwn +++ b/doc/plugins/txt.mdwn @@ -12,3 +12,8 @@ The only exceptions are that [[WikiLinks|ikiwiki/WikiLink]] and [[directives|ikiwiki/directive]] are still expanded by ikiwiki, and that, if the [[!cpan URI::Find]] perl module is installed, URLs in the txt file are converted to hyperlinks. + +---- + +As a special case, a file `robots.txt` will be copied intact into the +`destdir`, as well as creating a wiki page named "robots". -- cgit v1.2.3 From cb8b2f80b2f8c91eba3f3a6a5b9913ab80326df8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 5 Apr 2010 22:50:51 +0100 Subject: Use $a and $b for SortSpec cmp callbacks --- IkiWiki.pm | 27 ++++++++++++++++++--------- IkiWiki/Plugin/meta.pm | 14 ++++++-------- IkiWiki/Plugin/sortnaturally.pm | 4 ++-- doc/plugins/write.mdwn | 20 ++++++++++---------- t/pagespec_match_list.t | 2 +- 5 files changed, 37 insertions(+), 30 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index d716e8b39..da36494fb 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1975,10 +1975,10 @@ sub sortspec_translate ($) { if (exists $IkiWiki::SortSpec::{"cmp_$word"}) { if (defined $params) { push @data, $params; - $code .= "IkiWiki::SortSpec::cmp_$word(\@_, \$data[$#data])"; + $code .= "IkiWiki::SortSpec::cmp_$word(\$data[$#data])"; } else { - $code .= "IkiWiki::SortSpec::cmp_$word(\@_, undef)"; + $code .= "IkiWiki::SortSpec::cmp_$word(undef)"; } } else { @@ -2095,9 +2095,8 @@ sub pagespec_match_list ($$;@) { } if (defined $params{sort}) { - my $f = sortspec_translate($params{sort}); - - @candidates = sort { $f->($a, $b) } @candidates; + @candidates = IkiWiki::SortSpec::sort_pages($params{sort}, + @candidates); } @candidates=reverse(@candidates) if $params{reverse}; @@ -2412,13 +2411,23 @@ sub match_ip ($$;@) { package IkiWiki::SortSpec; +# This is in the SortSpec namespace so that the $a and $b that sort() uses +# $IkiWiki::SortSpec::a and $IkiWiki::SortSpec::b, so that plugins' cmp +# functions can access them easily. +sub sort_pages +{ + my $f = IkiWiki::sortspec_translate(shift); + + return sort $f @_; +} + sub cmp_title { - IkiWiki::pagetitle(IkiWiki::basename($_[0])) + IkiWiki::pagetitle(IkiWiki::basename($a)) cmp - IkiWiki::pagetitle(IkiWiki::basename($_[1])) + IkiWiki::pagetitle(IkiWiki::basename($b)) } -sub cmp_mtime { $IkiWiki::pagemtime{$_[1]} <=> $IkiWiki::pagemtime{$_[0]} } -sub cmp_age { $IkiWiki::pagectime{$_[1]} <=> $IkiWiki::pagectime{$_[0]} } +sub cmp_mtime { $IkiWiki::pagemtime{$b} <=> $IkiWiki::pagemtime{$a} } +sub cmp_age { $IkiWiki::pagectime{$b} <=> $IkiWiki::pagectime{$a} } 1 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 4992617d0..553f93455 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -374,25 +374,23 @@ sub match_copyright ($$;@) { package IkiWiki::SortSpec; sub cmp_meta { - my $left = $_[0]; - my $right = $_[1]; - my $meta = $_[2]; + my $meta = $_[0]; error(gettext("sort=meta requires a parameter")) unless defined $meta; if ($meta eq 'updated' || $meta eq 'date') { - return IkiWiki::Plugin::meta::get_sort_key($left, $meta) + return IkiWiki::Plugin::meta::get_sort_key($a, $meta) <=> - IkiWiki::Plugin::meta::get_sort_key($right, $meta); + IkiWiki::Plugin::meta::get_sort_key($b, $meta); } - return IkiWiki::Plugin::meta::get_sort_key($left, $meta) + return IkiWiki::Plugin::meta::get_sort_key($a, $meta) cmp - IkiWiki::Plugin::meta::get_sort_key($right, $meta); + IkiWiki::Plugin::meta::get_sort_key($b, $meta); } # A prototype of how sort=title could behave in 4.0 or something sub cmp_meta_title { - $_[2] = 'title'; + $_[0] = 'title'; return cmp_meta(@_); } diff --git a/IkiWiki/Plugin/sortnaturally.pm b/IkiWiki/Plugin/sortnaturally.pm index f498820a5..92453749d 100644 --- a/IkiWiki/Plugin/sortnaturally.pm +++ b/IkiWiki/Plugin/sortnaturally.pm @@ -25,8 +25,8 @@ sub checkconfig () { package IkiWiki::SortSpec; sub cmp_title_natural { - Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])), - IkiWiki::pagetitle(IkiWiki::basename($_[1]))) + Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($a)), + IkiWiki::pagetitle(IkiWiki::basename($b))) } 1; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index b67142230..f42cc86ae 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1117,16 +1117,16 @@ Similarly, it's possible to write plugins that add new functions as the IkiWiki::SortSpec package named `cmp_foo`, which will be used when sorting by `foo` or `foo(...)` is requested. -The function will be passed three or more parameters. The first two are -page names, and the third is `undef` if invoked as `foo`, or the parameter -`"bar"` if invoked as `foo(bar)`. It may also be passed additional, named -parameters. - -It should return the same thing as Perl's `cmp` and `<=>` operators: negative -if the first argument is less than the second, positive if the first argument -is greater, or zero if they are considered equal. It may also raise an -error using `error`, for instance if it needs a parameter but one isn't -provided. +The names of pages to be compared are in the global variables `$a` and `$b` +in the IkiWiki::SortSpec package. The function should return the same thing +as Perl's `cmp` and `<=>` operators: negative if `$a` is less than `$b`, +positive if `$a` is greater, or zero if they are considered equal. It may +also raise an error using `error`, for instance if it needs a parameter but +one isn't provided. + +The function will also be passed one or more parameters. The first is +`undef` if invoked as `foo`, or the parameter `"bar"` if invoked as `foo(bar)`; +it may also be passed additional, named parameters. ### Setup plugins diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index 68112f5c0..2ad7a9105 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -12,7 +12,7 @@ IkiWiki::checkconfig(); { package IkiWiki::SortSpec; - sub cmp_path { $_[0] cmp $_[1] } + sub cmp_path { $a cmp $b } } %pagesources=( -- cgit v1.2.3 From 5f8df5828834c0163d04ad3b949888d78e37ae73 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 6 Apr 2010 03:59:09 +0000 Subject: --- doc/plugins/contrib/ymlfront/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index f437624b6..ce3b2b483 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -2,3 +2,6 @@ My field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb ) has some fixes for compatibility with old YAML modules, mostly done by imitating Joey's code in IkiWiki::Setup::Yaml. Please consider merging :-) --[[smcv]] + +> I would if I could *find* it. I checked out the "field-etc" branch, but I can't find the plugins in question under IkiWiki/Plugin; am I looking in the wrong place, or what? +> --[[KathrynAndersen]] -- cgit v1.2.3 From 06f58b1b888a6cea1a9a5cce9e098428f0adab75 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 6 Apr 2010 04:00:47 +0000 Subject: response --- doc/plugins/contrib/field/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index c2b75a76d..af5bfd6c9 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -92,3 +92,5 @@ you separated out `ymlfront`. Trivial patch available from field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: ) --[[smcv]] + +> Can do for the field plugin (delete one line? Easy.) Will push when I get to a better connection. --[[KathrynAndersen]] -- cgit v1.2.3 From 2efec70c7e55f9426d7051ffebc6c1eb55afb16b Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 6 Apr 2010 10:47:28 +0000 Subject: oops, branch returned now --- doc/plugins/contrib/ymlfront/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index ce3b2b483..3ad02af29 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -5,3 +5,7 @@ Joey's code in IkiWiki::Setup::Yaml. Please consider merging :-) --[[smcv]] > I would if I could *find* it. I checked out the "field-etc" branch, but I can't find the plugins in question under IkiWiki/Plugin; am I looking in the wrong place, or what? > --[[KathrynAndersen]] + +>> Sorry, I accidentally removed `field-etc` by pushing with `--mirror` from a +>> different checkout. I've put it back; it's a branch from your `ikiplugins.git`, +>> so yes, the code should be in `IkiWiki/Plugin`. --[[smcv]] -- cgit v1.2.3 From 089a7faff8defe98ffc593702be93f8f35d2153a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Apr 2010 13:25:26 -0400 Subject: first question --- doc/plugins/contrib/field/discussion.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index af5bfd6c9..646a5f3f4 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -94,3 +94,18 @@ field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: --[[smcv]] > Can do for the field plugin (delete one line? Easy.) Will push when I get to a better connection. --[[KathrynAndersen]] + +---- + +Disclaimer: I've only looked at this plugin and ymlfront, not other related +stuff yet. (I quite like ymlfront, so I looked at this as its dependency. :) +I also don't want to annoy you with a lot of design discussion +if your main goal was to write a plugin that did exactly what you wanted. + +My first question is: Why we need another plugin storing metadata +about the page, when we already have the meta plugin? Much of the +complication around the field plugin has to do with it accessing info +belonging to the meta plugin, and generalizing that to be able to access +info stored by other plugins too. (But I don't see any other plugins that +currently store such info). Then too, it raises points of confusion like +smcv's discuission of field author vs meta author above. --[[Joey]] -- cgit v1.2.3 From 6fd59908ba8f6999f63c94c918f8c309ed108f74 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Apr 2010 14:06:29 -0400 Subject: comment --- doc/plugins/contrib/pod/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/pod/discussion.mdwn b/doc/plugins/contrib/pod/discussion.mdwn index 76e858680..9187b1350 100644 --- a/doc/plugins/contrib/pod/discussion.mdwn +++ b/doc/plugins/contrib/pod/discussion.mdwn @@ -8,3 +8,7 @@ supports, or later support latex, that could be problimatic since that could maybe be used to include files or run code. --[[Joey]] > I don't know, either; the documentation for [[!cpan Pod:Xhtml]] is silent on this subject. --[[KathrynAndersen]] + +>> I'm afraid the only approach is to audit the existing code in the perl +>> module(s), and then hope nothing is added to them later that opens a +>> security hole. --[[Joey]] -- cgit v1.2.3 From 121405e8aa80e7ceb5283b0ff8c9865458a6dd52 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 6 Apr 2010 23:09:59 +0000 Subject: response to Joey and smcv --- doc/plugins/contrib/field/discussion.mdwn | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 646a5f3f4..b243e2dfe 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -21,7 +21,9 @@ behaviour, an auxiliary plugin would be easy.) >> (like `map`). Is your plan that `meta` should register itself by >> default, and `map` and friends should be adapted to >> work based on `getfield()` instead of `$pagestate{foo}{meta}`, then? ->> + +>>> Based on `field_get_value()`, yes. That would be my ideal. Do you think I should implement that as an ikiwiki branch? --[[KathrynAndersen]] + >> (On the site I mentioned, I'm using an unmodified version of `field`, >> and currently working around the collision by tagging books' pages >> with `bookauthor` instead of `author` in the YAML.) --s @@ -94,6 +96,7 @@ field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: --[[smcv]] > Can do for the field plugin (delete one line? Easy.) Will push when I get to a better connection. --[[KathrynAndersen]] +>> Done! -K.A. ---- @@ -109,3 +112,16 @@ belonging to the meta plugin, and generalizing that to be able to access info stored by other plugins too. (But I don't see any other plugins that currently store such info). Then too, it raises points of confusion like smcv's discuission of field author vs meta author above. --[[Joey]] + +> The point is exactly in the generalization, to provide a uniform interface for accessing structured data, no matter what the source of it, whether that be the meta plugin or some other plugin. + +> There were a few reasons for this: + +>1. In converting my site over from PmWiki, I needed something that was equivalent to PmWiki's Page-Text-Variables (which is how PmWiki implements structured data). +>2. I also wanted an equivalent of PmWiki's Page-Variables, which, rather than being simple variables, are the return-value of a function. This gives one a lot of power, because one can do calculations, derive one thing from another. Heck, just being able to have a "basename" variable is useful. +>3. I noticed that in the discussion about structured data, it was mired down in disagreements about what form the structured data should take; I wanted to overcome that hurdle by decoupling the form from the content. +>4. I actually use this to solve (1), because, while I do use ymlfront, initially my pages were in PmWiki format (I wrote (another) unreleased plugin which parses PmWiki format) including PmWiki's Page-Text-Variables for structured data. So I needed something that could deal with multiple formats. + +> So, yes, it does cater to mostly my personal needs, but I think it is more generally useful, also. +> --[[KathrynAndersen]] + -- cgit v1.2.3 From 1158fe8f4400943d7a24350c6ac8fee6a95c2bed Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 7 Apr 2010 02:55:50 +0000 Subject: further discussion, point out potential XSS --- doc/plugins/contrib/field/discussion.mdwn | 110 ++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index b243e2dfe..16b40cf06 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -24,10 +24,64 @@ behaviour, an auxiliary plugin would be easy.) >>> Based on `field_get_value()`, yes. That would be my ideal. Do you think I should implement that as an ikiwiki branch? --[[KathrynAndersen]] +>>>> This doesn't solve cases where certain fields are treated specially; for +>>>> instance, putting a `\[[!meta permalink]]` on a page is not the same as +>>>> putting it in `ymlfront` (in the latter case you won't get your +>>>> `` header), and putting `\[[!meta date]]` is not the same as putting +>>>> `date` in `ymlfront` (in the latter case, `%pagectime` won't be changed). +>>>> +>>>> One way to resolve that would be to have `ymlfront`, or similar, be a +>>>> front-end for `meta` rather than for `field`, and call +>>>> `IkiWiki::Plugin::meta::preprocess` (or a refactored-out function that's +>>>> similar). +>>>> +>>>> There are also some cross-site scripting issues (see below)... --[[smcv]] + >> (On the site I mentioned, I'm using an unmodified version of `field`, >> and currently working around the collision by tagging books' pages >> with `bookauthor` instead of `author` in the YAML.) --s +>> Revisiting this after more thought, the problem here is similar to the +>> possibility that a wiki user adds a `meta` shortcut +>> to [[shortcuts]], or conversely, that a plugin adds a `cpan` directive +>> that conflicts with the `cpan` shortcut that pages already use. (In the +>> case of shortcuts, this is resolved by having plugin-defined directives +>> always win.) For plugin-defined meta keywords this is the plugin +>> author's/wiki admin's problem - just don't enable conflicting plugins! - +>> but it gets scary when you start introducing things like `ymlfront`, which +>> allow arbitrary, wiki-user-defined fields, even ones that subvert +>> other plugins' assumptions. +>> +>> The `pagetemplate` hook is particularly alarming because page templates are +>> evaluated in many contexts, not all of which are subject to the +>> htmlscrubber or escaping; because the output from `field` isn't filtered, +>> prefixed or delimited, when combined with an arbitrary-key-setting plugin +>> like `ymlfront` it can interfere with other plugins' expectations +>> and potentially cause cross-site scripting exploits. For instance, `inline` +>> has a `pagetemplate` hook which defines the `FEEDLINKS` template variable +>> to be a blob of HTML to put in the `` of the page. As a result, this +>> YAML would be bad: +>> +>> --- +>> FEEDLINKS: +>> --- +>> +>> (It might require a different case combination due to implementation +>> details, I'm not sure.) +>> +>> It's difficult for `field` to do anything about this, because it doesn't +>> know whether a field is meant to be plain text, HTML, a URL, or something +>> else. +>> +>> If `field`'s `pagetemplate` hook did something more limiting - like +>> only emitting template variables starting with `field_`, or from some +>> finite set, or something - then this would cease to be a problem, I think? +>> +>> `ftemplate` and `getfield` don't have this problem, as far as I can see, +>> because their output is in contexts where the user could equally well have +>> written raw HTML directly; the user can cause themselves confusion, but +>> can't cause harmful output. --[[smcv]] + From a coding style point of view, the `$CamelCase` variable names aren't IkiWiki style, and the `match_foo` functions look as though they could benefit from being thin wrappers around a common `&IkiWiki::Plugin::field::match` @@ -125,3 +179,59 @@ smcv's discuission of field author vs meta author above. --[[Joey]] > So, yes, it does cater to mostly my personal needs, but I think it is more generally useful, also. > --[[KathrynAndersen]] +>> Is it fair to say, then, that `field`'s purpose is to take other +>> plugins' arbitrary per-page data, and present it as a single +>> merged/flattened string => string map per page? From the plugins +>> here, things you then use that merged map for include: +>> +>> * sorting - stolen by [[todo/allow_plugins_to_add_sorting_methods]] +>> * substitution into pages with Perl-like syntax - `getfield` +>> * substitution into wiki-defined templates - the `pagetemplate` +>> hook +>> * substitution into user-defined templates - `ftemplate` +>> +>> As I mentioned above, the flattening can cause collisions (and in the +>> `pagetemplate` case, even security problems). +>> +>> I wonder whether conflating Page Text Variables with Page Variables +>> causes `field` to be more general than it needs to be? +>> To define a Page Variable (function-like field), you need to write +>> a plugin containing that Perl function; if we assume that `field` +>> or something resembling it gets merged into ikiwiki, then it's +>> reasonable to expect third-party plugins to integrate with whatever +>> scaffolding there is for these (either in an enabled-by-default +>> plugin that most people are expected to leave enabled, like `meta` +>> now, or in the core), and it doesn't seem onerous to expect each +>> plugin that wants to participate in this mechanism to have code to +>> do so. While it's still contrib, `field` could just have a special case +>> for the meta plugin, rather than the converse? +>> +>> If Page Text Variables are limited to being simple strings as you +>> suggest over in [[forum/an_alternative_approach_to_structured_data]], +>> then they're functionally similar to `meta` fields, so one way to +>> get their functionality would be to extend `meta` so that +>> +>> \[[!meta badger="mushroom"]] +>> +>> (for an unrecognised keyword `badger`) would store +>> `$pagestate{$page}{meta}{badger} = "mushroom"`? Getting this to +>> appear in templates might be problematic, because a naive +>> `pagetemplate` hook would have the same problem that `field` combined +>> with `ymlfront` currently does. +>> +>> One disadvantage that would appear if the function-like and +>> meta-like fields weren't in the same namespace would be that it +>> wouldn't be possible to switch a field from being meta-like to being +>> function-like without changing any wiki content that referenced it. +>> +>> Perhaps meta-like fields should just *be* `meta` (with the above +>> enhancement), as a trivial case of function-like fields? That would +>> turn `ymlfront` into an alternative syntax for `meta`, I think? +>> That, in turn, would hopefully solve the special-fields problem, +>> by just delegating it to meta. I've been glad of the ability to define +>> new ad-hoc fields with this plugin without having to write an extra plugin +>> to do so (listing books with a `bookauthor` and sorting them by +>> `"field(bookauthor) title"`), but that'd be just as easy if `meta` +>> accepted ad-hoc fields? +>> +>> --[[smcv]] -- cgit v1.2.3 From 3b1dd03c7e7f56eaf6da956779c885c2e9e7ef53 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Apr 2010 22:57:02 -0400 Subject: improve wording to not encourage explicitly passing undef --- doc/plugins/write.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index fe7cf0183..71ff1fd29 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -960,8 +960,8 @@ will yield something like `foo/feed.rss`. This adds a link to `%links`, ensuring that duplicate links are not added. Pass it the page that contains the link, and the link text. -An optional third parameter sets the link type (`undef` produces an ordinary -[[ikiwiki/WikiLink]]). +An optional third parameter sets the link type. If not specified, +it is an ordinary [[ikiwiki/WikiLink]]. ## Miscellaneous -- cgit v1.2.3 From e12cd5f293fea9d85c7e4cdc86e2bf9381d5676a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 7 Apr 2010 03:03:40 +0000 Subject: update fieldsort plugin again; remove obsolete bug + fix note (thanks!) --- doc/plugins/contrib/field/discussion.mdwn | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 16b40cf06..2ea195e5b 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -131,8 +131,8 @@ I think it should just be part of `field` rather than a separate plugin. error("sort=field requires a parameter"); } - my $left = IkiWiki::Plugin::field::field_get_value($_[2], $_[0]); - my $right = IkiWiki::Plugin::field::field_get_value($_[2], $_[1]); + my $left = IkiWiki::Plugin::field::field_get_value($_[0], $a); + my $right = IkiWiki::Plugin::field::field_get_value($_[0], $b); $left = "" unless defined $left; $right = "" unless defined $right; @@ -141,17 +141,6 @@ I think it should just be part of `field` rather than a separate plugin. 1; -------- - -Bug report: `field` has an unnecessary `use YAML::Any`, presumably from before -you separated out `ymlfront`. Trivial patch available from -field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: -) ---[[smcv]] - -> Can do for the field plugin (delete one line? Easy.) Will push when I get to a better connection. --[[KathrynAndersen]] ->> Done! -K.A. - ---- Disclaimer: I've only looked at this plugin and ymlfront, not other related -- cgit v1.2.3 From be2af2e5c1ddfe90802a67aa150cf17dbe903df0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Apr 2010 23:19:00 -0400 Subject: add cpan link --- doc/plugins/sortnaturally.mdwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/sortnaturally.mdwn b/doc/plugins/sortnaturally.mdwn index 91f373f6b..a16381946 100644 --- a/doc/plugins/sortnaturally.mdwn +++ b/doc/plugins/sortnaturally.mdwn @@ -1,5 +1,6 @@ [[!template id=plugin name=sortnaturally core=1 author="[[chrysn]], [[smcv]]"]] [[!tag type/meta]] -This plugin provides the `title_natural` [[ikiwiki/pagespec/sorting]] order, -which uses Sort::Naturally to sort numbered pages in a more natural order. +This plugin provides the `title_natural` [[ikiwiki/pagespec/sorting]] +order, which uses [[!cpan Sort::Naturally]] to sort numbered pages in a +more natural order. -- cgit v1.2.3 From d58444a3e956e329cea4cbcdddcba99664ee585e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Apr 2010 00:01:38 -0400 Subject: note about sort and dependency types There's a gotcha where pagespec_match_list is used with a dependency type that is not a full content dependency, and so ikiwiki does not know that a content change to a page that sorted too low to match needs to trigger a rebuild, since its sort order may have changed. Inline is mostly ok re this, as it does use content dependencies. Except for in the case of raw mode. But then, page metadata is documented to not be loaded, so it doesn't make sense to use sortspecs that depend on metadata. I hope. :) --- doc/plugins/write.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 05ddf2215..707622956 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -734,7 +734,10 @@ Additional named parameters can be specified: * `filter` is a reference to a function, that is called and passed a page, and returns true if the page should be filtered out of the list. * `sort` specifies a sort order for the list. See - [[ikiwiki/PageSpec/sorting]] for the avilable sort methods. + [[ikiwiki/PageSpec/sorting]] for the avilable sort methods. Note that + if a sort method is specified that depends on the + page content (such as 'meta(foo)'), the deptype needs to be set to + a content dependency. * `reverse` if true, sorts in reverse. * `num` if nonzero, specifies the maximum number of matching pages that will be returned. -- cgit v1.2.3 From 2e9fae5c11d9fabf6270de18d0c26bc251750b09 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 7 Apr 2010 15:12:39 +0000 Subject: response about XSS, meta and pagetemplates --- doc/plugins/contrib/field/discussion.mdwn | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 2ea195e5b..dd9342224 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -224,3 +224,32 @@ smcv's discuission of field author vs meta author above. --[[Joey]] >> accepted ad-hoc fields? >> >> --[[smcv]] + +>>> Your point above about cross-site scripting is a valid one, and something I +>>> hadn't thought of (oops). + +>>> I still want to be able to populate pagetemplate templates with field, because I +>>> use it for a number of things, such as setting which CSS files to use for a +>>> given page, and, as I said, for titles. But apart from the titles, I +>>> realize I've been setting them in places other than the page data itself. +>>> (Another unreleased plugin, `concon`, uses Config::Context to be able to +>>> set variables on a per-site, per-directory and a per-page basis). + +>>> The first possible solution is what you suggested above: for field to only +>>> set values in pagetemplate which are prefixed with *field_*. I don't think +>>> this is quite satisfactory, since that would still mean that people could +>>> put un-scrubbed values into a pagetemplate, albeit they would be values +>>> named field_foo, etc. + +>>> An alternative solution would be to classify field registration as "secure" +>>> and "insecure". Sources such as ymlfront would be insecure, sources such +>>> as concon (or the $config hash) would be secure, since they can't be edited +>>> as pages. Then, when doing pagetemplate substitution (but not ftemplate +>>> substitution) the insecure sources could be HTML-escaped. + +>>> Another problem, as you point out, is special-case fields, such as a number of +>>> those defined by `meta`, which have side-effects associated with them, more +>>> than just providing a value to pagetemplate. Perhaps `meta` should deal with +>>> the side-effects, but use `field` as an interface to get the values of those special fields. + +>>> --[[KathrynAndersen]] -- cgit v1.2.3 From e46a3b753463e71d8a24c35a5035cfbc47dd4816 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 7 Apr 2010 17:39:04 +0000 Subject: "safe" and "unsafe" too simplistic, I suspect --- doc/plugins/contrib/field/discussion.mdwn | 49 ++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index dd9342224..24c37cc4c 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -239,13 +239,60 @@ smcv's discuission of field author vs meta author above. --[[Joey]] >>> set values in pagetemplate which are prefixed with *field_*. I don't think >>> this is quite satisfactory, since that would still mean that people could >>> put un-scrubbed values into a pagetemplate, albeit they would be values ->>> named field_foo, etc. +>>> named field_foo, etc. --[[KathrynAndersen]] + +>>>> They can already do similar; `PERMALINK` is pre-sanitized to +>>>> ensure that it's a "safe" URL, but if an extremely confused wiki admin was +>>>> to put `COPYRIGHT` in their RSS/Atom feed's ``, a malicious user +>>>> could put an unsafe (e.g. Javascript) URL in there (`COPYRIGHT` *is* +>>>> HTML-scrubbed, but "javascript:alert('pwned!')" is just text as far as a +>>>> HTML sanitizer is concerned, so it passes straight through). The solution +>>>> is to not use variables in situations where that variable would be +>>>> inappropriate. Because `field` is so generic, the definition of what's +>>>> appropriate is difficult. --[[smcv]] >>> An alternative solution would be to classify field registration as "secure" >>> and "insecure". Sources such as ymlfront would be insecure, sources such >>> as concon (or the $config hash) would be secure, since they can't be edited >>> as pages. Then, when doing pagetemplate substitution (but not ftemplate >>> substitution) the insecure sources could be HTML-escaped. +>>> --[[KathrynAndersen]] + +>>>> Whether you trust the supplier of data seems orthogonal to whether its value +>>>> is (meant to be) interpreted as plain text, HTML, a URL or what? +>>>> +>>>> Even in cases where you trust the supplier, you need to escape things +>>>> suitably for the context, not for security but for correctness. The +>>>> definition of the value, and the context it's being used in, changes the +>>>> processing you need to do. An incomplete list: +>>>> +>>>> * HTML used as HTML needs to be html-scrubbed if and only if untrusted +>>>> * URLs used as URLs need to be put through `safeurl()` if and only if +>>>> untrusted +>>>> * HTML used as plain text needs tags removed regardless +>>>> * URLs used as plain text are safe +>>>> * URLs or plain text used in HTML need HTML-escaping (and URLs also need +>>>> `safeurl()` if untrusted) +>>>> * HTML or plain text used in URLs need URL-escaping (and the resulting +>>>> URL might need sanitizing too?) +>>>> +>>>> I can't immediately think of other data types we'd be interested in beyond +>>>> text, HTML and URL, but I'm sure there are plenty. +>>>> +>>>> One reasonable option would be to declare that `field` takes text-valued +>>>> fields, in which case either consumers need to escape +>>>> it with ``, and not interpret it as a URL +>>>> without first checking `safeurl`), or the pagetemplate hook needs to +>>>> pre-escape. +>>>> +>>>> Another reasonable option would be to declare that `field` takes raw HTML, +>>>> in which case consumers need to only use it in contexts that will be +>>>> HTML-scrubbed (but it becomes unsuitable for using as text - problematic +>>>> for text-based things like sorting or URLs, and not ideal for searching). +>>>> +>>>> You could even let each consumer choose how it's going to use the field, +>>>> by having the `foo` field generate `TEXT_FOO` and `HTML_FOO` variables? +>>>> --[[smcv]] >>> Another problem, as you point out, is special-case fields, such as a number of >>> those defined by `meta`, which have side-effects associated with them, more -- cgit v1.2.3 From 15a65ffae67b7eaf2702b3a42edee95daf8f4c89 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 7 Apr 2010 23:29:25 +0000 Subject: further response to smcv on pagetemplates --- doc/plugins/contrib/field/discussion.mdwn | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 24c37cc4c..36c2118e7 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -278,13 +278,34 @@ smcv's discuission of field author vs meta author above. --[[Joey]] >>>> >>>> I can't immediately think of other data types we'd be interested in beyond >>>> text, HTML and URL, but I'm sure there are plenty. ->>>> + +>>>>> But isn't this a problem with anything that uses pagetemplates? Or is +>>>>> the point that, with plugins other than `field`, they all know, +>>>>> beforehand, the names of all the fields that they are dealing with, and +>>>>> thus the writer of the plugin knows which treatment each particular field +>>>>> needs? For example, that `meta` knows that `title` needs to be +>>>>> HTML-escaped, and that `baseurl` doesn't. In that case, yes, I see the problem. +>>>>> It's a tricky one. It isn't as if there's only ever going to be a fixed set of fields that need different treatment, either. Because the site admin is free to add whatever fields they like to the page template (if they aren't using the default one, that is. I'm not using the default one myself). +>>>>> Mind you, for trusted sources, since the person writing the page template and the person providing the variable are the same, they themselves would know whether the value will be treated as HTML, plain text, or a URL, and thus could do the needed escaping themselves when writing down the value. + +>>>>> Looking at the content of the default `page.tmpl` let's see what variables fall into which categories: +>>>>> * Used as URL: BASEURL, EDITURL, PARENTLINKS->URL, RECENTCHANGESURL, HISTORYURL, GETSOURCEURL, PREFSURL, OTHERLANGUAGES->URL, ADDCOMMENTURL, BACKLINKS->URL, MORE_BACKLINKS->URL +>>>>> * Used as part of a URL: FAVICON, LOCAL_CSS +>>>>> * Needs to be HTML-escaped: TITLE +>>>>> * Used as-is (as HTML): FEEDLINKS, RELVCS, META, PERCENTTRANSLATED, SEARCHFORM, COMMENTSLINK, DISCUSSIONLINK, OTHERLANGUAGES->PERCENT, SIDEBAR, CONTENT, COMMENTS, TAGS->LINK, COPYRIGHT, LICENSE, MTIME, EXTRAFOOTER + +>>>>> This looks as if only TITLE needs HTML-escaping all the time, and that the URLS all end with "URL" in their name. Unfortunately the FAVICON and LOCAL_CSS which are part of URLS don't have "URL" in their name, though that's fair enough, since they aren't full URLs. + +>>>>> --K.A. + >>>> One reasonable option would be to declare that `field` takes text-valued >>>> fields, in which case either consumers need to escape >>>> it with ``, and not interpret it as a URL >>>> without first checking `safeurl`), or the pagetemplate hook needs to >>>> pre-escape. ->>>> + +>>>>> Since HTML::Template does have the ability to do ESCAPE=HTML/URL/JS, why not take advantage of that? Some things, like TITLE, probably should have ESCAPE=HTML all the time; that would solve the "to escape or not to escape" problem that `meta` has with titles. After all, when one *sorts* by title, one doesn't really want HTML-escaping in it; only when one uses it in a template. -- K.A. + >>>> Another reasonable option would be to declare that `field` takes raw HTML, >>>> in which case consumers need to only use it in contexts that will be >>>> HTML-scrubbed (but it becomes unsuitable for using as text - problematic @@ -294,6 +315,8 @@ smcv's discuission of field author vs meta author above. --[[Joey]] >>>> by having the `foo` field generate `TEXT_FOO` and `HTML_FOO` variables? >>>> --[[smcv]] +>>>>> Something similar is already done in `template` and `ftemplate` with the `raw_` prefix, which determines whether the variable should have `htmlize` run over it first before the value is applied to the template. Of course, that isn't scrubbing or escaping, because with those templates, the scrubbing is done afterwards as part of the normal processing. + >>> Another problem, as you point out, is special-case fields, such as a number of >>> those defined by `meta`, which have side-effects associated with them, more >>> than just providing a value to pagetemplate. Perhaps `meta` should deal with -- cgit v1.2.3 From ce9cf967d01eb8e112c19d9f7b1c9a727717ef30 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 7 Apr 2010 23:33:04 +0000 Subject: formatting --- doc/plugins/contrib/field/discussion.mdwn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 36c2118e7..103e061e5 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -289,10 +289,11 @@ smcv's discuission of field author vs meta author above. --[[Joey]] >>>>> Mind you, for trusted sources, since the person writing the page template and the person providing the variable are the same, they themselves would know whether the value will be treated as HTML, plain text, or a URL, and thus could do the needed escaping themselves when writing down the value. >>>>> Looking at the content of the default `page.tmpl` let's see what variables fall into which categories: ->>>>> * Used as URL: BASEURL, EDITURL, PARENTLINKS->URL, RECENTCHANGESURL, HISTORYURL, GETSOURCEURL, PREFSURL, OTHERLANGUAGES->URL, ADDCOMMENTURL, BACKLINKS->URL, MORE_BACKLINKS->URL ->>>>> * Used as part of a URL: FAVICON, LOCAL_CSS ->>>>> * Needs to be HTML-escaped: TITLE ->>>>> * Used as-is (as HTML): FEEDLINKS, RELVCS, META, PERCENTTRANSLATED, SEARCHFORM, COMMENTSLINK, DISCUSSIONLINK, OTHERLANGUAGES->PERCENT, SIDEBAR, CONTENT, COMMENTS, TAGS->LINK, COPYRIGHT, LICENSE, MTIME, EXTRAFOOTER + +>>>>> * **Used as URL:** BASEURL, EDITURL, PARENTLINKS->URL, RECENTCHANGESURL, HISTORYURL, GETSOURCEURL, PREFSURL, OTHERLANGUAGES->URL, ADDCOMMENTURL, BACKLINKS->URL, MORE_BACKLINKS->URL +>>>>> * **Used as part of a URL:** FAVICON, LOCAL_CSS +>>>>> * **Needs to be HTML-escaped:** TITLE +>>>>> * **Used as-is (as HTML):** FEEDLINKS, RELVCS, META, PERCENTTRANSLATED, SEARCHFORM, COMMENTSLINK, DISCUSSIONLINK, OTHERLANGUAGES->PERCENT, SIDEBAR, CONTENT, COMMENTS, TAGS->LINK, COPYRIGHT, LICENSE, MTIME, EXTRAFOOTER >>>>> This looks as if only TITLE needs HTML-escaping all the time, and that the URLS all end with "URL" in their name. Unfortunately the FAVICON and LOCAL_CSS which are part of URLS don't have "URL" in their name, though that's fair enough, since they aren't full URLs. -- cgit v1.2.3 From 358fa953e189d6f8a7925be8533fe7b7c5699503 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 16:40:01 -0400 Subject: sidebar: Now a sidebar directive can be used to override the sidebar shown on a page. --- IkiWiki/Plugin/sidebar.pm | 42 +++++++++++++++++++++++++++++++++++++- debian/changelog | 2 ++ doc/ikiwiki/directive/sidebar.mdwn | 14 +++++++++++++ doc/plugins/sidebar.mdwn | 17 +++++++-------- 4 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 doc/ikiwiki/directive/sidebar.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 41812e1c1..d63cb5246 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -10,6 +10,7 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "sidebar", call => \&getsetup); + hook(type => "preprocess", id => "sidebar", call => \&preprocess); hook(type => "pagetemplate", id => "sidebar", call => \&pagetemplate); } @@ -21,9 +22,39 @@ sub getsetup () { }, } +my %pagesidebar; + +sub preprocess (@) { + my %params=@_; + my $content=shift; + shift; + + if (! defined $content) { + error(gettext("sidebar content not specified")); + } + + my $page=$params{page}; + return "" unless $page eq $params{destpage}; + my $file = $pagesources{$page}; + my $type = pagetype($file); + + $pagesidebar{$page}= + IkiWiki::htmlize($page, $page, $type, + IkiWiki::linkify($page, $page, + IkiWiki::preprocess($page, $page, + IkiWiki::filter($page, $page, $content)))); + + return ""; +} + +my $oldfile; +my $oldcontent; + sub sidebar_content ($) { my $page=shift; + return $pagesidebar{$page} if exists $pagesidebar{$page}; + my $sidebar_page=bestlink($page, "sidebar") || return; my $sidebar_file=$pagesources{$sidebar_page} || return; my $sidebar_type=pagetype($sidebar_file); @@ -34,7 +65,16 @@ sub sidebar_content ($) { # currently requires a wiki rebuild. add_depends($page, $sidebar_page); - my $content=readfile(srcfile($sidebar_file)); + my $content; + if (defined $oldfile && $sidebar_file eq $oldfile) { + $content=$oldcontent; + } + else { + $content=readfile(srcfile($sidebar_file)); + $oldcontent=$content; + $oldfile=$sidebar_file; + } + return unless length $content; return IkiWiki::htmlize($sidebar_page, $page, $sidebar_type, IkiWiki::linkify($sidebar_page, $page, diff --git a/debian/changelog b/debian/changelog index 03361e6a0..267a2fd7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,8 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low in a tag cloud. This is useful to put in a sidebar. * Rework example blog front page. * CSS and templates for sidebar changed to use a class, not an id. + * sidebar: Now a sidebar directive can be used to override the sidebar + shown on a page. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/ikiwiki/directive/sidebar.mdwn b/doc/ikiwiki/directive/sidebar.mdwn new file mode 100644 index 000000000..46f016747 --- /dev/null +++ b/doc/ikiwiki/directive/sidebar.mdwn @@ -0,0 +1,14 @@ +The `sidebar` directive is supplied by the [[!iki plugins/sidebar desc=sidebar]] plugin. + +This directive specifies a custom sidebar to display on the page, instead +of any sidebar that is displayed globally. + +## examples + + \[[!sidebar """ + This is my custom sidebar for this page. + + \[[!calendar pages="posts/*"]] + """]] + +[[!meta robots="noindex, follow"]] diff --git a/doc/plugins/sidebar.mdwn b/doc/plugins/sidebar.mdwn index 4e356d65a..cd0f0ecf1 100644 --- a/doc/plugins/sidebar.mdwn +++ b/doc/plugins/sidebar.mdwn @@ -10,15 +10,16 @@ Typically this will be a page in the root of the wiki, but it can also be a [[plugins/sidebar|plugins/sidebar]], will be treated as a sidebar for the [[plugins]] page, and of all of its SubPages, if the plugin is enabled. -Note that to disable a sidebar for a [[ikiwiki/SubPage]] of a page that has -a sidebar, you can create a sidebar page that is completely empty. This -will turn off the sidebar altogether. +There is also a [[ikiwiki/directive/sidebar]] directive that can be used +to provide a custom sidebar content for a page. -Warning: Any change to the sidebar will cause a rebuild of the whole wiki, -since every page includes a copy that has to be updated. This can -especially be a problem if the sidebar includes an [[ikiwiki/directive/inline]] -directive, since any changes to pages inlined into the sidebar -will change the sidebar and cause a full wiki rebuild. +---- + +Warning: Any change to the sidebar page will cause a rebuild of the whole +wiki, since every page includes a copy that has to be updated. This can +especially be a problem if the sidebar includes an +[[ikiwiki/directive/inline]] directive, since any changes to pages inlined +into the sidebar will change the sidebar and cause a full wiki rebuild. Instead, if you include a [[ikiwiki/directive/map]] directive on the sidebar, and it does not use the `show` parameter, only adding or removing pages -- cgit v1.2.3 From 1f7175e891f87c350decc1ec821bebb5adc22c2a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 17:31:50 -0400 Subject: sidebar: Add global_sidebars setting. --- IkiWiki/Plugin/sidebar.pm | 9 +++++++++ debian/changelog | 1 + doc/ikiwiki/directive/sidebar.mdwn | 4 ++-- doc/plugins/sidebar.mdwn | 8 +++++--- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index d63cb5246..1b302dcf9 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -20,6 +20,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + global_sidebars => { + type => "boolean", + examples => 1, + description => "show sidebar page on all pages?" + safe => 1, + rebuild => 1, + }, } my %pagesidebar; @@ -55,6 +62,8 @@ sub sidebar_content ($) { return $pagesidebar{$page} if exists $pagesidebar{$page}; + return if defined $config{global_sidebars} && !$config{global_sidebars}; + my $sidebar_page=bestlink($page, "sidebar") || return; my $sidebar_file=$pagesources{$sidebar_page} || return; my $sidebar_type=pagetype($sidebar_file); diff --git a/debian/changelog b/debian/changelog index af19f4a00..c379253d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * sidebar: Now a sidebar directive can be used to override the sidebar shown on a page. * Enable calendar and sidebar in auto-blog.setup. + * sidebar: Add global_sidebars setting. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/ikiwiki/directive/sidebar.mdwn b/doc/ikiwiki/directive/sidebar.mdwn index 46f016747..34f078672 100644 --- a/doc/ikiwiki/directive/sidebar.mdwn +++ b/doc/ikiwiki/directive/sidebar.mdwn @@ -1,7 +1,7 @@ The `sidebar` directive is supplied by the [[!iki plugins/sidebar desc=sidebar]] plugin. -This directive specifies a custom sidebar to display on the page, instead -of any sidebar that is displayed globally. +This directive specifies a custom sidebar to display on the page, +overriding any sidebar that is displayed globally. ## examples diff --git a/doc/plugins/sidebar.mdwn b/doc/plugins/sidebar.mdwn index cd0f0ecf1..012733456 100644 --- a/doc/plugins/sidebar.mdwn +++ b/doc/plugins/sidebar.mdwn @@ -1,9 +1,11 @@ [[!template id=plugin name=sidebar author="Tuomo Valkonen"]] [[!tag type/chrome]] -If this plugin is enabled, then a sidebar is added to pages in the wiki. -The content of the sidebar is simply the content of a page named -"sidebar" (ie, create a "sidebar.mdwn"). +This plugin allows adding a sidebar to pages in the wiki. + +By default, and unless the `global_sidebars` setting is turned off, +a sidebar is added to all pages in the wiki. The content of the sidebar +is simply the content of a page named "sidebar" (ie, create a "sidebar.mdwn"). Typically this will be a page in the root of the wiki, but it can also be a [[ikiwiki/SubPage]]. In fact, this page, -- cgit v1.2.3 From 142e025ae471c91e68a23476f700df0b8ad6b31d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 20:12:03 -0400 Subject: calendar: Improved display of arrows. --- IkiWiki/Plugin/calendar.pm | 21 +++++++++++---------- debian/changelog | 1 + doc/plugins/calendar.mdwn | 2 ++ doc/style.css | 8 ++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 0f0e9518a..aeb5f3d29 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -164,11 +164,11 @@ sub format_month (@) { # Start producing the month calendar $calendar=< - - $purl - $url - $nurl - + + $purl + $url + $nurl + EOF @@ -312,13 +312,14 @@ sub format_year (@) { add_depends($params{page}, "$archivebase/$nyear", deptype("presence")); # Start producing the year calendar + my $m=$params{months_per_row}-2; $calendar=< - - $purl - $url - $nurl - + + $purl + $url + $nurl + Months diff --git a/debian/changelog b/debian/changelog index e4056fdc6..737d73655 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * sidebar: Add global_sidebars setting. * conditional: Fix bug that forced "all" mode off by default. * calendarmonth.tmpl: The month calendar is now put in a sidebar. + * calendar: Improved display of arrows. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn index 49fd90627..76e718a3b 100644 --- a/doc/plugins/calendar.mdwn +++ b/doc/plugins/calendar.mdwn @@ -14,6 +14,7 @@ customization. * `month-calendar` - The month calendar as a whole. * `month-calendar-head` - The head of the month calendar (ie,"March"). +* `month-calendar-arrow` - Arrow pointing to previous/next month. * `month-calendar-day-head` - A column head in the month calendar (ie, a day-of-week abbreviation). * `month-calendar-day-noday`, `month-calendar-day-link`, @@ -27,6 +28,7 @@ customization. weekends. * `year-calendar` - The year calendar as a whole. * `year-calendar-head` - The head of the year calendar (ie, "2007"). +* `year-calendar-arrow` - Arrow pointing to previous/next year. * `year-calendar-subhead` - For example, "Months". * `year-calendar-month-link`, `year-calendar-month-nolink`, `year-calendar-month-future`, `year-calendar-this-month` - The month diff --git a/doc/style.css b/doc/style.css index 44e06ae4f..7ffcf9fe2 100644 --- a/doc/style.css +++ b/doc/style.css @@ -431,3 +431,11 @@ pre.hl { color:#000000; background-color:#ffffff; } /* For the calendar plugin. */ .month-calendar-day-this-day { background-color: #eee; } .year-calendar-this-month { background-color: #eee; } +.month-calendar-arrow A:link, +.year-calendar-arrow A:link, +.month-calendar-arrow A:visited, +.year-calendar-arrow A:visited { + text-decoration: none; + font-weight: normal; + font-size: 150%; +} -- cgit v1.2.3 From b14f84c4acccbc8450a9102b3b647013989b27bb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 17:02:29 -0400 Subject: --gettime revamp * Rename --getctime to --gettime. (The old name still works for backwards compatability.) * --gettime now also looks up last modification time. * Add rcs_getmtime to plugin API; currently only implemented for git. --- IkiWiki.pm | 8 +++++-- IkiWiki/Plugin/bzr.pm | 5 +++++ IkiWiki/Plugin/cvs.pm | 5 +++++ IkiWiki/Plugin/darcs.pm | 5 +++++ IkiWiki/Plugin/git.pm | 5 +++++ IkiWiki/Plugin/mercurial.pm | 5 +++++ IkiWiki/Plugin/monotone.pm | 5 +++++ IkiWiki/Plugin/norcs.pm | 7 +++++- IkiWiki/Plugin/svn.pm | 5 +++++ IkiWiki/Plugin/tla.pm | 5 +++++ IkiWiki/Render.pm | 18 +++++++++++++--- debian/changelog | 5 +++++ .../How_does_ikiwiki_remember_times__63__.mdwn | 25 ++++++---------------- ...old_repository_to_new_ikiwiki_system__63__.mdwn | 4 ---- doc/plugins/write.mdwn | 7 ++++++ doc/rcs.mdwn | 8 +++++-- doc/tips/Importing_posts_from_Wordpress.mdwn | 2 +- doc/tips/inside_dot_ikiwiki/discussion.mdwn | 7 +++--- doc/todo/auto_getctime_on_fresh_build.mdwn | 8 +++++-- doc/usage.mdwn | 10 ++++----- ikiwiki.in | 3 ++- mtime-to-git | 14 ------------ 22 files changed, 109 insertions(+), 57 deletions(-) delete mode 100755 mtime-to-git (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 1730e476a..7655dada5 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -440,10 +440,10 @@ sub getsetup () { safe => 0, rebuild => 0, }, - getctime => { + gettime => { type => "internal", default => 0, - description => "running in getctime mode", + description => "running in gettime mode", safe => 0, rebuild => 0, }, @@ -1790,6 +1790,10 @@ sub rcs_getctime ($) { $hooks{rcs}{rcs_getctime}{call}->(@_); } +sub rcs_getmtime ($) { + $hooks{rcs}{rcs_getmtime}{call}->(@_); +} + sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 0efc26b49..f79ca7c8f 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -20,6 +20,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -306,4 +307,8 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for bzr\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 26a3e9dd2..360d97249 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -49,6 +49,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub genwrapper () { @@ -485,4 +486,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for cvs\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index bc8394b90..c1d6661d3 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub silentsystem (@) { @@ -427,4 +428,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for darcs\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index b02f4a5ed..86d80186f 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -25,6 +25,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive); } @@ -634,6 +635,10 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for git\n"; # TODO +} + sub rcs_receive () { # The wiki may not be the only thing in the git repo. # Determine if it is in a subdirectory by examining the srcdir, diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index ea00a3364..34e009c7a 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -20,6 +20,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -254,4 +255,8 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for mercurial\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index c33cf7e3a..67d4abbaa 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -23,6 +23,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -693,4 +694,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for monotone\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/norcs.pm b/IkiWiki/Plugin/norcs.pm index e6a05a3c5..053652a5f 100644 --- a/IkiWiki/Plugin/norcs.pm +++ b/IkiWiki/Plugin/norcs.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub getsetup () { @@ -63,7 +64,11 @@ sub rcs_diff ($) { } sub rcs_getctime ($) { - error gettext("getctime not implemented"); + return 0; +} + +sub rcs_getmtime ($) { + return 0; } 1 diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index 7d27ec842..85c205f09 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -19,6 +19,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -379,4 +380,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for svn\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index 764da9b98..f5ad0cc96 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -284,4 +285,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for tla\n"; # TODO +} + 1 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e98888d76..e1cb68462 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -365,14 +365,26 @@ sub find_new_files ($) { } else { push @new, $file; - if ($config{getctime} && -e "$config{srcdir}/$file") { + if ($config{gettime} && -e "$config{srcdir}/$file") { eval { - my $time=rcs_getctime("$config{srcdir}/$file"); - $pagectime{$page}=$time; + my $ctime=rcs_getctime("$config{srcdir}/$file"); + if ($ctime > 0) { + $pagectime{$page}=$ctime; + } }; if ($@) { print STDERR $@; } + my $mtime; + eval { + my $mtime=rcs_getmtime("$config{srcdir}/$file"); + }; + if ($@) { + print STDERR $@; + } + elsif ($mtime > 0) { + utime($mtime, $mtime, "$config{srcdir}/$file"); + } } } $pagecase{lc $page}=$page; diff --git a/debian/changelog b/debian/changelog index 737d73655..615d5916f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,6 +44,11 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * conditional: Fix bug that forced "all" mode off by default. * calendarmonth.tmpl: The month calendar is now put in a sidebar. * calendar: Improved display of arrows. + * Rename --getctime to --gettime. (The old name still works for + backwards compatability.) + * --gettime now also looks up last modification time. + * Add rcs_getmtime to plugin API; currently only implemented + for git. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn index 6ce576db1..6b7739fd0 100644 --- a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn +++ b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn @@ -20,15 +20,17 @@ Do I have it right? > Some VCS, like git, set the file mtimes to the current time > when making a new checkout, so they will be lost if you do that. > The creation times can be retrived using the `--getctime` option. -> I suppose it might be nice if there were a `--getmtime` that pulled -> true modification times out of the VCS, but I haven't found it a big -> deal in practice for the last modification times to be updated to the -> current time when rebuilding a wiki like this. --[[Joey]] +> --[[Joey]] > > > Thanks for the clarification. I ran some tests of my own to make sure I understand it right, and I'm satisfied > > that the order of posts in my blog can be retrieved from the VCS using the `--getctime` option, at least if I > > choose to order my posts by creation time rather than modification time. But I now know that I can't rely on > > page modification times in ikiwiki as these can be lost permanently. +> +> > > Update: It's now renamed to `--gettime`, and pulls both the creation +> > > and modification times. Also, per [[todo/auto_getctime_on_fresh_build]], +> > > this is now done automatically the first time ikiwiki builds a +> > > srcdir. So, no need to worry about this any more! --[[Joey]] > > > > I would suggest that there should at least be a `--getmtime` option like you describe, and perhaps that > > `--getctime` and `--getmtime` be _on by default_. In my opinion the creation times and modification times of @@ -91,19 +93,6 @@ Do I have it right? > A quick workaround for me to get modification times right is the following > little zsh script, which unfortunately only works for git: - #!/usr/bin/env zsh - - set +x - - for FILE in **/*(.); do - TIMES="`git log --pretty=format:%ai $FILE`" - MTIME="`echo $TIMES | head -n1`" - - if [ ! -z $MTIME ]; then - echo touch -m -d "$MTIME" $FILE - touch -m -d "$MTIME" $FILE - fi - - done +>> Elided; no longer needed since --gettime does that, and much faster! --[[Joey]] > --[[David_Riebenbauer]] diff --git a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn index fe67e6aba..d7a33b526 100644 --- a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn +++ b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn @@ -20,10 +20,6 @@ How do I set up an ikiwiki system using a pre-existing repository (instead of cr > recreate the ikiwiki srcdir > 3. `git clone` from the bare git repository a second time, > to create a checkout you can manually edit (optional) -> 4. run `ikiwiki --getctime --setup your.setup` -> The getctime will ensure page creation times are accurate -> by putting the info out of the git history, -> and only needs to be done once. > > If you preserved your repository, but not the setup file, > the easiest way to make one is probably to run diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 707622956..cf7044b2c 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1085,6 +1085,13 @@ it up in the history. It's ok if this is not implemented, and throws an error. +#### `rcs_getmtime($)` + +This is used to get the page modification time for a file from the RCS, by +looking it up in the history. + +It's ok if this is not implemented, and throws an error. + #### `rcs_receive()` This is called when ikiwiki is running as a pre-receive hook (or diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn index 4e7a8d2a6..b5bfc2414 100644 --- a/doc/rcs.mdwn +++ b/doc/rcs.mdwn @@ -14,8 +14,10 @@ use, some advanced or special features are not supported in all of them. Lack of support in [[ikiwiki-makerepo]] or auto.setup can make it harder to set up a wiki using that revision control system. The `rcs_commit_staged` hook is needed to use [[attachments|plugins/attachment]] or -[[plugins/comments]]. And so on. The table below summarises this for each -revision control system and links to more information about each. +[[plugins/comments]]. `rcs_getctime` may be implemented in a fast way +(ie, one log lookup for all files), or very slowly (one lookup per file). +And so on. The table below summarises this for each revision control +system and links to more information about each. [[!table data=""" feature |[[git]]|[[svn]]|[[bzr]] |[[monotone]]|[[mercurial]]|[[darcs]]|[[tla]] |[[cvs]] @@ -25,6 +27,8 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes `rcs_rename` |yes |yes |yes |yes |no |yes |no |yes `rcs_remove` |yes |yes |yes |yes |no |yes |no |yes `rcs_diff` |yes |yes |yes |yes |no |yes |yes |yes +`rcs_getctime` |fast |slow |slow |slow |slow |slow |slow |slow +`rcs_getmtime` |fast |no |no |no |no |no |no |no anonymous push |yes |no |no |no |no |no |no |no conflict handling |yes |yes |yes |buggy |yes |yes |yes |yes """]] diff --git a/doc/tips/Importing_posts_from_Wordpress.mdwn b/doc/tips/Importing_posts_from_Wordpress.mdwn index 59330caa4..8774c9723 100644 --- a/doc/tips/Importing_posts_from_Wordpress.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress.mdwn @@ -1,6 +1,6 @@ Use case: You want to move away from Wordpress to Ikiwiki as your blogging/website platform, but you want to retain your old posts. -[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --getctime to get the preserve creation times on checkout. +[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --gettime to get the preserve creation times on checkout. WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned. diff --git a/doc/tips/inside_dot_ikiwiki/discussion.mdwn b/doc/tips/inside_dot_ikiwiki/discussion.mdwn index 34d5b9252..69df369ec 100644 --- a/doc/tips/inside_dot_ikiwiki/discussion.mdwn +++ b/doc/tips/inside_dot_ikiwiki/discussion.mdwn @@ -6,14 +6,15 @@ My database appears corrupted: No idea how this happened. I've blown it away and recreated it but, for future reference, is there any less violent way to recover from this situation? I miss having the correct created and last edited times. --[[sabr]] > update: fixed ctimes and mtimes using [these instructions](http://u32.net/Mediawiki_Conversion/Git_Import/#Correct%20Creation%20and%20Last%20Edited%20time) --[[sabr]] -> That's overly complex. Just run `ikiwiki -setup your.setup -getctime`. +> That's overly complex. Just run `ikiwiki -setup your.setup -gettime`. > BTW, I'd be interested in examining such a corrupt storable file to try > to see what happened to it. --[[Joey]] ->> --getctime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo. +>> --gettime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo. >>> Pulling the page creation date out of the git history is exactly what ->>> --getctime does. --[[Joey]] +>>> --gettime does. (It used to be called --getctime, and only do that; now +>>> it also pulls out the last modified date). --[[Joey]] >> Alas, I seem to have lost the bad index file to periodic /tmp wiping; I'll send it to you if it happens again. --[[sabr]] diff --git a/doc/todo/auto_getctime_on_fresh_build.mdwn b/doc/todo/auto_getctime_on_fresh_build.mdwn index ea95fb8c9..760c56fa1 100644 --- a/doc/todo/auto_getctime_on_fresh_build.mdwn +++ b/doc/todo/auto_getctime_on_fresh_build.mdwn @@ -1,9 +1,13 @@ [[!tag wishlist]] -It might be a good idea to enable --getctime when `.ikiwiki` does not +It might be a good idea to enable --gettime when `.ikiwiki` does not exist. This way a new checkout of a `srcdir` would automatically get -ctimes right. (Running --getctime whenever a rebuild is done would be too +ctimes right. (Running --gettime whenever a rebuild is done would be too slow.) --[[Joey]] Could this be too annoying in some cases, eg, checking out a large wiki that needs to get set up right away? --[[Joey]] + +> Not for git with the new, optimised --getctime. For other VCS.. well, +> pity they're not as fast as git ;), but it is a one-time expense... +> [[done]] --[[Joey]] diff --git a/doc/usage.mdwn b/doc/usage.mdwn index db1e36a10..553fef01e 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -320,13 +320,11 @@ also be configured using a setup file. intercepted. If you enable this option then you must run at least the CGI portion of ikiwiki over SSL. -* --getctime +* --gettime - Pull creation time for each new page out of the revision control - system. This rarely used option provides a way to get the real creation - times of items in weblogs, such as when building a wiki from a new - VCS checkout. It is unoptimised and quite slow. It is best used - with --rebuild, to force ikiwiki to get the ctime for all pages. + Extract creation and modification times for each new page from the + the revision control's log. This is done automatically when building a + wiki for the first time, so you normally do not need to use this option. * --set var=value diff --git a/ikiwiki.in b/ikiwiki.in index 38e4d3201..801ff9a0b 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -44,7 +44,8 @@ sub getconfig () { "wrappergroup=s" => \$config{wrappergroup}, "usedirs!" => \$config{usedirs}, "prefix-directives!" => \$config{prefix_directives}, - "getctime" => \$config{getctime}, + "getctime" => \$config{gettime}, + "gettime" => \$config{gettime}, "numbacklinks=i" => \$config{numbacklinks}, "rcs=s" => \$config{rcs}, "no-rcs" => sub { $config{rcs}="" }, diff --git a/mtime-to-git b/mtime-to-git deleted file mode 100755 index 9875af5d7..000000000 --- a/mtime-to-git +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# Sets mtimes of all files in the tree their last change date -# based on git's log. Useful to avoid too new dates after a -# fresh checkout, which lead to ikiwiki unnecessarily rebuilding -# basewiki files on upgrade. -if [ -d .git ]; then - for file in $(git ls-files); do - date="$(git log -1 --date=rfc "$file" | grep ^Date: | sed -e 's/Date://')" - if [ -n "$date" ]; then - echo "$date $file" - touch -d"$date" $file - fi - done -fi -- cgit v1.2.3 From dee2940c0bc97080088c99f399cd0ff0df3bec23 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 18:29:45 -0400 Subject: automatically run --gettime, and optimise it for git * Automatically run --gettime the first time ikiwiki is run on a given srcdir. * Optimise --gettime for git, so it's appropriatly screamingly fast. (This could be done for other backends too.) * However, --gettime for git no longer follows renames. * Use above to fix up timestamps on docwiki, as well as ensure that timestamps on basewiki files shipped in the deb are sane. --- IkiWiki.pm | 2 +- IkiWiki/Plugin/git.pm | 48 ++++++++++++++++++++++++++++++++++++------------ IkiWiki/Render.pm | 11 +++++++++-- debian/changelog | 7 +++++++ debian/control | 2 +- doc/plugins/write.mdwn | 4 ++++ doc/usage.mdwn | 2 +- docwiki.setup | 17 ++++++++++++++++- ikiwiki.in | 2 +- 9 files changed, 76 insertions(+), 19 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 7655dada5..b37b1f344 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -442,7 +442,6 @@ sub getsetup () { }, gettime => { type => "internal", - default => 0, description => "running in gettime mode", safe => 0, rebuild => 0, @@ -1512,6 +1511,7 @@ sub loadindex () { open ($in, "<", "$config{wikistatedir}/indexdb") || return; } else { + $config{gettime}=1; # first build return; } } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 86d80186f..aa402c04f 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -616,27 +616,51 @@ sub rcs_diff ($) { } } -sub rcs_getctime ($) { +{ +my %time_cache; + +sub findtimes ($$) { my $file=shift; + my $id=shift; # 0 = mtime ; 1 = ctime + # Remove srcdir prefix $file =~ s/^\Q$config{srcdir}\E\/?//; - my @raw_lines = run_or_die('git', 'log', - '--follow', '--no-merges', - '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c', - '-r', '--', $file); - my @ci; - while (my $parsed = parse_diff_tree("", \@raw_lines)) { - push @ci, $parsed; + if (! keys %time_cache) { + my $date; + foreach my $line (run_or_die('git', 'log', + '--pretty=format:%ct', + '--name-only', '--relative')) { + if (! defined $date && $line =~ /^(\d+)$/) { + $date=$line; + } + elsif (! length $line) { + $date=undef; + } + else { + if (! $time_cache{$line}) { + $time_cache{$line}[0]=$date; # mtime + } + $time_cache{$line}[1]=$date; # ctime + } + } } - my $ctime = $ci[$#ci]->{'author_epoch'}; - debug("ctime for '$file': ". localtime($ctime)); - return $ctime; + return exists $time_cache{$file} ? $time_cache{$file}[$id] : 0; +} + +} + +sub rcs_getctime ($) { + my $file=shift; + + return findtimes($file, 1); } sub rcs_getmtime ($) { - error "rcs_getmtime is not implemented for git\n"; # TODO + my $file=shift; + + return findtimes($file, 0); } sub rcs_receive () { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e1cb68462..a6b0f0617 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -352,6 +352,8 @@ sub find_new_files ($) { my @new; my @internal_new; + my $times_noted; + foreach my $file (@$files) { my $page=pagename($file); if (exists $pagesources{$page} && $pagesources{$page} ne $file) { @@ -363,7 +365,12 @@ sub find_new_files ($) { if (isinternal($page)) { push @internal_new, $file; } - else { + elsif ($config{rcs}) { + if (! $times_noted) { + debug(sprintf(gettext("querying %s for file creation and modification times.."), $config{rcs})); + $times_noted=1; + } + push @new, $file; if ($config{gettime} && -e "$config{srcdir}/$file") { eval { @@ -377,7 +384,7 @@ sub find_new_files ($) { } my $mtime; eval { - my $mtime=rcs_getmtime("$config{srcdir}/$file"); + $mtime=rcs_getmtime("$config{srcdir}/$file"); }; if ($@) { print STDERR $@; diff --git a/debian/changelog b/debian/changelog index 615d5916f..60a67cbe3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,8 +47,15 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * Rename --getctime to --gettime. (The old name still works for backwards compatability.) * --gettime now also looks up last modification time. + * Automatically run --gettime the first time ikiwiki is run on + a given srcdir. * Add rcs_getmtime to plugin API; currently only implemented for git. + * Optimise --gettime for git, so it's appropriatly screamingly + fast. (This could be done for other backends too.) + * However, --gettime for git no longer follows renames. + * Use above to fix up timestamps on docwiki, as well as ensure that + timestamps on basewiki files shipped in the deb are sane. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/debian/control b/debian/control index 87f7d8209..ae06f32b0 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, wdg-html-validator, libhtml-parser-perl, liburi-perl, perlmagick, po4a (>= 0.34), - libfile-chdir-perl + libfile-chdir-perl, Maintainer: Joey Hess Uploaders: Josh Triplett Standards-Version: 3.8.4 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index cf7044b2c..0bf6fcf48 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1085,6 +1085,8 @@ it up in the history. It's ok if this is not implemented, and throws an error. +If the RCS cannot determine a ctime for the file, return 0. + #### `rcs_getmtime($)` This is used to get the page modification time for a file from the RCS, by @@ -1092,6 +1094,8 @@ looking it up in the history. It's ok if this is not implemented, and throws an error. +If the RCS cannot determine a mtime for the file, return 0. + #### `rcs_receive()` This is called when ikiwiki is running as a pre-receive hook (or diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 553fef01e..2e12517ea 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -320,7 +320,7 @@ also be configured using a setup file. intercepted. If you enable this option then you must run at least the CGI portion of ikiwiki over SSL. -* --gettime +* --gettime, --no-gettime Extract creation and modification times for each new page from the the revision control's log. This is done automatically when building a diff --git a/docwiki.setup b/docwiki.setup index 8278b73ea..6bc200066 100644 --- a/docwiki.setup +++ b/docwiki.setup @@ -1,6 +1,18 @@ #!/usr/bin/perl # Configuration file for ikiwiki to build its documentation wiki. +# Use git during the build, if it's available and if we're building +# from a git checkout. This ensures ikiwiki gets the right mtimes and +# ctimes for files in the doc wiki. +our $rcs="norcs"; +BEGIN { + my $git=`which git 2>&1`; + chomp $git; + if (-x $git && -d ".git") { + $rcs="git"; + } +} + use IkiWiki::Setup::Standard { wikiname => "ikiwiki", srcdir => "doc", @@ -9,7 +21,7 @@ use IkiWiki::Setup::Standard { underlaydirbase => "underlays", underlaydir => "underlays/basewiki", discussion => 0, - exclude => qr/\/discussion|bugs\/*|todo\/*|forum\/*/, + exclude => qr/\/discussion|bugs\/*|todo\/*|forum\/*/, # save space locale => '', verbose => 1, syslog => 0, @@ -17,4 +29,7 @@ use IkiWiki::Setup::Standard { usedirs => 0, prefix_directives => 1, add_plugins => [qw{goodstuff version haiku polygen fortune table}], + disable_plugins => [qw{recentchanges}], # not appropriate for doc dir + rcs => $rcs, + gitorigin_branch => '', # don't pull during build } diff --git a/ikiwiki.in b/ikiwiki.in index 801ff9a0b..acd37f802 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -45,7 +45,7 @@ sub getconfig () { "usedirs!" => \$config{usedirs}, "prefix-directives!" => \$config{prefix_directives}, "getctime" => \$config{gettime}, - "gettime" => \$config{gettime}, + "gettime!" => \$config{gettime}, "numbacklinks=i" => \$config{numbacklinks}, "rcs=s" => \$config{rcs}, "no-rcs" => sub { $config{rcs}="" }, -- cgit v1.2.3 From ca02c57ee47d4c05946c0c34eee32a0ad4ec6b01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 14:07:12 -0400 Subject: document add_autofile --- doc/plugins/write.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 0bf6fcf48..e33c99421 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -966,6 +966,22 @@ added. Pass it the page that contains the link, and the link text. An optional third parameter sets the link type. If not specified, it is an ordinary [[ikiwiki/WikiLink]]. +### `add_autofile($$$)` + +Sometimes you may want to add a file to the `srcdir`. For example, +[[plugins/tag]] pages can be automatically created as needed. This function +can be used to do that. + +The three parameters are the filename to add, the name of the plugin, +and a callback function. The callback will be called if it is appropriate +to automatically add the file, and should then take care of creating it, +and doing anything else it needs to (such as checking it into revision +control). Note that the callback may not always be called. For example, +if an automatically added file is deleted by the user, ikiwiki will avoid +re-adding it again. + +This function needs to be called during the scan hook, or earlier to work. + ## Miscellaneous ### Internal use pages -- cgit v1.2.3 From 59ceeb5621ae0ae2bcb7501c6ac0c7a06562a7cc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 17:15:07 -0400 Subject: improve docs --- doc/plugins/write.mdwn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index e33c99421..5190a26ed 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -968,9 +968,9 @@ it is an ordinary [[ikiwiki/WikiLink]]. ### `add_autofile($$$)` -Sometimes you may want to add a file to the `srcdir`. For example, -[[plugins/tag]] pages can be automatically created as needed. This function -can be used to do that. +Sometimes you may want to add a file to the `srcdir` as a result of content +of other pages. For example, [[plugins/tag]] pages can be automatically +created as needed. This function can be used to do that. The three parameters are the filename to add, the name of the plugin, and a callback function. The callback will be called if it is appropriate @@ -980,7 +980,8 @@ control). Note that the callback may not always be called. For example, if an automatically added file is deleted by the user, ikiwiki will avoid re-adding it again. -This function needs to be called during the scan hook, or earlier to work. +This function needs to be called during the scan hook, or earlier in the +build process, in order to add the file early enough for it to be built. ## Miscellaneous -- cgit v1.2.3 From 9c8761ba49b06a76a923eb91735f842f419d2916 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 14:27:12 -0400 Subject: add_autofile filename should be relative to srcdir --- doc/plugins/write.mdwn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 5190a26ed..404c3b44f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -972,13 +972,13 @@ Sometimes you may want to add a file to the `srcdir` as a result of content of other pages. For example, [[plugins/tag]] pages can be automatically created as needed. This function can be used to do that. -The three parameters are the filename to add, the name of the plugin, -and a callback function. The callback will be called if it is appropriate -to automatically add the file, and should then take care of creating it, -and doing anything else it needs to (such as checking it into revision -control). Note that the callback may not always be called. For example, -if an automatically added file is deleted by the user, ikiwiki will avoid -re-adding it again. +The three parameters are the filename to create (relative to the `srcdir`), +the name of the plugin, and a callback function. The callback will be +called if it is appropriate to automatically add the file, and should then +take care of creating it, and doing anything else it needs to (such as +checking it into revision control). Note that the callback may not always +be called. For example, if an automatically added file is deleted by the +user, ikiwiki will avoid re-adding it again. This function needs to be called during the scan hook, or earlier in the build process, in order to add the file early enough for it to be built. -- cgit v1.2.3 From 204c0a63f3fd7673dac83da6aa5f9c9e3cc9a6c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 15:22:05 -0400 Subject: document tag_autocreate --- debian/changelog | 2 ++ doc/plugins/tag.mdwn | 3 +++ doc/roadmap.mdwn | 1 + 3 files changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/debian/changelog b/debian/changelog index b7ec99463..d66b5e4d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low [ Joey Hess ] + * tag: Automatic creation of tag pages can now be enabled using + the tag_autocreate setting. (David Riebenbauer) * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) * comments: Fix missing entity encoding in title. * txt: Add a special case for robots.txt. diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 8ff70a069..bdf39d7e8 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,6 +8,9 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. +If the `tag_autocreate` setting is enabled, tag pages will automatically be +created as needed. + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 0c7bf2fa8..8e2a01827 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -78,6 +78,7 @@ Probably incomplete list: * Make pagespecs match relative by default? (see [[discussion]]) * Flip wikilinks? (see [[todo/link_plugin_perhaps_too_general?]]) * YADA format setup files per default? +* Enable `tag_autocreate` by default. In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that -- cgit v1.2.3 From d048e9c64aca24b8e064aaf1608862b50c427de2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 20:39:20 -0400 Subject: turn on tag_autocreate by default if tagbase is set --- IkiWiki/Plugin/tag.pm | 5 +++-- debian/NEWS | 4 ++++ doc/ikiwiki/directive/tag.mdwn | 3 ++- doc/plugins/tag.mdwn | 8 ++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index cd7ecc212..62f030f4e 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -36,7 +36,7 @@ sub getsetup () { }, tag_autocreate => { type => "boolean", - example => 0, + example => 1, description => "autocreate new tag pages?", safe => 1, rebuild => undef, @@ -67,7 +67,8 @@ sub htmllink_tag ($$$;@) { sub gentag ($) { my $tag=shift; - if ($config{tag_autocreate}) { + if ($config{tag_autocreate} || + ($config{tagbase} && ! defined $config{tag_autocreate})) { my $tagpage=taglink($tag); if ($tagpage=~/^\.\/(.*)/) { $tagpage=$1; diff --git a/debian/NEWS b/debian/NEWS index 9fd882ad2..8b87bc601 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -11,6 +11,10 @@ ikiwiki (3.20100406) unstable; urgency=low not regular wikilinks. If your wiki accidentially relied on the old, buggy behavior, you might need to change pagespecs to use `link()`. + Tag pages can automatically be created as new tags are used. This + feature is enabled by default if you have configured a tagbase. It + can be turned on or off using the `tag_autocreate` setting. + The title_natural sort method (as used by the inline directive, etc) have been moved to the new sortnaturally plugin, which is not enabled by default since it requires the Sort::Naturally perl module. diff --git a/doc/ikiwiki/directive/tag.mdwn b/doc/ikiwiki/directive/tag.mdwn index 807a96f25..c8d9b9816 100644 --- a/doc/ikiwiki/directive/tag.mdwn +++ b/doc/ikiwiki/directive/tag.mdwn @@ -19,7 +19,8 @@ instead: Note that if the wiki is configured to use a tagbase, then the tags will be located under a base directory, such as "tags/". This is a useful way to avoid having to write the full path to tags, if you want to keep them -grouped together out of the way. +grouped together out of the way. Also, since ikiwiki then knows where to put +tags, it will automatically create tag pages when new tags are used. Bear in mind that specifying a tagbase means you will need to incorporate it into the `link()` [[ikiwiki/PageSpec]] you use: e.g., if your tagbase is diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index bdf39d7e8..8e1286e62 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,8 +8,12 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. -If the `tag_autocreate` setting is enabled, tag pages will automatically be -created as needed. +The `tagbase` setting can be used to make tags default to being put in a +particular subdirectory. + +The `tag_autocreate` setting can be used to control whether new tag pages +are created as needed. It defaults to being done only if a `tagbase` is +set. [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this -- cgit v1.2.3 From 17a89d3d19f3a04ca2686ff18df127e5afaf9577 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 21:57:12 -0400 Subject: update --- doc/plugins/tag/discussion.mdwn | 1 + doc/todo/auto-create_tag_pages_according_to_a_template.mdwn | 2 ++ 2 files changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/tag/discussion.mdwn b/doc/plugins/tag/discussion.mdwn index 03dcb7b2f..dfd749252 100644 --- a/doc/plugins/tag/discussion.mdwn +++ b/doc/plugins/tag/discussion.mdwn @@ -28,3 +28,4 @@ See [[todo/auto-create tag pages according to a template]] -- Jeremy Schultz +`tag_autocreate` can now enable this. --[[Joey]] diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index 32870dd3d..1e0a910f4 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -247,3 +247,5 @@ I've tested it somewhat. --[[Joey]] [da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0 (commitdiff for da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0) [a358d74bef51dae31332ff27e897fe04834571e6]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=a358d74bef51dae31332ff27e897fe04834571e6 (commitdiff for a358d74bef51dae31332ff27e897fe04834571e6) [981400177d68a279f485727be3f013e68f0bf691]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=981400177d68a279f485727be3f013e68f0bf691 (commitdiff for 981400177d68a279f485727be3f013e68f0bf691) + +[[!tag done]] -- cgit v1.2.3 From 584391aedd2f5392db7e9d3d46cf202d6cb8e951 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Apr 2010 14:07:45 -0400 Subject: clarify --- doc/plugins/write.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 404c3b44f..9e8c59f63 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -315,9 +315,9 @@ a new custom parameter to the template. This hook allows plugins to change the [[template|wikitemplates]] that is used for a page in the wiki. The hook is passed a "page" parameter, and -should return the name of the template file to use, or undef if it doesn't -want to change the default ("page.tmpl"). Template files are looked for in -/usr/share/ikiwiki/templates by default. +should return the name of the template file to use (relative to the +template directory), or undef if it doesn't want to change the default +("page.tmpl"). ### sanitize -- cgit v1.2.3 From 23d62f42bd8fe18087cd293962a79d937cf5a3bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Apr 2010 14:35:00 -0400 Subject: remove add_templates option Templates are moving into the srcdir, and will also be searched for in configured underlays, so this is redundant. --- IkiWiki.pm | 9 +-------- IkiWiki/Plugin/underlay.pm | 11 ----------- doc/plugins/underlay.mdwn | 6 ------ 3 files changed, 1 insertion(+), 25 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index ec8b32a63..c2c2337b4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -157,13 +157,6 @@ sub getsetup () { safe => 0, # path rebuild => 1, }, - templatedirs => { - type => "internal", - default => [], - description => "additional directories containing template files", - safe => 0, - rebuild => 0, - }, underlaydir => { type => "string", default => "$installdir/share/ikiwiki/basewiki", @@ -1661,7 +1654,7 @@ sub saveindex () { sub template_file ($) { my $template=shift; - foreach my $dir ($config{templatedir}, @{$config{templatedirs}}, + foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { return "$dir/$template" if -e "$dir/$template"; } diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index 116fe7324..3ea19c635 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -27,14 +27,6 @@ sub getsetup () { safe => 0, rebuild => 1, }, - add_templates => { - type => "string", - example => ["$ENV{HOME}/.ikiwiki/templates"], - description => "extra template directories to add", - advanced => 1, - safe => 0, - rebuild => 1, - }, } sub checkconfig () { @@ -43,9 +35,6 @@ sub checkconfig () { add_underlay($dir); } } - if ($config{add_templates}) { - push @{$config{templatedirs}}, @{$config{add_templates}}; - } } 1; diff --git a/doc/plugins/underlay.mdwn b/doc/plugins/underlay.mdwn index 8836a394c..0cf819472 100644 --- a/doc/plugins/underlay.mdwn +++ b/doc/plugins/underlay.mdwn @@ -12,9 +12,3 @@ revision control, like photos or software releases. Directories in `add_underlays` should usually be absolute. If relative, they're interpreted as relative to the parent directory of the basewiki underlay, which is probably not particularly useful in this context. - --- - -This plugin also adds an `add_templates` option to the setup file. -Its value is a list of template directories to look for template files in, -if they are not present in the `templatedir`. -- cgit v1.2.3 From abd233931247ef38f1b084afd5906619f02c13b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Apr 2010 15:34:32 -0400 Subject: look for templates in srcdir and underlays, first This entailed changing template_params; it no longer takes the template filename as its first parameter. Add template_depends to api and replace calls to template() with template_depends() in appropriate places, where a dependency should be added on the template. Other plugins don't use template(), so will need further work. Also, includes are disabled for security. Enabling includes only when using templates from the templatedir would be nice, but would add a lot of complexity to the implementation. --- IkiWiki.pm | 59 +++++++++++++++++++++++++++------------------- IkiWiki/Plugin/comments.pm | 2 +- IkiWiki/Plugin/editpage.pm | 2 +- IkiWiki/Plugin/google.pm | 2 +- IkiWiki/Plugin/inline.pm | 22 ++++++++++------- IkiWiki/Plugin/search.pm | 2 +- IkiWiki/Render.pm | 4 +++- doc/plugins/write.mdwn | 8 +++++++ 8 files changed, 63 insertions(+), 38 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index c2c2337b4..1327e4db5 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -18,8 +18,8 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %autofiles}; use Exporter q{import}; -our @EXPORT = qw(hook debug error template htmlpage deptype - add_depends pagespec_match pagespec_match_list bestlink +our @EXPORT = qw(hook debug error htmlpage template template_depends + deptype add_depends pagespec_match pagespec_match_list bestlink htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext ngettext urlto targetpage add_underlay pagetitle titlepage linkpage newpagefile @@ -1652,47 +1652,58 @@ sub saveindex () { } sub template_file ($) { - my $template=shift; + my $name=shift; + my $template=srcfile("templates/$name", 1); + return $template if defined $template; + foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { - return "$dir/$template" if -e "$dir/$template"; + return "$dir/$name" if -e "$dir/$name"; } return; } sub template_params (@) { - my $filename=template_file(shift); - - if (! defined $filename) { - return if wantarray; - return ""; - } + filter => sub { + my $text_ref = shift; + ${$text_ref} = decode_utf8(${$text_ref}); + }, + loop_context_vars => 1, + die_on_bad_params => 0, + @_, + no_includes => 1, +} - my @ret=( - filter => sub { - my $text_ref = shift; - ${$text_ref} = decode_utf8(${$text_ref}); - }, - filename => $filename, - loop_context_vars => 1, - die_on_bad_params => 0, +sub template ($;@) { + require HTML::Template; + return HTML::Template->new(template_params( + filename => template_file(shift), @_ - ); - return wantarray ? @ret : {@ret}; + )); } -sub template ($;@) { +sub template_depends ($$;@) { + my $name=shift; + my $page=shift; + + if (defined $page) { + add_depends($page, "templates/$name"); + } + my $filename=template_file($name); + require HTML::Template; - return HTML::Template->new(template_params(@_)); + return HTML::Template->new(template_params( + filename => $filename, + @_ + )); } sub misctemplate ($$;@) { my $title=shift; my $pagebody=shift; - my $template=template("misc.tmpl"); - $template->param( + my $template=template("misc.tmpl", title => $title, indexlink => indexlink(), wikiname => $config{wikiname}, diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 58bd4b851..ed75a6e46 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -274,7 +274,7 @@ sub editcomment ($$) { action => $config{cgiurl}, header => 0, table => 0, - template => scalar IkiWiki::template_params('editcomment.tmpl'), + template => template('editcomment.tmpl'), ); IkiWiki::decode_form_utf8($form); diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 26e38abc1..5c94ecbca 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -78,7 +78,7 @@ sub cgi_editpage ($$) { action => $config{cgiurl}, header => 0, table => 0, - template => scalar template_params("editpage.tmpl"), + template => template("editpage.tmpl"), ); decode_form_utf8($form); diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 48ad4c8ce..68cb16513 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -36,7 +36,7 @@ sub pagetemplate (@) { # Add search box to page header. if ($template->query(name => "searchform")) { if (! defined $form) { - my $searchform = template("googleform.tmpl", blind_cache => 1); + my $searchform = template_depends("googleform.tmpl", $page, blind_cache => 1); $searchform->param(url => $config{url}); $form=$searchform->output; } diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 3359af314..043649742 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -299,7 +299,7 @@ sub preprocess_inline (@) { (exists $params{postform} && yesno($params{postform}))) && IkiWiki->can("cgi_editpage")) { # Add a blog post form, with feed buttons. - my $formtemplate=template("blogpost.tmpl", blind_cache => 1); + my $formtemplate=template_depends("blogpost.tmpl", $params{page}, blind_cache => 1); $formtemplate->param(cgiurl => $config{cgiurl}); $formtemplate->param(rootpage => rootpage(%params)); $formtemplate->param(rssurl => $rssurl) if $feeds && $rss; @@ -320,19 +320,23 @@ sub preprocess_inline (@) { } elsif ($feeds && !$params{preview} && ($emptyfeeds || @feedlist)) { # Add feed buttons. - my $linktemplate=template("feedlink.tmpl", blind_cache => 1); + my $linktemplate=template_depends("feedlink.tmpl", $params{page}, blind_cache => 1); $linktemplate->param(rssurl => $rssurl) if $rss; $linktemplate->param(atomurl => $atomurl) if $atom; $ret.=$linktemplate->output; } if (! $feedonly) { - require HTML::Template; - my @params=IkiWiki::template_params($params{template}.".tmpl", blind_cache => 1); - if (! @params) { - error sprintf(gettext("nonexistant template %s"), $params{template}); + my $template; + if (! $raw) { + eval { + $template=template_depends($params{template}.".tmpl", $params{page}, + blind_cache => 1); + }; + if (! $@ || ! $template) { + error sprintf(gettext("nonexistant template %s"), $params{template}); + } } - my $template=HTML::Template->new(@params) unless $raw; my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content')); foreach my $page (@list) { @@ -534,7 +538,7 @@ sub genfeed ($$$$$@) { my $url=URI->new(encode_utf8(urlto($page,"",1))); - my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1); + my $itemtemplate=template_depends($feedtype."item.tmpl", $page, blind_cache => 1); my $content=""; my $lasttime = 0; foreach my $p (@pages) { @@ -598,7 +602,7 @@ sub genfeed ($$$$$@) { $lasttime = $pagemtime{$p} if $pagemtime{$p} > $lasttime; } - my $template=template($feedtype."page.tmpl", blind_cache => 1); + my $template=template_depends($feedtype."page.tmpl", $page, blind_cache => 1); $template->param( title => $page ne "index" ? pagetitle($page) : $config{wikiname}, wikiname => $config{wikiname}, diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index a1e7026ca..55edf8752 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -52,7 +52,7 @@ sub pagetemplate (@) { # Add search box to page header. if ($template->query(name => "searchform")) { if (! defined $form) { - my $searchform = template("searchform.tmpl", blind_cache => 1); + my $searchform = template_depends("searchform.tmpl", $page, blind_cache => 1); $searchform->param(searchaction => $config{cgiurl}); $form=$searchform->output; } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 49d080c16..7cf19645e 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -74,7 +74,9 @@ sub genpage ($$) { $templatefile=$file; } }); - my $template=template(defined $templatefile ? $templatefile : 'page.tmpl', blind_cache => 1); + my $template=template_depends( + defined $templatefile ? $templatefile : 'page.tmpl', $page, + blind_cache => 1); my $actions=0; if (length $config{cgiurl}) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 9e8c59f63..eaa008131 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -705,6 +705,14 @@ Creates and returns a [[!cpan HTML::Template]] object. The first parameter is the name of the file in the template directory. The optional remaining parameters are passed to `HTML::Template->new`. +### `template_depends($$;@)` + +Use this instead of `template()` if the content of a template is being +included into a page. This causes the page to depend on the template, +so it will be updated if the template is modified. + +Like `template()`, except the second parameter is the page. + ### `htmlpage($)` Passed a page name, returns the base name that will be used for a the html -- cgit v1.2.3 From 54898d16d4c86fddcb1b5588eac67a729c14deeb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 14:44:37 -0400 Subject: allow a bare page name to be specified as a template --- IkiWiki.pm | 31 +++++++++++++++++++++---------- doc/plugins/write.mdwn | 11 +++++++++-- template-transition-notes | 1 + 3 files changed, 31 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 0aaf60569..03441b594 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1653,9 +1653,18 @@ sub saveindex () { sub template_file ($) { my $name=shift; + + my $tpage="templates/$name"; + if ($name !~ /\.tmpl$/ && exists $pagesources{$tpage}) { + $tpage=$pagesources{$tpage}; + $name.=".tmpl"; + } - my $template=srcfile("templates/$name", 1); - return $template if defined $template; + my $template=srcfile($tpage, 1); + if (defined $template) { + return $template, $tpage if wantarray; + return $template; + } foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { @@ -1664,18 +1673,16 @@ sub template_file ($) { return; } -sub template ($;@) { - template_depends(shift, undef, @_); -} - sub template_depends ($$;@) { my $name=shift; my $page=shift; - - if (defined $page) { - add_depends($page, "templates/$name"); + + my ($filename, $tpage)=template_file($name); + if (defined $page && defined $tpage) { + add_depends($page, $tpage); } - my $filename=template_file($name); + + return unless defined $filename; require HTML::Template; return HTML::Template->new( @@ -1691,6 +1698,10 @@ sub template_depends ($$;@) { ); } +sub template ($;@) { + template_depends(shift, undef, @_); +} + sub misctemplate ($$;@) { my $title=shift; my $pagebody=shift; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index eaa008131..1407b5a12 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -702,8 +702,15 @@ the entire wiki build and make the wiki unusable. ### `template($;@)` Creates and returns a [[!cpan HTML::Template]] object. The first parameter -is the name of the file in the template directory. The optional remaining -parameters are passed to `HTML::Template->new`. +is the name of the template file. The optional remaining parameters are +passed to `HTML::Template->new`. + +The template file is first looked for in the templates/ subdirectory of the +srcdir. Failing that, it is looked for in the templatedir. Typically +the filename will have a ".tmpl" extension. If a filename with no extension +is passed, a wiki page in templates/ with its name is used as the template. +That should only be done for templates which it is safe to let wiki users +edit. ### `template_depends($$;@)` diff --git a/template-transition-notes b/template-transition-notes index 193dd79d4..ccff3e78f 100644 --- a/template-transition-notes +++ b/template-transition-notes @@ -3,3 +3,4 @@ * includes no longer allowed in templates * template directive no longer uses $foo.tmpl , only page $foo. +* template_params removed (not exported API) -- cgit v1.2.3 From 78fd3b35a2805489185a14e00b53b450eec961f1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 15:02:07 -0400 Subject: allow template pages to not be under templates/ --- IkiWiki.pm | 4 +++- doc/plugins/write.mdwn | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 03441b594..78612cd08 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1654,7 +1654,7 @@ sub saveindex () { sub template_file ($) { my $name=shift; - my $tpage="templates/$name"; + my $tpage=($name =~ /^\//) ? $name : "templates/$name"; if ($name !~ /\.tmpl$/ && exists $pagesources{$tpage}) { $tpage=$pagesources{$tpage}; $name.=".tmpl"; @@ -1665,6 +1665,8 @@ sub template_file ($) { return $template, $tpage if wantarray; return $template; } + + $name=~s:/::; # avoid path traversal foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 1407b5a12..00b54bdd3 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -705,12 +705,14 @@ Creates and returns a [[!cpan HTML::Template]] object. The first parameter is the name of the template file. The optional remaining parameters are passed to `HTML::Template->new`. -The template file is first looked for in the templates/ subdirectory of the -srcdir. Failing that, it is looked for in the templatedir. Typically -the filename will have a ".tmpl" extension. If a filename with no extension -is passed, a wiki page in templates/ with its name is used as the template. -That should only be done for templates which it is safe to let wiki users -edit. +Normally, the template file is first looked for in the templates/ subdirectory +of the srcdir. Failing that, it is looked for in the templatedir. + +Wiki pages can be used as templates. This should be done only for templates +which it is safe to let wiki users edit. Enable it by passing a filename +with no ".tmpl" extension. Template pages are normally looked for in +the templates/ directory. If the page name starts with "/", a page +elsewhere in the wiki can be used. ### `template_depends($$;@)` -- cgit v1.2.3 From 7e79da76332b93214a7d9a5c91bc046db4219ee2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 16:10:46 -0400 Subject: template docu reorg Remove wikitemplates page; fold its contents into templates page. Update all backlinks. Document new ability to put templates inside srcdir. --- doc/bugs/SSI_include_stripped_from_mdwn.mdwn | 2 +- doc/bugs/login_page_non-obvious_with_openid.mdwn | 4 +- doc/features.mdwn | 2 +- doc/freesoftware.mdwn | 2 +- doc/ikiwiki-calendar.mdwn | 2 +- doc/ikiwiki/directive/edittemplate.mdwn | 2 +- doc/ikiwiki/directive/pagetemplate.mdwn | 8 +- doc/ikiwiki/directive/template.mdwn | 8 +- doc/plugins/autoindex.mdwn | 2 +- doc/plugins/map/discussion.mdwn | 2 +- doc/plugins/pagetemplate.mdwn | 6 +- doc/plugins/template.mdwn | 4 +- doc/plugins/write.mdwn | 4 +- doc/templates.mdwn | 91 +++++++++++++++++++--- doc/tips/comments_feed.mdwn | 2 +- ...o-create_tag_pages_according_to_a_template.mdwn | 2 +- doc/todo/auto_rebuild_on_template_change.mdwn | 2 +- doc/todo/html.mdwn | 2 +- doc/todo/multiple_templates.mdwn | 2 +- doc/usage.mdwn | 5 +- doc/wikitemplates.mdwn | 52 ------------- doc/wikitemplates/discussion.mdwn | 46 ----------- 22 files changed, 111 insertions(+), 141 deletions(-) delete mode 100644 doc/wikitemplates.mdwn delete mode 100644 doc/wikitemplates/discussion.mdwn (limited to 'doc/plugins') diff --git a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn index 5519e45c6..270da86d3 100644 --- a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn +++ b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn @@ -10,7 +10,7 @@ If I have a <--#include virtual="foo" --> in some file, it gets stripped, > Anyway, it makes sense for the htmlscrubber to strip server-side > includes because otherwise your wiki could be attacked > by them being added to it. If you want to use both the htmlscrubber and -> SSI together, I'd suggest you modify the [[wikitemplates]] +> SSI together, I'd suggest you modify the [[templates]] > and put the SSI on there. > > Ie, `page.tmpl` has a diff --git a/doc/bugs/login_page_non-obvious_with_openid.mdwn b/doc/bugs/login_page_non-obvious_with_openid.mdwn index 1d087985a..9aa702037 100644 --- a/doc/bugs/login_page_non-obvious_with_openid.mdwn +++ b/doc/bugs/login_page_non-obvious_with_openid.mdwn @@ -36,7 +36,7 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > that allows modifying that form, but does not allow creating a separate > form. The best way to make it obvious how to use it currently is to just > disable password auth, then it's nice and simple. :-) Javascript is an -> interesting idea. It's also possible to write a custom [[signin.tmpl wikitemplates]] that +> interesting idea. It's also possible to write a custom [[templates]] that > is displayed instead of the regular signin form, and it should be > possible to use that to manually lay it out better than FormBuilder > manages with its automatic layout. --[[Joey]] @@ -44,4 +44,4 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > I've improved the form, I think it's more obvious now that the openid > stuff is separate. Good enough to call this [[done]]. I think. --[[Joey]] ->> Looks good, thanks! :-) -- [[AdamShand]] \ No newline at end of file +>> Looks good, thanks! :-) -- [[AdamShand]] diff --git a/doc/features.mdwn b/doc/features.mdwn index ab521213d..07ce648ea 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). Ikiwiki -generates html using [[templates|wikitemplates]], and uses [[css]], so you +generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. ## [[Plugins]] diff --git a/doc/freesoftware.mdwn b/doc/freesoftware.mdwn index 7ac1ac6b4..2243d9b1f 100644 --- a/doc/freesoftware.mdwn +++ b/doc/freesoftware.mdwn @@ -4,7 +4,7 @@ ikiwiki, and this documentation wiki, are licensed under the terms of the GNU [[GPL]], version 2 or later. The parts of ikiwiki that become part of your own wiki (the [[basewiki]] -pages (but not the smilies) and the [[templates|wikitemplates]]) are licensed +pages (but not the smilies) and the [[templates]]) are licensed as follows: > Redistribution and use in source and compiled forms, with or without diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn index c1f4d7267..03cbdd86c 100644 --- a/doc/ikiwiki-calendar.mdwn +++ b/doc/ikiwiki-calendar.mdwn @@ -43,7 +43,7 @@ An example crontab: # TEMPLATES -This command uses two [[template|wikitemplates]] to generate +This command uses two [[templates]] to generate the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. # AUTHOR diff --git a/doc/ikiwiki/directive/edittemplate.mdwn b/doc/ikiwiki/directive/edittemplate.mdwn index d731bdb47..c486e821b 100644 --- a/doc/ikiwiki/directive/edittemplate.mdwn +++ b/doc/ikiwiki/directive/edittemplate.mdwn @@ -21,7 +21,7 @@ something like: Details: The template page can also contain [[!cpan HTML::Template]] directives, -similar to other ikiwiki [[templates]]. Currently only one variable is +like other ikiwiki [[templates]]. Currently only one variable is set: `` is replaced with the name of the page being created. diff --git a/doc/ikiwiki/directive/pagetemplate.mdwn b/doc/ikiwiki/directive/pagetemplate.mdwn index 8ad901c1a..401b38099 100644 --- a/doc/ikiwiki/directive/pagetemplate.mdwn +++ b/doc/ikiwiki/directive/pagetemplate.mdwn @@ -1,17 +1,13 @@ The `pagetemplate` directive is supplied by the [[!iki plugins/pagetemplate desc=pagetemplate]] plugin. -This directive allows a page to be displayed using a different template than -the default `page.tmpl` template. +This directive allows a page to be displayed using a different +[[template|templates]] than the default `page.tmpl` template. The page text is inserted into the template, so the template controls the overall look and feel of the wiki page. This is in contrast to the [[ikiwiki/directive/template]] directive, which allows inserting templates _into_ the body of a page. -This directive can only reference templates that are already installed -by the system administrator, typically into the -`/usr/share/ikiwiki/templates` directory. Example: - \[[!pagetemplate template="my_fancy.tmpl"]] [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index ae71ba5b5..052ca7873 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -1,7 +1,11 @@ The `template` directive is supplied by the [[!iki plugins/template desc=template]] plugin. -[[Templates]] are files that can be filled out and inserted into pages in the -wiki, by using the template directive. The directive has an `id` parameter +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. The [[templates]] page lists templates +that can be used with this directive. + +The directive has an `id` parameter that identifies the template to use. The remaining parameters are used to fill out the template. diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn index d1133e4f5..7c4e40419 100644 --- a/doc/plugins/autoindex.mdwn +++ b/doc/plugins/autoindex.mdwn @@ -3,5 +3,5 @@ This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent page, and generates the parent pages. The generated page content is -controlled by the `autoindex.tmpl` [[template|wikitemplates]], which by +controlled by the `autoindex.tmpl` [[template|templates]], which by default, uses a [[map]] to list the SubPages. diff --git a/doc/plugins/map/discussion.mdwn b/doc/plugins/map/discussion.mdwn index 2f7b140d6..54c921b0f 100644 --- a/doc/plugins/map/discussion.mdwn +++ b/doc/plugins/map/discussion.mdwn @@ -1,7 +1,7 @@ I'm wanting a [[map]] (with indentation levels) showing page _titles_ instead of page 'names'. As far as I can see, this is not an option with existing plugins - I can get a list of pages using [[inline]] and -appropriate [[wikitemplates]], but that has no indentation and therefore +appropriate [[templates]], but that has no indentation and therefore doesn't show structure well. The quick way is to modify the map plugin to have a 'titles' option. The diff --git a/doc/plugins/pagetemplate.mdwn b/doc/plugins/pagetemplate.mdwn index 53f069d0d..8254e14c5 100644 --- a/doc/plugins/pagetemplate.mdwn +++ b/doc/plugins/pagetemplate.mdwn @@ -3,8 +3,4 @@ This plugin provides the [[ikiwiki/directive/pagetemplate]] [[ikiwiki/directive]], which allows a page to be displayed -using a different [[template|wikitemplates]] than the default. - -This plugin can only use templates that are already installed in -`/usr/share/ikiwiki/templates` (or wherever ikiwiki is configured to look for -them). You can choose to use any .tmpl files in that directory. +using a different [[template|templates]] than the default. diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index da775f232..8d17e2825 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -3,5 +3,5 @@ This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out -and inserted into pages in the wiki. It's documented and existing templates -are listed in the [[templates]] page. +and inserted into pages in the wiki. Existing templates are listed in the +[[templates]] page. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 00b54bdd3..9128c7f54 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -297,7 +297,7 @@ value is ignored. hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); -[[Templates|wikitemplates]] are filled out for many different things in +[[Templates]] are filled out for many different things in ikiwiki, like generating a page, or part of a blog page, or an rss feed, or a cgi. This hook allows modifying the variables available on those templates. The function is passed named parameters. The "page" and @@ -313,7 +313,7 @@ a new custom parameter to the template. hook(type => "templatefile", id => "foo", call => \&templatefile); -This hook allows plugins to change the [[template|wikitemplates]] that is +This hook allows plugins to change the [[template|templates]] that is used for a page in the wiki. The hook is passed a "page" parameter, and should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default diff --git a/doc/templates.mdwn b/doc/templates.mdwn index f2b581d2f..f7b3adae5 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,17 +1,88 @@ -[[!meta robots="noindex, follow"]] -[[!if test="enabled(template)" -then="This wiki has templates **enabled**." -else="This wiki has templates **disabled**." -]] +[[Ikiwiki]] uses many templates for many purposes. By editing its templates, +you can fully customise this site. -Templates are files that can be filled out and inserted into pages in the -wiki. +[[!if test="enabled(template)" then=""" +## The template directive +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. +"""]] [[!if test="enabled(template) and enabled(inline)" then=""" - -These templates are available for use with the template directive. - [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] + +[[!if test="enabled(edittemplate)" then=""" +## The edittemplate directive + +The edittemplate directive can be used to make new pages default to +containing text from a template, which can be filled as out the page is +edited. +"""]] + +## Wiki templates + +These templates are used to build the wiki. The aim is to keep almost all +html out of ikiwiki and in the templates. + +* `page.tmpl` - Used for displaying all regular wiki pages. +* `misc.tmpl` - Generic template used for any page that doesn't + have a custom template. +* `editpage.tmpl` - Create/edit page. +* `change.tmpl` - Used to create a page describing a change made to the wiki. +* `passwordmail.tmpl` - Not a html template, this is used to + generate a mail with an url the user can use to reset their password. +* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. +* `rssitem.tmpl` - Used for generating individual items on rss feeds. +* `atompage.tmpl` - Used for generating atom feeds for blogs. +* `atomitem.tmpl` - Used for generating individual items on atom feeds. +* `inlinepage.tmpl` - Used for adding a page inline in a blog + page. +* `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `microblog.tmpl` - Used for showing a microblogging post inline. +* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) +* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. +* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create + a page for a post. +* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search + form to wiki pages. +* `searchquery.tmpl` - This is an omega template, used by the + [[plugins/search]] plugin. +* `comment.tmpl` - This template is used to display a comment + by the [[plugins/comments]] plugin. +* `editcomment.tmpl` - This template is the comment post form for the + [[plugins/comments]] plugin. +* `commentmoderation.tmpl` - This template is used to produce the comment + moderation form. +* `recentchanges.tmpl` - This template is used for listing a change + on the RecentChanges page. + +[[!if test="enabled(pagetemplate)" then=""" +## The pagetemplate directive + +The pagetemplate directive can allow individual pages to use a +different template than `page.tmpl`. +"""]] + +## Template locations + +Templates are located in `/usr/share/ikiwiki/templates` by default; +the `templatedir` setting can be used to make another directory be +searched first. Customized templates can also be placed inside the +"templates/" directory in your wiki's source. + +## Template syntax + +Ikiwiki uses the HTML::Template module as its template engine. This +supports things like conditionals and loops in templates and is pretty easy +to learn. All you really need to know are a few things: + +* To insert the value of a template variable, use ``. +* To make a block of text conditional on a variable being set use + `text`. +* To use one block of text if a variable is set and a second if it's not, + use `textother text` + +[[!meta robots="noindex, follow"]] diff --git a/doc/tips/comments_feed.mdwn b/doc/tips/comments_feed.mdwn index 6f8137256..6d4dbb803 100644 --- a/doc/tips/comments_feed.mdwn +++ b/doc/tips/comments_feed.mdwn @@ -6,5 +6,5 @@ add a feed that contains all the comments posted to any page. Here's how: \[[!inline pages="internal(*/comment_*)" template=comment]] The special [[ikiwiki/PageSpec]] matches all comments. The -[[template|wikitemplates]] causes the comments to be displayed formatted +[[template|templates]] causes the comments to be displayed formatted nicely. diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index f6d444890..7eb404910 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -17,7 +17,7 @@ The new tag file is then complied during the change phase. *see git history of this page if you want the patch --[[smcv]]* -This uses a [[template|wikitemplates]] called `autotagpage.tmpl`, here is my template file: +This uses a [[template|templates]] called `autotagpage.tmpl`, here is my template file: \[[!inline pages="link()" archive="yes"]] diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index a112cb9da..838d15c1a 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -6,7 +6,7 @@ This would allow setting: templatedir => "$srcdir/templates", -.. and then the [[wikitemplates]] are managed like other wiki files; and +.. and then the [[templates]] are managed like other wiki files; and like other wiki files, a change to them automatically updates dependent pages. diff --git a/doc/todo/html.mdwn b/doc/todo/html.mdwn index 44f20c876..4f4542be2 100644 --- a/doc/todo/html.mdwn +++ b/doc/todo/html.mdwn @@ -1,6 +1,6 @@ Create some nice(r) stylesheets. Should be doable w/o touching a single line of code, just -editing the [[wikitemplates]] and/or editing [[style.css]]. +editing the [[templates]] and/or editing [[style.css]]. [[done]] ([[css_market]] ..) diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 72783c556..30fb8d6ee 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -1,4 +1,4 @@ -> Another useful feature might be to be able to choose a different [[template|wikitemplates]] +> Another useful feature might be to be able to choose a different [[template|templates]] > file for some pages; [[blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 2e12517ea..9cf61cc6c 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -120,10 +120,11 @@ also be configured using a setup file. * --templatedir dir - Specify the directory that the page [[templates|wikitemplates]] are stored in. + Specify the directory that [[templates|templates]] are stored in. Default is `/usr/share/ikiwiki/templates`, or another location as configured at build time. If the templatedir is changed, missing templates will still - be searched for in the default location as a fallback. + be searched for in the default location as a fallback. Templates can also be + placed in the "templates/" subdirectory of the srcdir. Note that if you choose to copy and modify ikiwiki's templates, you will need to be careful to keep them up to date when upgrading to new versions of diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn deleted file mode 100644 index 6e5a7261d..000000000 --- a/doc/wikitemplates.mdwn +++ /dev/null @@ -1,52 +0,0 @@ -ikiwiki uses the HTML::Template module as its template engine. This -supports things like conditionals and loops in templates and is pretty easy -to learn. - -The aim is to keep almost all html out of ikiwiki and in the templates. - -It ships with some basic templates which can be customised. These are -located in `/usr/share/ikiwiki/templates` by default; the `templatedir` -setting can be used to make another directory be searched first. - -* `page.tmpl` - Used for displaying all regular wiki pages. -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. -* `editpage.tmpl` - Create/edit page. -* `change.tmpl` - Used to create a page describing a change made to the wiki. -* `passwordmail.tmpl` - Not a html template, this is used to - generate a mail with an url the user can use to reset their password. -* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. -* `rssitem.tmpl` - Used for generating individual items on rss feeds. -* `atompage.tmpl` - Used for generating atom feeds for blogs. -* `atomitem.tmpl` - Used for generating individual items on atom feeds. -* `inlinepage.tmpl` - Used for adding a page inline in a blog - page. -* `archivepage.tmpl` - Used for listing a page in a blog archive page. -* `microblog.tmpl` - Used for showing a microblogging post inline. -* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) -* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. -* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create - a page for a post. -* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search - form to wiki pages. -* `searchquery.tmpl` - This is an omega template, used by the - [[plugins/search]] plugin. -* `comment.tmpl` - This template is used to display a comment - by the [[plugins/comments]] plugin. -* `editcomment.tmpl` - This template is the comment post form for the - [[plugins/comments]] plugin. -* `commentmoderation.tmpl` - This template is used to produce the comment - moderation form. -* `recentchanges.tmpl` - This template is used for listing a change - on the RecentChanges page. - -The [[plugins/pagetemplate]] plugin can allow individual pages to use a -different template than `page.tmpl`. - -The [[plugins/template]] plugin also uses templates, though those -[[templates]] are typically stored as pages in the wiki, and are inserted -into pages. - -The [[plugins/edittemplate]] plugin is used to make new pages default to -containing text from a template, which can be filled as out the page is -edited. diff --git a/doc/wikitemplates/discussion.mdwn b/doc/wikitemplates/discussion.mdwn deleted file mode 100644 index f97444e5f..000000000 --- a/doc/wikitemplates/discussion.mdwn +++ /dev/null @@ -1,46 +0,0 @@ -## Place for local templates -Where does one put any locally modified templates for an individual ikiwiki? --Ivan Z. - -> You can put them whereever you like; the `templatedir` controls -> where ikiwiki looks for them. --[[Joey]] - -Thank you for your response! My question arose out of my intention to make -custom templates for a wiki--specifically suited for the kind of content -it will have--so, that would mean I would want to distribute them through -git together with other content of the wiki. So, for this case the -separation of conceptually ONE thing (the content, the templates, and the -config option which orders to use these templates) into THREE separate -files/repos (the main content repo, the repo with templates, and the config -file) is not convenient: instead of distributing a single repo, I have to -tell people to take three things if they want to replicate this wiki. How -would you solve this inconvenience? Perhaps, a default location of the -templates *inside* the source repo would do?--Ivan Z. - -> I would avoid putting the templates in a subdirectory of the ikiwiki srcdir. -> (I'd also avoid putting the ikiwiki setup file there.) -> While it's safe to do either in some cases, there are configurations where -> it's unsafe. For example, a malicious user could use attachment handling to -> replace those files with their own, bad versions. -> -> So, two ideas for where to put the templatedir and ikiwiki setup. - -> * The easiest option is to put your wiki content in a subdirectory -> ("wiki", say) and point `srcdir` at that. -> then you can have another subdirectory for the wikitemplates, -> and put the setup file at the top. -> * Another option if using git would be to have a separate branch, -> in the same git repository, that holds wikitemplates and the setup file. -> Then you check out the repository once to make the `srcdir` available, -> and have a second checkout, of the other branch, to make the other stuff -> available. -> -> Note that with either of these methods, you have to watch out if -> giving other direct commit access to the repository. They could -> still edit the setup file and templates, so only trusted users should -> be given access. (It is, however, perfectly safe to let people edit -> the wiki via the web, and is even safe to configure -> [[tips/untrusted_git_push]] to such a repository.) --[[Joey]] - -Thanks, that's a nice and simple idea: to have a subdirectory! I'll try it. --Ivan Z. - -A [[!taglink wish|wishlist]]: the ikiwiki program could be improved so that it follows the same logic as git in looking for its config: it could ascend directories until it finds an `.ikiwiki/` directory with `.ikiwiki/setup` and then uses that configuration. Now I'm tired to always type `ikiwiki --setup path/to/the/setup --refresh` when working in my working clone of the sources; I'd like to simply type `ikiwiki` instead, and let it find the setup file. The default location to look for templates could also be made to be a sibling of the setup file: `.ikiwiki/templates/`. --Ivan Z. -- cgit v1.2.3 From c2656f08f3a3671b0ba7dc861d53347c7f695ec1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 16:11:33 -0400 Subject: template() - return params in list context I forgot CGI::Formbuilder's horrible interface that needs template parameters instead of a constructed object. --- IkiWiki.pm | 7 +- IkiWiki/Plugin/comments.pm | 2 +- IkiWiki/Plugin/editpage.pm | 2 +- doc/plugins/write.mdwn | 8 +- po/bg.po | 236 ++++++++++++++++++++++--------------------- po/cs.po | 243 +++++++++++++++++++++++--------------------- po/da.po | 242 ++++++++++++++++++++++++-------------------- po/de.po | 242 ++++++++++++++++++++++++-------------------- po/es.po | 246 ++++++++++++++++++++++++--------------------- po/fr.po | 242 ++++++++++++++++++++++++-------------------- po/gu.po | 235 +++++++++++++++++++++++-------------------- po/ikiwiki.pot | 218 ++++++++++++++++++++------------------- po/it.po | 242 ++++++++++++++++++++++++-------------------- po/pl.po | 241 +++++++++++++++++++++++--------------------- po/sv.po | 236 ++++++++++++++++++++++--------------------- 15 files changed, 1416 insertions(+), 1226 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 8bae6b72f..c218ed8ab 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1690,8 +1690,7 @@ sub template_depends ($$;@) { return unless defined $filename; - require HTML::Template; - return HTML::Template->new( + my @opts=( filter => sub { my $text_ref = shift; ${$text_ref} = decode_utf8(${$text_ref}); @@ -1702,6 +1701,10 @@ sub template_depends ($$;@) { @_, no_includes => 1, ); + return @opts if wantarray; + + require HTML::Template; + return HTML::Template->new(@opts); } sub template ($;@) { diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ed75a6e46..f7dc99dca 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -274,7 +274,7 @@ sub editcomment ($$) { action => $config{cgiurl}, header => 0, table => 0, - template => template('editcomment.tmpl'), + template => { template('editcomment.tmpl') }, ); IkiWiki::decode_form_utf8($form); diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 5c94ecbca..7bb6eb07c 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -78,7 +78,7 @@ sub cgi_editpage ($$) { action => $config{cgiurl}, header => 0, table => 0, - template => template("editpage.tmpl"), + template => { template("editpage.tmpl") }, ); decode_form_utf8($form); diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 9128c7f54..a9ea7db73 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -701,9 +701,11 @@ the entire wiki build and make the wiki unusable. ### `template($;@)` -Creates and returns a [[!cpan HTML::Template]] object. The first parameter -is the name of the template file. The optional remaining parameters are -passed to `HTML::Template->new`. +Creates and returns a [[!cpan HTML::Template]] object. (In a list context, +returns the parameters needed to construct the obhect.) + +The first parameter is the name of the template file. The optional remaining +parameters are passed to `HTML::Template->new`. Normally, the template file is first looked for in the templates/ subdirectory of the srcdir. Failing that, it is looked for in the templatedir. diff --git a/po/bg.po b/po/bg.po index 5585a10d6..f85323ea3 100644 --- a/po/bg.po +++ b/po/bg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-bg\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2007-01-12 01:19+0200\n" "Last-Translator: Damyan Ivanov \n" "Language-Team: Bulgarian \n" @@ -55,7 +55,7 @@ msgstr "Предпочитанията са запазени." msgid "You are banned." msgstr "Достъпът ви е забранен." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Грешка" @@ -137,7 +137,7 @@ msgstr "създаване на нова страницa „%s”" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "готово" @@ -178,7 +178,7 @@ msgstr "" msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "" @@ -210,55 +210,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, fuzzy, perl-format msgid "commenting on %s" msgstr "създаване на %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -268,7 +268,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "" @@ -298,14 +298,14 @@ msgstr "премахване на старата страница „%s”" msgid "%s is not an editable page" msgstr "" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "създаване на %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "промяна на %s" @@ -325,9 +325,10 @@ msgstr "не е указан файл на обвивката" msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:138 +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 #, fuzzy -msgid "failed to process" +msgid "failed to process template:" msgstr "грешка при обработване на шаблона" #: ../IkiWiki/Plugin/format.pm:30 @@ -358,18 +359,18 @@ msgstr "грешка при четене на „%s”: %s" msgid "%s is an attachment, not a page." msgstr "" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "" @@ -458,12 +459,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "" +msgid "template %s not found" +msgstr "шаблонът „%s” не е намерен" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "модулът „RPC::XML::Client” не е намерен; източникът не е проверен" @@ -494,21 +495,25 @@ msgstr "" "грешка при зареждането на perl-модула „Markdown.pm” (%s) или „/usr/bin/" "markdown” (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 #, fuzzy msgid "stylesheet not found" msgstr "шаблонът „%s” не е намерен" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 #, fuzzy msgid "redir page not found" msgstr "шаблонът „%s” не е намерен" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 #, fuzzy msgid "redir cycle is not allowed" msgstr "шаблонът „%s” не е намерен" +#: ../IkiWiki/Plugin/meta.pm:383 +msgid "sort=meta requires a parameter" +msgstr "" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Огледала" @@ -525,10 +530,6 @@ msgstr "" msgid "more" msgstr "" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "функцията „getctime” не е реализирана" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "" @@ -546,39 +547,39 @@ msgstr "Всички страници имат връзки от други ст msgid "bad or missing template" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Акаунтът е създаден. Можете да влезете." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Грешка при създаване на акаунта." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Грешка при изпращане на поща" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "" @@ -609,94 +610,94 @@ msgstr "модулът „RPC::XML::Client” не е намерен; източ msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, fuzzy, perl-format msgid "building %s" msgstr "промяна на %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "крешка при компилиране на файла %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, fuzzy, perl-format msgid "failed to update %s" msgstr "крешка при компилиране на файла %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, fuzzy, perl-format msgid "failed to copy the POT file to %s" msgstr "крешка при компилиране на файла %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, fuzzy, perl-format msgid "failed to translate %s" msgstr "грешка при запис на файла „%s”: %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, fuzzy, perl-format msgid "failed to write %s" msgstr "грешка при запис на файла „%s”: %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 #, fuzzy msgid "failed to translate" msgstr "приставката „linkmap”: грешка при изпълнение на „dot”" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -841,44 +842,44 @@ msgstr "" msgid "no change to the file name was specified" msgstr "не е указан файл на обвивката" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, fuzzy, perl-format msgid "rename %s" msgstr "обновяване на страницата „%s”" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, fuzzy, perl-format msgid "update for rename of %s to %s" msgstr "обновяване на страниците от уики „%s”: %s от потребител „%s”" @@ -983,21 +984,21 @@ msgstr "" msgid "parse fail at line %d: %s" msgstr "грешка при запис на файла „%s”: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "създаване на нова страницa „%s”" + +#: ../IkiWiki/Plugin/template.pm:33 #, fuzzy msgid "missing id parameter" msgstr "липсващ параметър „id” на шаблона" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" +#, fuzzy, perl-format +msgid "%s not found" msgstr "шаблонът „%s” не е намерен" -#: ../IkiWiki/Plugin/template.pm:66 -#, fuzzy -msgid "failed to process:" -msgstr "грешка при обработване на шаблона" - #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" msgstr "" @@ -1056,54 +1057,59 @@ msgstr "" msgid "bad file name %s" msgstr "пропускане на невалидното име на файл „%s”" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "сканиране на „%s”" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "пропускане на невалидното име на файл „%s”" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "премахване на старата страница „%s”" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, fuzzy, perl-format msgid "building %s, which links to %s" msgstr "обновяване на страницата „%s”, съдържаща препратки към „%s”" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, fuzzy, perl-format msgid "removing %s, no longer built by %s" msgstr "премахване на „%s” понеже не се генерира от „%s”" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, fuzzy, perl-format msgid "building %s, which depends on %s" msgstr "обновяване на страницата „%s”, зависеща от „%s”" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, fuzzy, perl-format msgid "building %s, to update its backlinks" msgstr "обновяване на „%s” и осъвременяване на обратните връзки" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, fuzzy, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: неуспех при обновяване на страницата „%s”" @@ -1176,64 +1182,65 @@ msgstr "формат: ikiwiki [опции] източник местоназна msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "генериране на обвивки..." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "обновяване на уики..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "осъвременяване на уики..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Дискусия" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "При използване на пареметъра „--cgi” е необходимо да се укаже и " "местоположението на уикито чрез параметъра „--url”" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, fuzzy, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "открита е циклична завидимост при %s на „%s” на дълбочина %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "непознат вид сортиране „%s”" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "непознат вид сортиране „%s”" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, fuzzy, perl-format msgid "cannot match pages: %s" msgstr "грешка при четене на „%s”: %s" @@ -1258,6 +1265,13 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "" +#, fuzzy +#~ msgid "failed to process" +#~ msgstr "грешка при обработване на шаблона" + +#~ msgid "getctime not implemented" +#~ msgstr "функцията „getctime” не е реализирана" + #, fuzzy #~ msgid "failed to read %s" #~ msgstr "грешка при запис на файла „%s”: %s" @@ -1316,10 +1330,6 @@ msgstr "" #~ "изпълнява като „svn post-commit hook”. Няма да бъдат разпратени " #~ "известявания" -#, fuzzy -#~ msgid "%s not found" -#~ msgstr "шаблонът „%s” не е намерен" - #~ msgid "What's this?" #~ msgstr "Какво е това?" diff --git a/po/cs.po b/po/cs.po index 0b45bb97a..71195bae2 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2009-09-11 20:23+0200\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -55,7 +55,7 @@ msgstr "Nastavení uloženo." msgid "You are banned." msgstr "Jste vyhoštěni." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Chyba" @@ -136,7 +136,7 @@ msgstr "vytvářím novou stránku %s" msgid "deleting bucket.." msgstr "mažu bucket..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "hotovo" @@ -174,7 +174,7 @@ msgstr "chybné jméno souboru s přílohou" msgid "attachment upload" msgstr "příloha nahrána" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "automatické vytváření indexu" @@ -208,55 +208,55 @@ msgstr "komentář musí mít obsah" msgid "Anonymous" msgstr "Anonym" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "chybný název stránky" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "komentář k %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "stránka „%s“ neexistuje, takže nemůžete komentovat" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "komentáře na stránce „%s“ jsou uzamčeny" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "komentář uložen pro schválení" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Váš komentář bude zobrazen po schválení moderátorem" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Přidán komentář" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Přidán komentář: %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "nejste přihlášeni jako správce" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Schvalování komentářů" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "schvalování komentářů" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, fuzzy, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -266,7 +266,7 @@ msgstr[1] "Komentáře" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 #, fuzzy msgid "Comment" msgstr "Komentáře" @@ -297,14 +297,14 @@ msgstr "odstraňuji starý náhled %s" msgid "%s is not an editable page" msgstr "%s není editovatelná stránka" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "vytvářím %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "upravuji %s" @@ -322,9 +322,11 @@ msgstr "nebyl zadán parametr match" msgid "edittemplate %s registered for %s" msgstr "edittemplate %s byla zaregistrována pro %s" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "nepodařilo se zpracovat" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "nepodařilo se zpracovat:" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -352,18 +354,18 @@ msgstr "není stránkou" msgid "%s is an attachment, not a page." msgstr "%s není ani příloha, ani stránka." -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "nejste oprávněni měnit %s" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "nemůžete pracovat se souborem s přístupovým oprávněními %s" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "nejste oprávněni měnit přístupová oprávnění souborů" @@ -445,12 +447,12 @@ msgstr "parametry %s a %s nelze použít zároveň" msgid "Add a new post titled:" msgstr "Přidat nový příspěvek nazvaný:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "neexistující šablona %s" +msgid "template %s not found" +msgstr "šablona %s nebyla nalezena" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client nebyl nalezen, nepinkám" @@ -478,18 +480,23 @@ msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)" msgstr "" "selhalo nahrání perlového modulu Markdown.pm (%s) nebo /usr/bin/markdown (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "styl nebyl nalezen" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "stránka, na kterou vede přesměrování, nebyla nalezena" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "cykly nejsou v přesměrování povoleny" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "vyžaduje parametry „from“ a „to“" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Zrcadla" @@ -507,10 +514,6 @@ msgstr "schvalování komentářů" msgid "more" msgstr "více" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime není implementováno" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "Přihlásit pomocí" @@ -527,39 +530,39 @@ msgstr "Na každou stránku vede odkaz z jiné stránky." msgid "bad or missing template" msgstr "chybná nebo chybějící šablona" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Vytvoření účtu bylo úspěšné. Nyní se můžete přihlásit." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Chyba při vytváření účtu." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "Bez e-mailové adresy nelze zaslat postup na resetování hesla." -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Nepodařilo se odeslat email." -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "Postup na resetování hesla vám byl odeslán na e-mail." -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "chybné URL pro resetování hesla" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "resetování hesla bylo zamítnuto" @@ -589,40 +592,40 @@ msgstr "LWP nebyl nalezen, nepinkám" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "varování: rozpoznána stará verze po4a, doporučen přechod na 0.35." -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "%s není platným kódem jazyka" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" "%s není platnou hodnotou parametru po_link_to, používám po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" "po_link_to=negotiated vyžaduje zapnuté usedirs, používám po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "znovusestavuji všechny stránky, aby se opravily meta nadpisy" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "sestavuji %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "aktualizovány PO soubory" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." @@ -630,7 +633,7 @@ msgstr "" "Nemohu odstranit překlad. Nicméně pokud bude odstraněna hlavní stránka, " "budou odstraněny také její překlady." -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." @@ -638,50 +641,50 @@ msgstr "" "Nemohu přejmenovat překlad. Nicméně pokud bude přejmenována hlavní stránka, " "budou přejmenovány také její překlady." -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "POT soubor (%s) neexistuje" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "nepodařilo se zkopírovat PO soubor na %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "nepodařilo se aktualizovat %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "nepodařilo se zkopírovat POT soubor na %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "N/A" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "nepodařilo se přeložit %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "odstraněny zastaralé PO soubory" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "nepodařilo se zapsat %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "překlad se nezdařil" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" "neplatná gettext data, pro pokračování v úpravách se vraťte na předchozí " @@ -825,44 +828,44 @@ msgstr "%s není ve zdrojovém adresáři a proto nelze přejmenovat" msgid "no change to the file name was specified" msgstr "jméno souboru nebylo změněno" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "neplatné jméno" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s již existuje" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s již na disku existuje" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "přejmenování %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "Také přejmenovat podstránky a přílohy" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Najednou lze přejmenovat pouze jednu přílohu." -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Vyberte přílohu, kterou chcete přejmenovat." -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "přejmenování %s na %s" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "aktualizace pro přejmenování %s na %s" @@ -960,18 +963,19 @@ msgstr "Stáhnout zdrojová data" msgid "parse fail at line %d: %s" msgstr "zpracovávání selhalo na řádku %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "vytvářím novou stránku %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "chybí parametr id" #: ../IkiWiki/Plugin/template.pm:47 #, perl-format -msgid "template %s not found" -msgstr "šablona %s nebyla nalezena" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "nepodařilo se zpracovat:" +msgid "%s not found" +msgstr "%s nenalezen" #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1034,12 +1038,12 @@ msgstr "nemohu určit identitu nedůvěryhodného uživatele %s" msgid "bad file name %s" msgstr "chybné jméno souboru %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "prohledávám %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1048,42 +1052,47 @@ msgstr "" "v cestě ke zdrojovému adresáři (%s) byl nalezen symbolický odkaz -- chcete-" "li to povolit, nastavte proměnnou allow_symlinks_before_srcdir" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "přeskakuji chybné jméno souboru %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s má několik možných zdrojových stránek" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "odstraňuji starou stránku %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "sestavuji %s, která odkazuje na %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "odstraňuji %s, již není sestavována pomocí %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "sestavuji %s, která závisí na %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "sestavuji %s, aby se aktualizovaly zpětné odkazy" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: nelze sestavit %s" @@ -1156,63 +1165,64 @@ msgstr "použití: ikiwiki [volby] zdroj cíl" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup konfigurační.soubor" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "použití: --set proměnná=hodnota" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "použití: --set proměnná=hodnota" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "generuji obaly..." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "znovusestavuji wiki..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "obnovuji wiki..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Diskuse" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "Při použití --cgi musíte pomocí --url zadat url k wiki" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "nelze použít několik rcs modulů" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "nepodařilo se nahrát externí modul vyžadovaný modulem %s: %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Byla rozpoznána smyčka na %s v hloubce %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "ano" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "Pro řazení pomocí title_natural je nutný modul Sort::Naturally" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "neznámý typ řazení %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "neznámý typ řazení %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "nelze vybrat stránky: %s" @@ -1237,6 +1247,18 @@ msgstr "Který uživatel (wiki účet nebo openid) bude správce?" msgid "What is the domain name of the web server?" msgstr "Jaké je doménové jméno webového serveru?" +#~ msgid "failed to process" +#~ msgstr "nepodařilo se zpracovat" + +#~ msgid "nonexistant template %s" +#~ msgstr "neexistující šablona %s" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime není implementováno" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "Pro řazení pomocí title_natural je nutný modul Sort::Naturally" + #~ msgid "failed to read %s" #~ msgstr "nepodařilo se přečíst %s" @@ -1284,9 +1306,6 @@ msgstr "Jaké je doménové jméno webového serveru?" #~ "REV není nastavena, není spuštěna ze svn post-commit, nemohu zaslat " #~ "oznámení" -#~ msgid "%s not found" -#~ msgstr "%s nenalezen" - #~ msgid "What's this?" #~ msgstr "Co to je?" diff --git a/po/da.po b/po/da.po index be7a95e6a..f830d667d 100644 --- a/po/da.po +++ b/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.14159\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2009-07-23 01:07+0200\n" "Last-Translator: Jonas Smedegaard \n" "Language-Team: None\n" @@ -59,7 +59,7 @@ msgstr "Indstillinger gemt" msgid "You are banned." msgstr "Du er banlyst." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Fejl" @@ -140,7 +140,7 @@ msgstr "opretter ny side %s" msgid "deleting bucket.." msgstr "sletter bundt.." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "færdig" @@ -181,7 +181,7 @@ msgstr "dårligt vedhæftningsfilnavn" msgid "attachment upload" msgstr "vedhæftningsoplægning" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "automatisk indeks-dannelse" @@ -215,55 +215,55 @@ msgstr "kommentar skal have indhold" msgid "Anonymous" msgstr "Anonym" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "dårligt sidenavn" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "kommenterer på %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "siden '%s' eksisterer ikke, så du kan ikke kommentere" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "kommentarer på side '%s' er lukket" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "kommentar gemt for moderering" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Din kommentar vil blive tilføjet efter moderatorgenemsyn" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Tilføjede en kommentar" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Tilføjede en kommentar: %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "du er ikke logget på som en administrator" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Kommentarmoderering" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "kommentarkoderering" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, fuzzy, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -273,7 +273,7 @@ msgstr[1] "Kommentarer" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 #, fuzzy msgid "Comment" msgstr "Kommentarer" @@ -304,14 +304,14 @@ msgstr "fjerner gammelt smugkig %s" msgid "%s is not an editable page" msgstr "%s er ikke en redigérbar side" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "opretter %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "redigerer %s" @@ -329,9 +329,11 @@ msgstr "sammenligning ikke angivet" msgid "edittemplate %s registered for %s" msgstr "redigeringsskabelon %s registreret for %s" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "dannelsen mislykkedes" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "dannelsen mislykkedes:" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -360,18 +362,18 @@ msgstr "kan ikke få sider til at passe sammen: %s" msgid "%s is an attachment, not a page." msgstr "%s er ikke en redigérbar side" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "Du har ikke lov til at ændre %s" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "du kan ikke påvirke en fil med modus %s" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "du har ikke lov til at ændre modus for filer" @@ -456,12 +458,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "Tilføj nyt indlæg med følgende titel:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "ikke-eksisterende skabelon: %s" +msgid "template %s not found" +msgstr "skabelon %s ikke fundet" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client ikke fundet, pinger ikke" @@ -491,18 +493,23 @@ msgstr "" "Indlæsning af perl-modulet Markdown.pm (%s) eller /usr/bin/markdown (%s) " "mislykkedes" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "stilsnit (stylesheet) ikke fundet" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "henvisningsside ikke fundet" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "ring af henvisninger er ikke tilladt" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "kræver 'from'- og 'to'-parametre" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Spejle" @@ -520,10 +527,6 @@ msgstr "kommentarkoderering" msgid "more" msgstr "mere" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime ikke implementeret" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "Log på med" @@ -540,40 +543,40 @@ msgstr "Alle sider har henvisninger fra andre sider." msgid "bad or missing template" msgstr "dårlig eller manglende skabelon" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Konto korrekt oprettet. Nu kan du logge på." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Fejl ved kontooprettelse." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" "Ingen emailadresse, så kan ikke sende adgangskodenulstillingsinstruktioner." -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Afsendelse af mail mislykkedes" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "Du har fået tilsendt adgangskodenulstillingsinstruktioner." -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "Ukorrekt adgangskodenumstillings-URL" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "adgangskodenulstilling afvist" @@ -603,12 +606,12 @@ msgstr "LWP ikke fundet, pinger ikke" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "%s er ikke en gyldig sprogkode" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" @@ -616,7 +619,7 @@ msgstr "" "%s er ikke en gyldig værdi for po_link_to, falder tilbage til " "po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" @@ -624,21 +627,21 @@ msgstr "" "po_link_to=negotiated kræver at usedirs er aktiveret, falder tilbage til " "po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "gendanner alle sider for at korrigere meta titler" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "danner %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "opdaterer PO-filer" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." @@ -646,7 +649,7 @@ msgstr "" "Kan ikke fjerne en oversættelse. Fjern i stedet hovedsiden, så fjernes dens " "oversættelser også." -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." @@ -654,50 +657,50 @@ msgstr "" "Kan ikke omdøbe en oversættelse. Omdøb i stedet hovedsiden, så omdøbes dens " "oversættelser også." -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "POT-filen %s eksisterer ikke" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "kopiering af POT-filen til %s mislykkedes" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "opdatering af %s mislykkedes" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "kopiering af POT-filen til %s mislykkedes" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "N/A" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "oversættelse af %s mislykkedes" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "forældede PO filer fjernet" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "skrivning af %s mislykkedes" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "oversættelse mislykkedes" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" "forkert gettext-data, gå tilbage til forrige side og fortsæt redigering" @@ -840,44 +843,44 @@ msgstr "%s er ikke i srcdir, så kan ikke blive omdøbt" msgid "no change to the file name was specified" msgstr "ingen ændring til filnavnet blev angivet" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "ugyldigt navn" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s eksisterer allerede" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s eksisterer allerede på disken" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "omdøb %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "Omdøb også UnderSider og vedhæftninger" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Kun en vedhæftning kan blive omdøbt ad gangen." -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Vælg vedhæftningen som skal omdøbes." -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "omdøb %s til %s" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "opdatering til omdøbning af %s til %s" @@ -975,18 +978,19 @@ msgstr "Direkte datanedlastning" msgid "parse fail at line %d: %s" msgstr "afkodningsfejl på linje %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "opretter ny side %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "manglende id-parameter" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "skabelon %s ikke fundet" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "dannelsen mislykkedes:" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "fødning ikke fundet" #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1049,12 +1053,12 @@ msgstr "kan ikke afgøre id for ikke-tillidsfulde skribent %s" msgid "bad file name %s" msgstr "dårligt filnavn %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "gennemlæser %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1063,42 +1067,47 @@ msgstr "" "symbolsk lænke fundet i srcdir-sti (%s) -- sæt allow_symlinks_before_srcdir " "for at tillade dette" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "udelader forkert filnavn %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s har flere mulige kildesider" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "fjerner gammel side %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "danner %s, som henviser til %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "fjerner %s, ikke længere dannet af %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "danner %s, som afhænger af %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "danner %s, for at opdatere dens krydshenvisninger (backlinks)" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: kan ikke danne %s" @@ -1171,64 +1180,65 @@ msgstr "brug: ikiwiki [valg] kilde mål" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup opsætningsfil" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "brug: --set var=værdi" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "brug: --set var=værdi" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "bygger wrappers.." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "genopbygger wiki..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "genopfrisker wiki..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "Skal angive url til wiki med --url når der bruges --cgi" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "kan ikke bruge flere samtidige RCS-udvidelser" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" "indlæsning af ekstern udvidelse krævet af udvidelsen %s mislykkedes: %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "forudberegningssløkke fundet på %s ved dybde %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "ja" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "Sort::Naturally krævet for title_natural sortering" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "ukendt sorteringsform %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "ukendt sorteringsform %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "kan ikke få sider til at passe sammen: %s" @@ -1253,6 +1263,18 @@ msgstr "Hvilken bruger (wiki konto eller openid) skal være administrator?" msgid "What is the domain name of the web server?" msgstr "Hvad er webserverens domænenavn?" +#~ msgid "failed to process" +#~ msgstr "dannelsen mislykkedes" + +#~ msgid "nonexistant template %s" +#~ msgstr "ikke-eksisterende skabelon: %s" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime ikke implementeret" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "Sort::Naturally krævet for title_natural sortering" + #~ msgid "failed to read %s" #~ msgstr "læsning af %s mislykkedes" diff --git a/po/de.po b/po/de.po index e5a18d47b..2452c8d21 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.14159\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2010-03-14 16:09+0530\n" "Last-Translator: Sebastian Kuhnert \n" "Language-Team: German \n" @@ -56,7 +56,7 @@ msgstr "Einstellungen gespeichert." msgid "You are banned." msgstr "Sie sind ausgeschlossen worden." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Fehler" @@ -137,7 +137,7 @@ msgstr "erstelle neue Seite %s" msgid "deleting bucket.." msgstr "lösche Behälter (bucket)..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "fertig" @@ -176,7 +176,7 @@ msgstr "fehlerhafter Dateiname für Anhang" msgid "attachment upload" msgstr "Anhang hochladen" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "automatische Index-Erstellung" @@ -210,56 +210,56 @@ msgstr "ein Kommentar sollte Inhalt haben" msgid "Anonymous" msgstr "Anonym" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "fehlerhafter Seitenname" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "kommentiere %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" "Seite %s existiert nicht, Sie können sie deshalb auch nicht kommentieren" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "Kommentare zur Seite %s sind gesperrt" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "Der Kommentar wurde zur Moderation gespeichert" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Ihr Kommentar wird nach Moderation verschickt" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Kommentar hinzugefügt" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Kommentar hinzugefügt: %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "Sie sind nicht als Administrator angemeldet" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Kommentar-Moderation" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "Kommentar-Moderation" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -269,7 +269,7 @@ msgstr[1] "%i Kommentare" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "Kommentieren" @@ -299,14 +299,14 @@ msgstr "entferne alte Vorschau %s" msgid "%s is not an editable page" msgstr "Seite %s kann nicht bearbeitet werden" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "erstelle %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "bearbeite %s" @@ -324,9 +324,11 @@ msgstr "Übereinstimmung nicht angegeben" msgid "edittemplate %s registered for %s" msgstr "edittemplate %s für %s registriert" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "Ablauf fehlgeschlagen" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "Fehler beim Ablauf:" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -354,18 +356,18 @@ msgstr "Keine Seite" msgid "%s is an attachment, not a page." msgstr "Seite %s ist ein Anhang und keine Seite." -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "Sie dürfen %s nicht verändern" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "Sie können eine Datei mit den Zugriffsrechten %s nicht nutzen" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "Sie dürfen die Zugriffsrechte der Datei nicht ändern" @@ -451,12 +453,12 @@ msgstr "die Parameter %s und %s können nicht zusammen benutzt werden" msgid "Add a new post titled:" msgstr "Füge einen neuen Beitrag hinzu. Titel:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "nicht-vorhandene Vorlage %s" +msgid "template %s not found" +msgstr "Vorlage %s nicht gefunden" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client nicht gefunden, führe Ping nicht aus" @@ -487,18 +489,23 @@ msgstr "" "laden des Perlmoduls Markdown.pm (%s) oder /usr/bin/markdown (%s) " "fehlgeschlagen" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "Stylesheet nicht gefunden" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "Umleitungsseite nicht gefunden" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "Zyklische Umleitungen sind nicht erlaubt" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "erfordert die Parameter 'from' und 'to'" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Spiegel" @@ -515,10 +522,6 @@ msgstr "Kommentar muss moderiert werden" msgid "more" msgstr "mehr" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime ist nicht implementiert" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "Anmelden mit" @@ -535,41 +538,41 @@ msgstr "Alle Seiten haben mindestens einen Verweis von einer anderen Seite." msgid "bad or missing template" msgstr "fehlerhafte oder fehlende Vorlage" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "Ihre Benutzerseite: " -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "Benutzerseite erstellen" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Kontoerstellung erfolgreich. Sie können sich jetzt anmelden." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Konto konnte nicht erstellt werden." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" "es gibt keine E-Mail Adresse, deshalb kann keine Anweisung zum Zurücksetzen " "des Passwortes zugeschickt werden." -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Es konnte keine E-Mail versandt werden" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "Ihnen wurden Anweisungen zum Zurücksetzen des Passworts zugesandt." -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "fehlerhafte URL zum Zurücksetzen des Passworts" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "zurücksetzen des Passworts abgelehnt" @@ -599,12 +602,12 @@ msgstr "LWP nicht gefunden, führe Ping nicht aus" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "Warnung: Altes po4a erkannt! Empfehle Aktualisierung auf 0.35" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "%s ist keine gültige Sprachkodierung" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" @@ -612,7 +615,7 @@ msgstr "" "%s ist kein gültiger Wert für po_link_to, greife zurück auf " "po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" @@ -620,21 +623,21 @@ msgstr "" "po_link_to=negotiated benötigt usedirs eingeschaltet, greife zurück auf " "po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "um die meta-titeln zu reparieren werden alle Seiten neu erstellt" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "erzeuge %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "PO-Dateien aktualisiert" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." @@ -642,7 +645,7 @@ msgstr "" "Übersetzung kann nicht entfernt werden. Wenn die Master Seite entfernt wird, " "werden auch ihre Übersetzungen entfernt." -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." @@ -650,50 +653,50 @@ msgstr "" "Eine Übersetzung kann nicht umbenannt werden. Wenn die Master Seite " "unbenannt wird, werden auch ihre Übersetzungen unbenannt." -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "POT-Datei (%s) existiert nicht" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "konnte die PO-Datei nicht aus dem Underlay nach %s kopieren" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "aktualisieren von %s fehlgeschlagen" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "kopieren der POT-Datei nach %s fehlgeschlagen" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "N/A" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "übersetzen von %s fehlgeschlagen" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "überflüssige PO-Dateien wurden entfernt" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "schreiben von %s fehlgeschlagen" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "übersetzen fehlgeschlagen" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" "ungültige gettext Datei, gehe zurück zur vorherigen Seite um weiter zu " @@ -839,44 +842,44 @@ msgstr "%s ist nicht im srcdir und kann deshalb nicht umbenannt werden" msgid "no change to the file name was specified" msgstr "es wurde keine Änderung des Dateinamens angegeben" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "unzulässiger Name" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s existiert bereits" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s existiert bereits auf der Festplatte" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "benenne %s um" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "Auch Unterseiten (SubPages) und Anhänge umbenennen" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Es kann immer nur ein Anhang gleichzeitig umbenannt werden." -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Bitte wählen Sie den Anhang aus, der umbenannt werden soll." -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "benenne %s in %s um" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "aktualisiert zum Umbenennen von %s nach %s" @@ -974,18 +977,19 @@ msgstr "Direkter Daten-Download" msgid "parse fail at line %d: %s" msgstr "Auswertungsfehler in Zeile %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "erstelle neue Seite %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "fehlender Parameter id" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "Vorlage %s nicht gefunden" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "Fehler beim Ablauf:" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "Vorlage (feed) nicht gefunden" #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1051,12 +1055,12 @@ msgstr "" msgid "bad file name %s" msgstr "fehlerhafter Dateiname %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "durchsuche %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1065,42 +1069,47 @@ msgstr "" "symbolischer Verweis im srcdir Pfad (%s) gefunden -- setzen Sie " "allow_symlinks_before_srcdir, um dies zu erlauben" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "überspringe fehlerhaften Dateinamen %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s hat mehrere mögliche Quellseiten" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "entferne alte Seite %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "erzeuge %s, die auf %s verweist" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "entferne %s, wird nicht länger von %s erzeugt" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "erzeuge %s, die von %s abhängt" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "erzeuge %s, um dessen Rückverweise zu aktualisieren" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: kann %s nicht erzeugen" @@ -1176,66 +1185,67 @@ msgstr "Aufruf: ikiwiki [Optionen] Quelle Ziel" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup Konfigurationsdatei" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "Aufruf: --set Variable=Wert" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "Aufruf: --set Variable=Wert" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "erzeuge Wrapper.." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "erzeuge Wiki neu.." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "aktualisiere Wiki.." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Es muss eine URL zum Wiki mit --url angegeben werden, wenn --cgi verwandt " "wird" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" "Es können nicht mehrere Versionskontrollsystem-Erweiterungen verwandt werden" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Laden der für %s benötigten externen Erweiterung fehlgeschlagen: %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Präprozessorschleife auf %s in Tiefe %i erkannt" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "ja" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "Sort::Naturally wird benötigt für title_natural sort" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "Unbekannter Sortierungstyp %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "Unbekannter Sortierungstyp %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "Kann die Seiten nicht zuordnen: %s" @@ -1260,6 +1270,18 @@ msgstr "Wer (Wiki-Konto oder OpenID) soll Administrator sein?" msgid "What is the domain name of the web server?" msgstr "Wie lautet der Domainname des Webservers?" +#~ msgid "failed to process" +#~ msgstr "Ablauf fehlgeschlagen" + +#~ msgid "nonexistant template %s" +#~ msgstr "nicht-vorhandene Vorlage %s" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime ist nicht implementiert" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "Sort::Naturally wird benötigt für title_natural sort" + #~ msgid "failed to read %s" #~ msgstr "lesen von %s fehlgeschlagen" diff --git a/po/es.po b/po/es.po index 413572866..a6f3a2c6b 100644 --- a/po/es.po +++ b/po/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2009-06-14 12:32+0200\n" "Last-Translator: Victor Moral \n" "Language-Team: \n" @@ -60,7 +60,7 @@ msgstr "Las preferencias se han guardado." msgid "You are banned." msgstr "Ha sido expulsado." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Error" @@ -142,7 +142,7 @@ msgstr "creando nueva página %s" msgid "deleting bucket.." msgstr "borrando el directorio.." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "completado" @@ -183,7 +183,7 @@ msgstr "nombre de archivo adjunto erróneo" msgid "attachment upload" msgstr "enviado el adjunto" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "creación de índice automática" @@ -217,55 +217,55 @@ msgstr "Un comentario debe tener algún contenido" msgid "Anonymous" msgstr "Anónimo" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "nombre de página erróneo" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "creando comentarios en la página %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "la página '%s' no existe, así que no se puede comentar sobre ella" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "los comentarios para la página '%s' están cerrados" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "comentario guardado a la espera de aprobación" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Su comentario será publicado después de que el moderador lo revise" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Añadir un comentario" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Comentario añadido: %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "No está registrado como un administrador" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Aprobación de comentarios" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "aprobación de comentarios" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, fuzzy, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -275,7 +275,7 @@ msgstr[1] "Comentarios" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 #, fuzzy msgid "Comment" msgstr "Comentarios" @@ -306,14 +306,14 @@ msgstr "eliminando la antigua previsualización %s" msgid "%s is not an editable page" msgstr "la página %s no es modificable" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "creando página %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "modificando página %s" @@ -331,9 +331,11 @@ msgstr "falta indicar la coincidencia de páginas (match)" msgid "edittemplate %s registered for %s" msgstr "plantilla de edición %s registrada para %s" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "fallo en el proceso" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "se ha producido un error fatal mientras procesaba la plantilla:" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -362,18 +364,18 @@ msgstr "no encuentro páginas coincidentes: %s" msgid "%s is an attachment, not a page." msgstr "la página %s no es modificable" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "No puede cambiar %s" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "no puede actuar sobre un archivo con permisos %s" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "No puede cambiar los permisos de acceso de un archivo" @@ -460,12 +462,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "Añadir una entrada nueva titulada:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "la plantilla %s no existe " +msgid "template %s not found" +msgstr "no he encontrado la plantilla %s" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "No he encontrado el componente RPC::XML::Client, no envío señal alguna" @@ -495,18 +497,23 @@ msgstr "" "no he podido cargar el módulo Perl Markdown.pm (%s) ó no he podido ejecutar " "el programa /usr/bin/markdown (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "hoja de estilo no encontrada " -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "falta la página a donde redirigir" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "ciclo de redirección no permitido" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "los parámetros 'from' y 'to' son obligatorios" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Réplicas" @@ -524,10 +531,6 @@ msgstr "aprobación de comentarios" msgid "more" msgstr "ver más" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "la funcionalidad getctime no está incluida" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "Identificarse mediante " @@ -545,43 +548,43 @@ msgstr "Todas las páginas están referenciadas entre sí." msgid "bad or missing template" msgstr "plantilla errónea ó no existente" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Cuenta de usuario creada con éxito. Ahora puede identificarse." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Error creando la cuenta de usuario." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" "No tengo dirección de correo electrónica, así que no puedo enviar " "instrucciones para reiniciar la contraseña" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "No he podido enviar el mensaje de correo electrónico" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" "Las instrucciones para reiniciar la contraseña se le han enviado por correo " "electrónico" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "el url para reiniciar la contraseña es incorrecto" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "reinicio de contraseña denegado" @@ -611,94 +614,94 @@ msgstr "No he encontrado el componente LWP, no envío señal alguna" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, fuzzy, perl-format msgid "%s is not a valid language code" msgstr "%s no es un archivo" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, fuzzy, perl-format msgid "building %s" msgstr "Informaremos a %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, fuzzy, perl-format msgid "POT file (%s) does not exist" msgstr "No existe la página %s." -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "ha fallado la compilación del programa %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, fuzzy, perl-format msgid "failed to update %s" msgstr "ha fallado la compilación del programa %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, fuzzy, perl-format msgid "failed to copy the POT file to %s" msgstr "ha fallado la compilación del programa %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, fuzzy, perl-format msgid "failed to translate %s" msgstr "dimensionamiento fallido: %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, fuzzy, perl-format msgid "failed to write %s" msgstr "dimensionamiento fallido: %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 #, fuzzy msgid "failed to translate" msgstr "no he podido ejecutar el programa dot" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -840,44 +843,44 @@ msgstr "%s no está en el directorio fuente por lo que no puede ser renombrado" msgid "no change to the file name was specified" msgstr "no se ha indicado cambio alguno en el nombre del archivo" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "nombre no válido" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s ya existe" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s ya existe en el disco" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "cambiando de nombre %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "También cambia de nombre las subpáginas y los adjuntos" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Únicamente un adjunto puede ser renombrado a la vez." -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Por favor, seleccione el adjunto al que cambiar el nombre." -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "%s cambia de nombre a %s" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "actualizado el cambio de nombre de %s a %s" @@ -979,18 +982,19 @@ msgstr "Enlace directo para descarga" msgid "parse fail at line %d: %s" msgstr "error de análisis en la línea %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "creando nueva página %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "falta el parámetro \"id\"" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "no he encontrado la plantilla %s" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "se ha producido un error fatal mientras procesaba la plantilla:" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "fuente de datos no encontrada" #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1055,12 +1059,12 @@ msgstr "no puedo determinar el identificador de un usuario no fiable como %s" msgid "bad file name %s" msgstr "el nombre de archivo %s es erróneo" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "explorando %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1069,44 +1073,49 @@ msgstr "" "encontrado un enlace simbólico en la ruta del directorio fuente (%s) -- use " "la directiva allow_symlinks_before_srcdir para permitir la acción" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "ignorando el archivo %s porque su nombre no es correcto" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s tiene mútiples páginas fuente posibles" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "eliminando la antigua página %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, fuzzy, perl-format msgid "building %s, which links to %s" msgstr "convirtiendo la página %s, la cual referencia a %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, fuzzy, perl-format msgid "removing %s, no longer built by %s" msgstr "eliminando la página %s puesto que ya no se deriva de %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, fuzzy, perl-format msgid "building %s, which depends on %s" msgstr "convirtiendo la página %s, la cual depende de %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, fuzzy, perl-format msgid "building %s, to update its backlinks" msgstr "" "convirtiendo la página %s para actualizar la lista de páginas que hacen " "referencia a ella." -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, fuzzy, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: no puedo convertir la página %s" @@ -1181,69 +1190,68 @@ msgstr "uso: ikiwiki [opciones] origen destino" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup archivo_de_configuración" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "uso: --set variable=valor" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "uso: --set variable=valor" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "generando programas auxiliares.." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "reconstruyendo el wiki.." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "actualizando el wiki.." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Comentarios" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Es obligatorio especificar un url al wiki con el parámetro --url si se " "utiliza el parámetro --cgi" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "no puedo emplear varios complementos rcs" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "no he podido cargar el complemento externo %s necesario para %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" "se ha detectado en la página %s un bucle de preprocesado en la iteración " "número %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "si" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "" -"Se necesita el módulo Sort::Naturally para el tipo de ordenación " -"title_natural" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "no conozco este tipo de ordenación %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "no conozco este tipo de ordenación %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "no encuentro páginas coincidentes: %s" @@ -1271,6 +1279,20 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "¿ Cuál es el dominio para el servidor web ?" +#~ msgid "failed to process" +#~ msgstr "fallo en el proceso" + +#~ msgid "nonexistant template %s" +#~ msgstr "la plantilla %s no existe " + +#~ msgid "getctime not implemented" +#~ msgstr "la funcionalidad getctime no está incluida" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "" +#~ "Se necesita el módulo Sort::Naturally para el tipo de ordenación " +#~ "title_natural" + #, fuzzy #~ msgid "failed to read %s" #~ msgstr "no puedo leer de %s: %s " diff --git a/po/fr.po b/po/fr.po index 6be9482ce..b98a498c0 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.141\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2009-08-17 10:06+0200\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" @@ -57,7 +57,7 @@ msgstr "Les préférences ont été enregistrées." msgid "You are banned." msgstr "Vous avez été banni." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Erreur" @@ -138,7 +138,7 @@ msgstr "Création de la nouvelle page %s" msgid "deleting bucket.." msgstr "Suppression du compartiment S3 (« bucket »)..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "Terminé" @@ -176,7 +176,7 @@ msgstr "Nom de la pièce jointe incorrect" msgid "attachment upload" msgstr "Envoi de la pièce jointe" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "Génération de l'index automatique" @@ -210,55 +210,55 @@ msgstr "Un commentaire doit avoir un contenu." msgid "Anonymous" msgstr "Anonyme" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "Nom de page incorrect" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "Faire un commentaire sur %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "La page '%s' n'existe pas, commentaire impossible." -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "Le commentaire pour la page '%s' est terminé." -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "Le commentaire a été enregistré, en attente de « modération »" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Votre commentaire sera publié après vérification par le modérateur" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Commentaire ajouté" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Commentaire ajouté : %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "Vous n'êtes pas authentifié comme administrateur" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Modération du commentaire" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "modération du commentaire" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, fuzzy, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -268,7 +268,7 @@ msgstr[1] "Commentaires" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 #, fuzzy msgid "Comment" msgstr "Commentaires" @@ -299,14 +299,14 @@ msgstr "Suppression de l'ancienne prévisualisation %s" msgid "%s is not an editable page" msgstr "%s n'est pas une page éditable" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "Création de %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "Édition de %s" @@ -324,9 +324,11 @@ msgstr "correspondance non indiquée" msgid "edittemplate %s registered for %s" msgstr "edittemplate %s enregistré pour %s" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "Échec du traitement" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "Échec du traitement :" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -354,18 +356,18 @@ msgstr "Ce n'est pas une page." msgid "%s is an attachment, not a page." msgstr "%s est une pièce jointe, pas une page." -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "Vous n'êtes pas autorisé à modifier %s" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "Vous ne pouvez pas modifier un fichier dont le mode est %s" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "Vous n'êtes pas autorisé à modifier le mode des fichiers" @@ -452,12 +454,12 @@ msgstr "Les paramètres %s et %s ne peuvent être utilisés ensemble." msgid "Add a new post titled:" msgstr "Ajouter un nouvel article dont le titre est :" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "Le modèle de page %s n'existe pas" +msgid "template %s not found" +msgstr "Modèle de page %s introuvable" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client introuvable, pas de réponse au ping" @@ -486,18 +488,23 @@ msgstr "" "Échec du chargement du module Perl Markdown.pm (%s) ou de /usr/bin/markdown " "(%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "Feuille de style introuvable " -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "Page de redirection introuvable" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "Redirection cyclique non autorisée" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "les paramètres « from » et « to » sont nécessaires." + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Miroirs" @@ -515,10 +522,6 @@ msgstr "modération du commentaire" msgid "more" msgstr "lire la suite" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime n'est pas implémenté" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "S'identifier en tant que" @@ -535,43 +538,43 @@ msgstr "Toutes les pages sont liées à d'autres pages." msgid "bad or missing template" msgstr "Modèle de page incorrect ou manquant" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Le compte a été créé. Vous pouvez maintenant vous identifier." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Erreur lors de la création du compte." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" "Aucune adresse indiquée. Impossible d'envoyer les instructions pour " "réinitialiser le mot de passe." -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Impossible d'envoyer un courriel" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" "Vous avez reçu un message contenant les instructions pour réinitialiser le " "mot de passe" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "Adresse pour la réinitialisation du mot de passe incorrecte" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "réinitialisation du mot de passe refusée" @@ -603,12 +606,12 @@ msgstr "" "Note : ancienne version de po4a détectée. Il est recommandé d'installer la " "version 0.35." -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "%s n'est pas un code de langue valable" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" @@ -616,7 +619,7 @@ msgstr "" "%s n'est pas une valeur correcte pour po_link_to, retour à la valeur par " "défaut." -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" @@ -624,23 +627,23 @@ msgstr "" "po_link_to=negotiated nécessite que usedirs soit activé, retour à " "po_link_to=default." -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" "Reconstruction de toutes les pages pour corriger les titres (greffon " "« meta »)." -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "construction de %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "Fichiers PO mis à jour." -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." @@ -648,7 +651,7 @@ msgstr "" "Impossible de supprimer cette traduction. Si la page maître est supprimée, " "alors ses traductions seront supprimées." -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." @@ -656,50 +659,50 @@ msgstr "" "Impossible de renommer cette traduction. Si la page maître est renommée, " "alors ses traductions pourront être renommées." -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "Le fichier POT %s n'existe pas." -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "Impossible de copier le fichier PO underlay dans %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "Impossible de mettre à jour %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "Impossible de copier le fichier POT dans %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "N/A" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "Impossible de traduire %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "Fichiers PO obsolètes supprimés." -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "Impossible de modifier %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "Impossible de traduire" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" "Données gettext incorrectes, retour à la page précédente pour la poursuite " @@ -844,44 +847,44 @@ msgstr "%s n'est pas dans srcdir. Impossible de le renommer" msgid "no change to the file name was specified" msgstr "Aucun changement dans le nom du fichier n'a été spécifié" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "Appellation interdite" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s existe déjà" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s existe déjà sur le disque" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "%s renommé" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "« SubPages » et attachements renommés." -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Modification de pièce jointe : une seule à la fois" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Veuillez sélectionner la pièce jointe à renommer" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "Renomme %s en %s" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "mise à jour, suite au changement de %s en %s" @@ -979,18 +982,19 @@ msgstr "Téléchargement direct des données" msgid "parse fail at line %d: %s" msgstr "Erreur d'analyse à la ligne %d : %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "Création de la nouvelle page %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "Paramètre d'identification manquant" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "Modèle de page %s introuvable" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "Échec du traitement :" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "Flux introuvable " #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1054,12 +1058,12 @@ msgstr "" msgid "bad file name %s" msgstr "Nom de fichier incorrect %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "Examen de %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1068,42 +1072,47 @@ msgstr "" "Lien symbolique trouvé dans l'adresse de srcdir (%s) -- pour l'autoriser, " "activez le paramètre « allow_symlinks_before_srcdir »." -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "Omission du fichier au nom incorrect %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s peut être associé à plusieurs pages source." -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "Suppression de l'ancienne page %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "Reconstruction de %s, qui est lié à %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "Suppression de %s, qui n'est plus rendu par %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "Reconstruction de %s, qui dépend de %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "Reconstruction de %s, afin de mettre à jour ses rétroliens" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki : impossible de reconstruire %s" @@ -1181,64 +1190,65 @@ msgstr "Syntaxe : ikiwiki [options] source destination" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup fichier de configuration" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "Syntaxe : -- set var=valeur" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "Syntaxe : -- set var=valeur" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "Création des fichiers CGI..." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "Reconstruction du wiki..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "Rafraîchissement du wiki..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Discussion" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "Impossible d'utiliser plusieurs systèmes de contrôle des versions" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Impossible de charger le greffon externe nécessaire au greffon %s : %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Une boucle de prétraitement a été détectée sur %s à hauteur de %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "oui" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "Sort::Naturally est nécessaire pour un tri « title_natural »" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "Type de tri %s inconnu" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "Type de tri %s inconnu" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "Impossible de trouver les pages %s" @@ -1263,6 +1273,18 @@ msgstr "Identifiant de l'administrateur (utilisateur du wiki ou openid) :" msgid "What is the domain name of the web server?" msgstr "Nom de domaine du serveur HTTP :" +#~ msgid "failed to process" +#~ msgstr "Échec du traitement" + +#~ msgid "nonexistant template %s" +#~ msgstr "Le modèle de page %s n'existe pas" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime n'est pas implémenté" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "Sort::Naturally est nécessaire pour un tri « title_natural »" + #~ msgid "failed to read %s" #~ msgstr "Impossible de lire %s" diff --git a/po/gu.po b/po/gu.po index d4bfd42c0..4f652358d 100644 --- a/po/gu.po +++ b/po/gu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-gu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2007-01-11 16:05+0530\n" "Last-Translator: Kartik Mistry \n" "Language-Team: Gujarati \n" @@ -54,7 +54,7 @@ msgstr "પ્રાથમિકતાઓ સંગ્રહાઇ." msgid "You are banned." msgstr "તમારા પર પ્રતિબંધ છે." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "ક્ષતિ" @@ -135,7 +135,7 @@ msgstr "નવું પાનું %s બનાવે છે" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "સંપૂર્ણ" @@ -176,7 +176,7 @@ msgstr "" msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "" @@ -208,55 +208,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, fuzzy, perl-format msgid "commenting on %s" msgstr "%s બનાવે છે" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -266,7 +266,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "" @@ -296,14 +296,14 @@ msgstr "જુનાં પાનાં દૂર કરે છે %s" msgid "%s is not an editable page" msgstr "%s એ સુધારી શકાય તેવું પાનું નથી" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "%s બનાવે છે" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "%s સુધારે છે" @@ -323,9 +323,10 @@ msgstr "આવરણ ફાઇલનામ સ્પષ્ટ કરેલ ન msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:138 +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 #, fuzzy -msgid "failed to process" +msgid "failed to process template:" msgstr "ક્રિયા કરવામાં નિષ્ફળ:" #: ../IkiWiki/Plugin/format.pm:30 @@ -356,18 +357,18 @@ msgstr "વાંચી શકાતી નથી %s: %s" msgid "%s is an attachment, not a page." msgstr "%s એ સુધારી શકાય તેવું પાનું નથી" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "" @@ -453,12 +454,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "આ શિર્ષકથી નવું પોસ્ટ ઉમેરો:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "અસ્તિત્વમાં ન હોય તેવું ટેમ્પલેટ %s" +msgid "template %s not found" +msgstr "ટેમ્પલેટ %s મળ્યું નહી" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client મળ્યું નહી, પિંગ કરવામાં આવતું નથી" @@ -485,20 +486,24 @@ msgstr "" msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)" msgstr "Markdown.pm પર્લ મોડ્યુલ (%s) અથવા /usr/bin/markdown (%s) લાવવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "સ્ટાઇલશીટ મળ્યું નહી" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 #, fuzzy msgid "redir page not found" msgstr "ફીડ મળ્યું નહી" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 #, fuzzy msgid "redir cycle is not allowed" msgstr "ફીડ મળ્યું નહી" +#: ../IkiWiki/Plugin/meta.pm:383 +msgid "sort=meta requires a parameter" +msgstr "" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "મિરરો" @@ -515,10 +520,6 @@ msgstr "" msgid "more" msgstr "વધુ" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime અમલમાં મૂકાયેલ નથી" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "" @@ -536,39 +537,39 @@ msgstr "બધા પાનાંઓ બીજા પાનાંઓ વડે msgid "bad or missing template" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "ખાતું બનાવવાનું સફળ. તમે હવે લોગઇન કરી શકો છો." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "ખાતું બનાવવામાં ક્ષતિ." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "મેઇલ મોકલવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "" @@ -599,94 +600,94 @@ msgstr "RPC::XML::Client મળ્યું નહી, પિંગ કરવા msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, fuzzy, perl-format msgid "%s is not a valid language code" msgstr "%s એ સુધારી શકાય તેવું પાનું નથી" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, fuzzy, perl-format msgid "building %s" msgstr "%s સુધારે છે" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "%s કમ્પાઇલ કરવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, fuzzy, perl-format msgid "failed to update %s" msgstr "%s કમ્પાઇલ કરવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, fuzzy, perl-format msgid "failed to copy the POT file to %s" msgstr "%s કમ્પાઇલ કરવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, fuzzy, perl-format msgid "failed to translate %s" msgstr "માપ બદલવામાં નિષ્ફળ: %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, fuzzy, perl-format msgid "failed to write %s" msgstr "%s લખવામાં નિષ્ફળ: %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 #, fuzzy msgid "failed to translate" msgstr "ડોટ ચલાવવામાં નિષ્ફળ" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -831,44 +832,44 @@ msgstr "" msgid "no change to the file name was specified" msgstr "આવરણ ફાઇલનામ સ્પષ્ટ કરેલ નથી" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, fuzzy, perl-format msgid "rename %s" msgstr "રેન્ડર કરે છે %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, fuzzy, perl-format msgid "update for rename of %s to %s" msgstr "%s નો સુધારો %s નાં %s વડે" @@ -970,19 +971,20 @@ msgstr "સીધી માહિતી ડાઉનલોડ" msgid "parse fail at line %d: %s" msgstr "ઉકેલવાનું લીટી %d પર નિષ્ફળ: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "નવું પાનું %s બનાવે છે" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "ખોવાયેલ આઇડી વિકલ્પ" #: ../IkiWiki/Plugin/template.pm:47 #, perl-format -msgid "template %s not found" +msgid "%s not found" msgstr "ટેમ્પલેટ %s મળ્યું નહી" -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "ક્રિયા કરવામાં નિષ્ફળ:" - #: ../IkiWiki/Plugin/teximg.pm:72 #, fuzzy msgid "missing tex code" @@ -1042,54 +1044,59 @@ msgstr "" msgid "bad file name %s" msgstr "ખરાબ ફાઇલ નામ છોડી દે છે %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "%s શોધે છે" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "ખરાબ ફાઇલ નામ છોડી દે છે %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "જુનાં પાનાં દૂર કરે છે %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, fuzzy, perl-format msgid "building %s, which links to %s" msgstr "રેન્ડર કરે છે %s, જે %s સાથે જોડાણ ધરાવે છે" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, fuzzy, perl-format msgid "removing %s, no longer built by %s" msgstr "દૂર કરે છે %s, હવે %s વડે રેન્ડર કરાતું નથી" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, fuzzy, perl-format msgid "building %s, which depends on %s" msgstr "રેન્ડર કરે છે %s, જે %s પર આધારિત છે" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, fuzzy, perl-format msgid "building %s, to update its backlinks" msgstr "રેન્ડર કરે છે %s, તેનાં પાછળનાં જોડાણો સુધારવા માટે" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, fuzzy, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: %s રેન્ડર કરી શકાતું નથી" @@ -1162,62 +1169,63 @@ msgstr "ઉપયોગ: ikiwiki [વિકલ્પો] source dest" msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "આવરણ બનાવે છે.." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "વીકી ફરીથી બનાવે છે.." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "વીકીને તાજી કરે છે.." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "ચર્ચા" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "જ્યારે --cgi ઉપયોગ કરતાં હોય ત્યારે વીકીનું યુઆરએલ સ્પષ્ટ કરવું જ પડશે" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, fuzzy, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "%s પર શોધાયેલ લુપ %s પર ચલાવે છે %i ઉંડાણ પર" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "અજાણ્યો ગોઠવણી પ્રકાર %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "અજાણ્યો ગોઠવણી પ્રકાર %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, fuzzy, perl-format msgid "cannot match pages: %s" msgstr "વાંચી શકાતી નથી %s: %s" @@ -1242,6 +1250,16 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "" +#, fuzzy +#~ msgid "failed to process" +#~ msgstr "ક્રિયા કરવામાં નિષ્ફળ:" + +#~ msgid "nonexistant template %s" +#~ msgstr "અસ્તિત્વમાં ન હોય તેવું ટેમ્પલેટ %s" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime અમલમાં મૂકાયેલ નથી" + #, fuzzy #~ msgid "failed to read %s" #~ msgstr "%s વાંચવામાં નિષ્ફળ: %s" @@ -1295,9 +1313,6 @@ msgstr "" #~ msgstr "" #~ "REV ગોઠવેલ નથી, svn post-commit hook માંથી ચાલતું નથી, નોંધ મોકલી શકાશે નહી" -#~ msgid "%s not found" -#~ msgstr "ટેમ્પલેટ %s મળ્યું નહી" - #~ msgid "What's this?" #~ msgstr "આ શું છે?" diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index c2f4e24a9..638e724d5 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,7 +55,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "" @@ -136,7 +136,7 @@ msgstr "" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "" @@ -174,7 +174,7 @@ msgstr "" msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "" @@ -206,55 +206,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -264,7 +264,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "" @@ -294,14 +294,14 @@ msgstr "" msgid "%s is not an editable page" msgstr "" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "" @@ -319,8 +319,9 @@ msgstr "" msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +msgid "failed to process template:" msgstr "" #: ../IkiWiki/Plugin/format.pm:30 @@ -349,18 +350,18 @@ msgstr "" msgid "%s is an attachment, not a page." msgstr "" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "" @@ -442,12 +443,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" +msgid "template %s not found" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "" @@ -474,18 +475,22 @@ msgstr "" msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "" +#: ../IkiWiki/Plugin/meta.pm:383 +msgid "sort=meta requires a parameter" +msgstr "" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "" @@ -502,10 +507,6 @@ msgstr "" msgid "more" msgstr "" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "" @@ -522,39 +523,39 @@ msgstr "" msgid "bad or missing template" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "" @@ -584,93 +585,93 @@ msgstr "" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -812,44 +813,44 @@ msgstr "" msgid "no change to the file name was specified" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "" @@ -947,17 +948,18 @@ msgstr "" msgid "parse fail at line %d: %s" msgstr "" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, perl-format +msgid "creating tag page %s" +msgstr "" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "" #: ../IkiWiki/Plugin/template.pm:47 #, perl-format -msgid "template %s not found" -msgstr "" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" +msgid "%s not found" msgstr "" #: ../IkiWiki/Plugin/teximg.pm:72 @@ -1017,54 +1019,59 @@ msgstr "" msgid "bad file name %s" msgstr "" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." msgstr "" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:434 +#, perl-format +msgid "removing obsolete %s" +msgstr "" + +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "" @@ -1137,62 +1144,63 @@ msgstr "" msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "" -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "" -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "" -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" +#: ../IkiWiki.pm:2009 +#, perl-format +msgid "invalid sort type %s" msgstr "" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "" diff --git a/po/it.po b/po/it.po index b1b3dbd55..45efc2d3f 100644 --- a/po/it.po +++ b/po/it.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2009-08-16 11:01+0100\n" "Last-Translator: Luca Bruno \n" "Language-Team: Italian TP \n" @@ -53,7 +53,7 @@ msgstr "Preferenze salvate." msgid "You are banned." msgstr "Avete ricevuto un ban." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Errore" @@ -135,7 +135,7 @@ msgstr "creazione nuova pagina %s" msgid "deleting bucket.." msgstr "eliminazione contenitore..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "fatto" @@ -173,7 +173,7 @@ msgstr "nome file dell'allegato non valido" msgid "attachment upload" msgstr "carica allegato" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "generazione automatica dell'indice" @@ -207,55 +207,55 @@ msgstr "i commenti devono avere un contenuto" msgid "Anonymous" msgstr "Anonimo" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "nome pagina non valido" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, perl-format msgid "commenting on %s" msgstr "commento su %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "la pagina «%s» non esiste, impossibile commentarla" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "i commenti per la pagina «%s» sono chiusi" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "commento trattenuto per moderazione" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "Il commento sarà pubblicato dopo la verifica del moderatore" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "Aggiunto commento" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "Aggiunto commento: %s" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "non siete autenticati come amministratore" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "Moderazione commenti" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "moderazione commento" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, fuzzy, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -265,7 +265,7 @@ msgstr[1] "Commenti" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 #, fuzzy msgid "Comment" msgstr "Commenti" @@ -296,14 +296,14 @@ msgstr "rimozione vecchia anteprima %s" msgid "%s is not an editable page" msgstr "%s non è una pagina modificabile" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "creazione %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "modifica %s" @@ -321,9 +321,11 @@ msgstr "corrispondenza non specificata" msgid "edittemplate %s registered for %s" msgstr "edittemplate %s registrato per %s" -#: ../IkiWiki/Plugin/edittemplate.pm:138 -msgid "failed to process" -msgstr "errore nell'elaborazione" +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 +#, fuzzy +msgid "failed to process template:" +msgstr "errore nell'elaborazione:" #: ../IkiWiki/Plugin/format.pm:30 msgid "must specify format and text" @@ -351,18 +353,18 @@ msgstr "non è una pagina" msgid "%s is an attachment, not a page." msgstr "%s è un allegato, non una pagina." -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "non è permesso modificare %s" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "non è permesso lavorare su un file in modalità %s" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "non è permesso cambiare la modalità del file" @@ -447,12 +449,12 @@ msgstr "i parametri %s e %s non possono essere usati insieme" msgid "Add a new post titled:" msgstr "Aggiungere un nuovo articolo dal titolo:" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "modello %s non esistente" +msgid "template %s not found" +msgstr "modello %s non trovato" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client non trovato, impossibile inviare ping" @@ -481,18 +483,23 @@ msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)" msgstr "" "impossibile caricare il modulo perl Markdown.pm (%s) o /usr/bin/markdown (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 msgid "stylesheet not found" msgstr "foglio di stile non trovato" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 msgid "redir page not found" msgstr "pagina di reindirizzamento non trovata" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 msgid "redir cycle is not allowed" msgstr "ciclo di reindirizzamento non ammesso" +#: ../IkiWiki/Plugin/meta.pm:383 +#, fuzzy +msgid "sort=meta requires a parameter" +msgstr "sono richiesti i parametri \"to\" e \"from\"" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Mirror" @@ -510,10 +517,6 @@ msgstr "moderazione commento" msgid "more" msgstr "altro" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime non implementata" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "Accedi tramite" @@ -530,42 +533,42 @@ msgstr "Tutte le pagine hanno collegamenti in entrata da altre pagine." msgid "bad or missing template" msgstr "modello errato o mancante" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Account creato con successo. È ora possibile effettuare l'accesso." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Errore nella creazione dell'account." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" "Nessun indirizzo email, impossibile inviare per email le istruzioni per " "reimpostare la password." -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Impossibile spedire il messaggio" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" "Il messaggio con le istruzioni per reimpostare la password è stato inviato." -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "url per il reset della password non corretto" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "reset della password non permesso" @@ -597,19 +600,19 @@ msgstr "" "attenzione: è presente un vecchio po4a. Si raccomanda di aggiornare almeno " "alla versione 0.35." -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "%s non è una codifica di lingua valida" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" "%s non è un valore per po_link_to valido, verrà utilizzato po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" @@ -617,21 +620,21 @@ msgstr "" "po_link_to=negotiated richiede che venga abilitato usedirs, verrà utilizzato " "po_link_to=default" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "rigenerazione di tutte le pagine per sistemare i meta-titoli" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, perl-format msgid "building %s" msgstr "compilazione di %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "file PO aggiornati" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." @@ -639,7 +642,7 @@ msgstr "" "Impossibile eliminare una traduzione. Tuttavia, se la pagina principale è " "stata eliminata anche le traduzioni lo saranno." -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." @@ -647,50 +650,50 @@ msgstr "" "Impossibile rinominare una traduzione. Tuttavia, se la pagina principale è " "stata rinominata anche le traduzioni lo saranno." -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "Il file POT (%s) non esiste" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "impossibile copiare il file PO di underlay in %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, perl-format msgid "failed to update %s" msgstr "impossibile aggiornare %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, perl-format msgid "failed to copy the POT file to %s" msgstr "impossibile copiare il file POT in %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "N/D" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "impossibile tradurre %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "file PO obsoleti rimossi" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, perl-format msgid "failed to write %s" msgstr "impossibile scrivere %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 msgid "failed to translate" msgstr "impossibile tradurre" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" "dati gettext non validi, tornare alle pagina precedente per continuare le " @@ -836,44 +839,44 @@ msgstr "%s non è in src, quindi non può essere rinominato" msgid "no change to the file name was specified" msgstr "non è stata specificata nessuna modifica al nome del file" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "nome non valido" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "%s esiste già" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "%s già presente su disco" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, perl-format msgid "rename %s" msgstr "rinomina di %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "Rinomina anche SottoPagine e allegati" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "Si può rinominare un solo allegato alla volta." -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "Selezionare l'allegato da rinominare." -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "rinomina %s in %s" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "aggiornamento per rinomina di %s in %s" @@ -971,18 +974,19 @@ msgstr "Scaricamento diretto dei dati" msgid "parse fail at line %d: %s" msgstr "errore di interpretazione alla riga %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "creazione nuova pagina %s" + +#: ../IkiWiki/Plugin/template.pm:33 msgid "missing id parameter" msgstr "parametro id mancante" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "modello %s non trovato" - -#: ../IkiWiki/Plugin/template.pm:66 -msgid "failed to process:" -msgstr "errore nell'elaborazione:" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "notiziario non trovato" #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" @@ -1045,12 +1049,12 @@ msgstr "impossibile determinare l'id del committer non fidato %s" msgid "bad file name %s" msgstr "nome file %s scorretto" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "scansione %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " @@ -1059,42 +1063,47 @@ msgstr "" "collegamento simbolico trovato nel percorso srcdir (%s) -- impostare " "allow_symlinks_before_srcdir per abilitare questa configurazione" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "ignorato il file dal nome scorretto %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "%s ha diverse pagine sorgenti possibili" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "rimozione della vecchia pagina %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, perl-format msgid "building %s, which links to %s" msgstr "compilazione di %s, che è collegato a %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, perl-format msgid "removing %s, no longer built by %s" msgstr "rimozione di %s, non più richiesto da %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, perl-format msgid "building %s, which depends on %s" msgstr "compilazione di %s, che dipende da %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, perl-format msgid "building %s, to update its backlinks" msgstr "compilazione di %s, per aggiornare i collegamenti ai precedenti" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: impossibile compilare %s" @@ -1168,63 +1177,64 @@ msgstr "utilizzo: ikiwiki [opzioni] sorgente destinazione" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup configfile" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "utilizzo: --set var=valore" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 #, fuzzy msgid "usage: --set-yaml var=value" msgstr "utilizzo: --set var=valore" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "generazione contenitori..." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "ricostruzione wiki..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "aggiornamento wiki..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Discussione" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "Occorre specificare l'url del wiki tramite --url quando si usa --cgi" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "impossibile usare più plugin rcs" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "impossibile caricare il plugin esterno per il plugin %s: %s" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "ciclo del preprocessore individuato su %s alla profondità %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "sì" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "Sort::Naturally è richiesto per l'ordinamento title_natural" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "ordinamento %s sconosciuto" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "ordinamento %s sconosciuto" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, perl-format msgid "cannot match pages: %s" msgstr "impossibile trovare pagine corrispondenti: %s" @@ -1249,6 +1259,18 @@ msgstr "Quale utente (openid o del wiki) sarà l'amministratore?" msgid "What is the domain name of the web server?" msgstr "Qual è il nome del dominio del server web?" +#~ msgid "failed to process" +#~ msgstr "errore nell'elaborazione" + +#~ msgid "nonexistant template %s" +#~ msgstr "modello %s non esistente" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime non implementata" + +#~ msgid "Sort::Naturally needed for title_natural sort" +#~ msgstr "Sort::Naturally è richiesto per l'ordinamento title_natural" + #~ msgid "failed to read %s" #~ msgstr "impossibile leggere %s" diff --git a/po/pl.po b/po/pl.po index 9fb3cacc0..837c5acd2 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 1.51\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2007-04-27 22:05+0200\n" "Last-Translator: Pawel Tecza \n" "Language-Team: Debian L10n Polish \n" @@ -57,7 +57,7 @@ msgstr "Preferencje zapisane." msgid "You are banned." msgstr "Twój dostęp został zabroniony przez administratora." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Błąd" @@ -139,7 +139,7 @@ msgstr "tworzenie nowej strony %s" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "gotowe" @@ -180,7 +180,7 @@ msgstr "" msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "" @@ -212,55 +212,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, fuzzy, perl-format msgid "commenting on %s" msgstr "tworzenie %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -270,7 +270,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "" @@ -300,14 +300,14 @@ msgstr "usuwanie starej strony %s" msgid "%s is not an editable page" msgstr "Strona %s nie może być edytowana" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "tworzenie %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "edycja %s" @@ -327,9 +327,10 @@ msgstr "nieokreślona nazwa pliku osłony" msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:138 +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 #, fuzzy -msgid "failed to process" +msgid "failed to process template:" msgstr "awaria w trakcie przetwarzania:" #: ../IkiWiki/Plugin/format.pm:30 @@ -360,18 +361,18 @@ msgstr "awaria w trakcie odczytu %s: %s" msgid "%s is an attachment, not a page." msgstr "Strona %s nie może być edytowana" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "" @@ -460,12 +461,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "Tytuł nowego wpisu" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "brakujący szablon %s" +msgid "template %s not found" +msgstr "nieznaleziony szablon %s" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "Nieznaleziony moduł RPC::XML::Client, brak możliwości pingowania" @@ -497,21 +498,25 @@ msgstr "" "Awaria w trakcie ładowania perlowego modułu Markdown.pm (%s) lub " "uruchamiania programu /usr/bin/markdown (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 #, fuzzy msgid "stylesheet not found" msgstr "nieznaleziony szablon ze stylami CSS" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 #, fuzzy msgid "redir page not found" msgstr "nieznaleziony kanał RSS" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 #, fuzzy msgid "redir cycle is not allowed" msgstr "nieznaleziony kanał RSS" +#: ../IkiWiki/Plugin/meta.pm:383 +msgid "sort=meta requires a parameter" +msgstr "" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Kopie lustrzane" @@ -528,10 +533,6 @@ msgstr "" msgid "more" msgstr "więcej" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "niedostępna funkcja getctime" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "" @@ -549,39 +550,39 @@ msgstr "Dla każdej strony istnieje odnośnik z innej strony" msgid "bad or missing template" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Konto założone pomyślnie. Teraz można zalogować się." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Błąd w trakcie zakładania konta." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Awaria w trakcie wysyłania wiadomości" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "" @@ -612,94 +613,94 @@ msgstr "Nieznaleziony moduł RPC::XML::Client, brak możliwości pingowania" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, fuzzy, perl-format msgid "%s is not a valid language code" msgstr "Strona %s nie może być edytowana" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, fuzzy, perl-format msgid "building %s" msgstr "edycja %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "awaria w trakcie kompilowania %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, fuzzy, perl-format msgid "failed to update %s" msgstr "awaria w trakcie kompilowania %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, fuzzy, perl-format msgid "failed to copy the POT file to %s" msgstr "awaria w trakcie kompilowania %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, fuzzy, perl-format msgid "failed to translate %s" msgstr "awaria w trakcie zmiany rozmiaru: %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, fuzzy, perl-format msgid "failed to write %s" msgstr "awaria w trakcie zapisu %s: %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 #, fuzzy msgid "failed to translate" msgstr "awaria w trakcie uruchamiania dot" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -846,44 +847,44 @@ msgstr "" msgid "no change to the file name was specified" msgstr "nieokreślona nazwa pliku osłony" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, fuzzy, perl-format msgid "rename %s" msgstr "renderowanie %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, fuzzy, perl-format msgid "update for rename of %s to %s" msgstr "aktualizacja stron wiki %s: %s przez użytkownika %s" @@ -990,20 +991,20 @@ msgstr "Bezpośrednie pobieranie danych" msgid "parse fail at line %d: %s" msgstr "awaria w trakcie przetwarzania linii %d: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "tworzenie nowej strony %s" + +#: ../IkiWiki/Plugin/template.pm:33 #, fuzzy msgid "missing id parameter" msgstr "brakujący parametr id" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" -msgstr "nieznaleziony szablon %s" - -#: ../IkiWiki/Plugin/template.pm:66 -#, fuzzy -msgid "failed to process:" -msgstr "awaria w trakcie przetwarzania:" +#, fuzzy, perl-format +msgid "%s not found" +msgstr "nie znaleziono %s" #: ../IkiWiki/Plugin/teximg.pm:72 #, fuzzy @@ -1064,54 +1065,59 @@ msgstr "" msgid "bad file name %s" msgstr "pomijanie nieprawidłowej nazwy pliku %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "skanowanie %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "pomijanie nieprawidłowej nazwy pliku %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "usuwanie starej strony %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, fuzzy, perl-format msgid "building %s, which links to %s" msgstr "renderowanie %s z odnośnikiem do %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, fuzzy, perl-format msgid "removing %s, no longer built by %s" msgstr "usuwanie %s nie tworzonego już przez %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, fuzzy, perl-format msgid "building %s, which depends on %s" msgstr "renderowanie %s zależącego od %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, fuzzy, perl-format msgid "building %s, to update its backlinks" msgstr "renderowanie %s w celu aktualizacji powrotnych odnośników" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, fuzzy, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: awaria w trakcie tworzenia %s" @@ -1184,64 +1190,65 @@ msgstr "użycie: ikiwiki [parametry] źródło cel" msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "tworzenie osłon..." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "przebudowywanie wiki..." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "odświeżanie wiki..." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Dyskusja" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Użycie parametru --cgi wymaga podania adresu URL do wiki za pomocą parametru " "--url" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, fuzzy, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "polecenie preprocesora %s wykryte w %s na głębokości %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "nieznany sposób sortowania %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "nieznany sposób sortowania %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, fuzzy, perl-format msgid "cannot match pages: %s" msgstr "awaria w trakcie odczytu %s: %s" @@ -1266,6 +1273,16 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "" +#, fuzzy +#~ msgid "failed to process" +#~ msgstr "awaria w trakcie przetwarzania:" + +#~ msgid "nonexistant template %s" +#~ msgstr "brakujący szablon %s" + +#~ msgid "getctime not implemented" +#~ msgstr "niedostępna funkcja getctime" + #, fuzzy #~ msgid "failed to read %s" #~ msgstr "awaria w trakcie odczytu %s: %s" @@ -1323,10 +1340,6 @@ msgstr "" #~ "Brak możliwości wysłania powiadomień od Subversion przez \"haczyk\" post-" #~ "commit z powodu nieustawionego parametru REV" -#, fuzzy -#~ msgid "%s not found" -#~ msgstr "nie znaleziono %s" - #~ msgid "What's this?" #~ msgstr "Więcej o OpenID" diff --git a/po/sv.po b/po/sv.po index 0d4c6202e..2cba1cc2e 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-03 14:18-0400\n" +"POT-Creation-Date: 2010-04-24 16:15-0400\n" "PO-Revision-Date: 2007-01-10 23:47+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -54,7 +54,7 @@ msgstr "Inställningar sparades." msgid "You are banned." msgstr "Du är bannlyst." -#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1296 +#: ../IkiWiki/CGI.pm:411 ../IkiWiki/CGI.pm:412 ../IkiWiki.pm:1291 msgid "Error" msgstr "Fel" @@ -136,7 +136,7 @@ msgstr "skapar nya sidan %s" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:230 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:231 msgid "done" msgstr "klar" @@ -177,7 +177,7 @@ msgstr "" msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:105 +#: ../IkiWiki/Plugin/autoindex.pm:117 msgid "automatic index generation" msgstr "" @@ -209,55 +209,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:340 ../IkiWiki/Plugin/editpage.pm:98 +#: ../IkiWiki/Plugin/comments.pm:342 ../IkiWiki/Plugin/editpage.pm:98 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:345 +#: ../IkiWiki/Plugin/comments.pm:347 #, fuzzy, perl-format msgid "commenting on %s" msgstr "skapar %s" -#: ../IkiWiki/Plugin/comments.pm:363 +#: ../IkiWiki/Plugin/comments.pm:365 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:370 +#: ../IkiWiki/Plugin/comments.pm:372 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:467 +#: ../IkiWiki/Plugin/comments.pm:469 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:471 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:482 +#: ../IkiWiki/Plugin/comments.pm:484 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:486 +#: ../IkiWiki/Plugin/comments.pm:488 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:528 ../IkiWiki/Plugin/websetup.pm:270 +#: ../IkiWiki/Plugin/comments.pm:530 ../IkiWiki/Plugin/websetup.pm:270 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:579 +#: ../IkiWiki/Plugin/comments.pm:581 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:618 +#: ../IkiWiki/Plugin/comments.pm:620 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:761 +#: ../IkiWiki/Plugin/comments.pm:759 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -267,7 +267,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:771 +#: ../IkiWiki/Plugin/comments.pm:769 msgid "Comment" msgstr "" @@ -297,14 +297,14 @@ msgstr "tar bort gammal sida %s" msgid "%s is not an editable page" msgstr "" -#: ../IkiWiki/Plugin/editpage.pm:296 +#: ../IkiWiki/Plugin/editpage.pm:295 #, perl-format msgid "creating %s" msgstr "skapar %s" -#: ../IkiWiki/Plugin/editpage.pm:314 ../IkiWiki/Plugin/editpage.pm:333 -#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:387 -#: ../IkiWiki/Plugin/editpage.pm:426 +#: ../IkiWiki/Plugin/editpage.pm:313 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:386 +#: ../IkiWiki/Plugin/editpage.pm:425 #, perl-format msgid "editing %s" msgstr "redigerar %s" @@ -324,9 +324,10 @@ msgstr "filnamn för wrapper har inte angivits" msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:138 +#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/template.pm:44 #, fuzzy -msgid "failed to process" +msgid "failed to process template:" msgstr "misslyckades med att behandla mall:" #: ../IkiWiki/Plugin/format.pm:30 @@ -357,18 +358,18 @@ msgstr "kan inte läsa %s: %s" msgid "%s is an attachment, not a page." msgstr "" -#: ../IkiWiki/Plugin/git.pm:658 ../IkiWiki/Plugin/git.pm:676 +#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 #: ../IkiWiki/Receive.pm:130 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:698 +#: ../IkiWiki/Plugin/git.pm:727 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:702 +#: ../IkiWiki/Plugin/git.pm:731 msgid "you are not allowed to change file modes" msgstr "" @@ -455,12 +456,12 @@ msgstr "" msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:333 +#: ../IkiWiki/Plugin/inline.pm:342 #, perl-format -msgid "nonexistant template %s" -msgstr "" +msgid "template %s not found" +msgstr "mallen %s hittades inte" -#: ../IkiWiki/Plugin/inline.pm:625 +#: ../IkiWiki/Plugin/inline.pm:635 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client hittades inte, pingar inte" @@ -490,21 +491,25 @@ msgstr "" "misslyckades med att läsa in Perl-modulen Markdown.pm (%s) eller /usr/bin/" "markdown (%s)" -#: ../IkiWiki/Plugin/meta.pm:162 +#: ../IkiWiki/Plugin/meta.pm:174 #, fuzzy msgid "stylesheet not found" msgstr "mallen %s hittades inte" -#: ../IkiWiki/Plugin/meta.pm:200 +#: ../IkiWiki/Plugin/meta.pm:212 #, fuzzy msgid "redir page not found" msgstr "mallen %s hittades inte" -#: ../IkiWiki/Plugin/meta.pm:214 +#: ../IkiWiki/Plugin/meta.pm:226 #, fuzzy msgid "redir cycle is not allowed" msgstr "mallen %s hittades inte" +#: ../IkiWiki/Plugin/meta.pm:383 +msgid "sort=meta requires a parameter" +msgstr "" + #: ../IkiWiki/Plugin/mirrorlist.pm:44 msgid "Mirrors" msgstr "Speglar" @@ -521,10 +526,6 @@ msgstr "" msgid "more" msgstr "" -#: ../IkiWiki/Plugin/norcs.pm:66 -msgid "getctime not implemented" -msgstr "getctime inte implementerad" - #: ../IkiWiki/Plugin/openid.pm:62 msgid "Log in with" msgstr "" @@ -542,39 +543,39 @@ msgstr "Alla sidor länkas till av andra sidor." msgid "bad or missing template" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:229 +#: ../IkiWiki/Plugin/passwordauth.pm:231 msgid "Your user page: " msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:236 +#: ../IkiWiki/Plugin/passwordauth.pm:238 msgid "Create your user page" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:264 +#: ../IkiWiki/Plugin/passwordauth.pm:268 msgid "Account creation successful. Now you can Login." msgstr "Kontot har skapats. Du kan nu logga in." -#: ../IkiWiki/Plugin/passwordauth.pm:267 +#: ../IkiWiki/Plugin/passwordauth.pm:271 msgid "Error creating account." msgstr "Fel vid skapandet av konto." -#: ../IkiWiki/Plugin/passwordauth.pm:274 +#: ../IkiWiki/Plugin/passwordauth.pm:278 msgid "No email address, so cannot email password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:308 +#: ../IkiWiki/Plugin/passwordauth.pm:312 msgid "Failed to send mail" msgstr "Misslyckades med att skicka e-post" -#: ../IkiWiki/Plugin/passwordauth.pm:310 +#: ../IkiWiki/Plugin/passwordauth.pm:314 msgid "You have been mailed password reset instructions." msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:345 +#: ../IkiWiki/Plugin/passwordauth.pm:349 msgid "incorrect password reset url" msgstr "" -#: ../IkiWiki/Plugin/passwordauth.pm:348 +#: ../IkiWiki/Plugin/passwordauth.pm:352 msgid "password reset denied" msgstr "" @@ -605,94 +606,94 @@ msgstr "RPC::XML::Client hittades inte, pingar inte" msgid "warning: Old po4a detected! Recommend upgrade to 0.35." msgstr "" -#: ../IkiWiki/Plugin/po.pm:139 +#: ../IkiWiki/Plugin/po.pm:140 #, perl-format msgid "%s is not a valid language code" msgstr "" -#: ../IkiWiki/Plugin/po.pm:151 +#: ../IkiWiki/Plugin/po.pm:152 #, perl-format msgid "" "%s is not a valid value for po_link_to, falling back to po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:156 +#: ../IkiWiki/Plugin/po.pm:157 msgid "" "po_link_to=negotiated requires usedirs to be enabled, falling back to " "po_link_to=default" msgstr "" -#: ../IkiWiki/Plugin/po.pm:386 +#: ../IkiWiki/Plugin/po.pm:388 #, perl-format msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:390 ../IkiWiki/Render.pm:655 +#: ../IkiWiki/Plugin/po.pm:392 ../IkiWiki/Render.pm:761 #, fuzzy, perl-format msgid "building %s" msgstr "redigerar %s" -#: ../IkiWiki/Plugin/po.pm:428 +#: ../IkiWiki/Plugin/po.pm:430 msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:452 +#: ../IkiWiki/Plugin/po.pm:454 msgid "" "Can not remove a translation. If the master page is removed, however, its " "translations will be removed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:472 +#: ../IkiWiki/Plugin/po.pm:474 msgid "" "Can not rename a translation. If the master page is renamed, however, its " "translations will be renamed as well." msgstr "" -#: ../IkiWiki/Plugin/po.pm:871 +#: ../IkiWiki/Plugin/po.pm:873 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:885 +#: ../IkiWiki/Plugin/po.pm:887 #, fuzzy, perl-format msgid "failed to copy underlay PO file to %s" msgstr "misslyckades med att kompilera %s" -#: ../IkiWiki/Plugin/po.pm:894 +#: ../IkiWiki/Plugin/po.pm:896 #, fuzzy, perl-format msgid "failed to update %s" msgstr "misslyckades med att kompilera %s" -#: ../IkiWiki/Plugin/po.pm:900 +#: ../IkiWiki/Plugin/po.pm:902 #, fuzzy, perl-format msgid "failed to copy the POT file to %s" msgstr "misslyckades med att kompilera %s" -#: ../IkiWiki/Plugin/po.pm:936 +#: ../IkiWiki/Plugin/po.pm:938 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:949 +#: ../IkiWiki/Plugin/po.pm:951 #, fuzzy, perl-format msgid "failed to translate %s" msgstr "misslyckades med att skriva %s: %s" -#: ../IkiWiki/Plugin/po.pm:1033 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1089 ../IkiWiki/Plugin/po.pm:1103 -#: ../IkiWiki/Plugin/po.pm:1142 +#: ../IkiWiki/Plugin/po.pm:1091 ../IkiWiki/Plugin/po.pm:1105 +#: ../IkiWiki/Plugin/po.pm:1144 #, fuzzy, perl-format msgid "failed to write %s" msgstr "misslyckades med att skriva %s: %s" -#: ../IkiWiki/Plugin/po.pm:1101 +#: ../IkiWiki/Plugin/po.pm:1103 #, fuzzy msgid "failed to translate" msgstr "linkmap misslyckades att köra dot" -#: ../IkiWiki/Plugin/po.pm:1154 +#: ../IkiWiki/Plugin/po.pm:1156 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -836,44 +837,44 @@ msgstr "" msgid "no change to the file name was specified" msgstr "filnamn för wrapper har inte angivits" -#: ../IkiWiki/Plugin/rename.pm:69 +#: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:74 +#: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:80 +#: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:123 +#: ../IkiWiki/Plugin/rename.pm:122 #, fuzzy, perl-format msgid "rename %s" msgstr "ritar upp %s" -#: ../IkiWiki/Plugin/rename.pm:162 +#: ../IkiWiki/Plugin/rename.pm:161 msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:249 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:252 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:349 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:573 +#: ../IkiWiki/Plugin/rename.pm:572 #, fuzzy, perl-format msgid "update for rename of %s to %s" msgstr "uppdatering av %s, %s av %s" @@ -978,21 +979,21 @@ msgstr "" msgid "parse fail at line %d: %s" msgstr "misslyckades med att skriva %s: %s" -#: ../IkiWiki/Plugin/template.pm:34 +#: ../IkiWiki/Plugin/tag.pm:83 +#, fuzzy, perl-format +msgid "creating tag page %s" +msgstr "skapar nya sidan %s" + +#: ../IkiWiki/Plugin/template.pm:33 #, fuzzy msgid "missing id parameter" msgstr "mall saknar id-parameter" #: ../IkiWiki/Plugin/template.pm:47 -#, perl-format -msgid "template %s not found" +#, fuzzy, perl-format +msgid "%s not found" msgstr "mallen %s hittades inte" -#: ../IkiWiki/Plugin/template.pm:66 -#, fuzzy -msgid "failed to process:" -msgstr "misslyckades med att behandla mall:" - #: ../IkiWiki/Plugin/teximg.pm:72 msgid "missing tex code" msgstr "" @@ -1051,54 +1052,59 @@ msgstr "" msgid "bad file name %s" msgstr "hoppar över felaktigt filnamn %s" -#: ../IkiWiki/Render.pm:153 +#: ../IkiWiki/Render.pm:162 #, perl-format msgid "scanning %s" msgstr "söker av %s" -#: ../IkiWiki/Render.pm:274 +#: ../IkiWiki/Render.pm:284 #, perl-format msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" -#: ../IkiWiki/Render.pm:303 ../IkiWiki/Render.pm:330 +#: ../IkiWiki/Render.pm:315 #, perl-format msgid "skipping bad filename %s" msgstr "hoppar över felaktigt filnamn %s" -#: ../IkiWiki/Render.pm:308 +#: ../IkiWiki/Render.pm:330 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:413 +#: ../IkiWiki/Render.pm:372 #, perl-format -msgid "removing old page %s" +msgid "querying %s for file creation and modification times.." +msgstr "" + +#: ../IkiWiki/Render.pm:434 +#, fuzzy, perl-format +msgid "removing obsolete %s" msgstr "tar bort gammal sida %s" -#: ../IkiWiki/Render.pm:486 +#: ../IkiWiki/Render.pm:507 #, fuzzy, perl-format msgid "building %s, which links to %s" msgstr "ritar upp %s, vilken länkar till %s" -#: ../IkiWiki/Render.pm:495 +#: ../IkiWiki/Render.pm:516 #, fuzzy, perl-format msgid "removing %s, no longer built by %s" msgstr "tar bort %s, som inte längre ritas upp av %s" -#: ../IkiWiki/Render.pm:618 +#: ../IkiWiki/Render.pm:671 ../IkiWiki/Render.pm:777 #, fuzzy, perl-format msgid "building %s, which depends on %s" msgstr "ritar upp %s, vilken är beroende av %s" -#: ../IkiWiki/Render.pm:631 +#: ../IkiWiki/Render.pm:684 #, fuzzy, perl-format msgid "building %s, to update its backlinks" msgstr "ritar upp %s, för att uppdatera dess bakåtlänkar" -#: ../IkiWiki/Render.pm:707 +#: ../IkiWiki/Render.pm:819 #, fuzzy, perl-format msgid "ikiwiki: cannot build %s" msgstr "ikiwiki: kan inte rita upp %s" @@ -1171,62 +1177,63 @@ msgstr "användning: ikiwiki [flaggor] källa mål" msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:95 +#: ../ikiwiki.in:96 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:156 +#: ../ikiwiki.in:157 msgid "generating wrappers.." msgstr "genererar wrappers.." -#: ../ikiwiki.in:219 +#: ../ikiwiki.in:220 msgid "rebuilding wiki.." msgstr "bygger om wiki.." -#: ../ikiwiki.in:222 +#: ../ikiwiki.in:223 msgid "refreshing wiki.." msgstr "uppdaterar wiki.." -#: ../IkiWiki.pm:238 +#: ../IkiWiki.pm:233 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki.pm:530 +#: ../IkiWiki.pm:524 msgid "Must specify url to wiki with --url when using --cgi" msgstr "Måste ange url till wiki med --url när --cgi används" -#: ../IkiWiki.pm:576 +#: ../IkiWiki.pm:570 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:605 +#: ../IkiWiki.pm:599 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1278 +#: ../IkiWiki.pm:1273 #, fuzzy, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "%s förbehandlingsslinga detekterades på %s, djup %i" -#: ../IkiWiki.pm:1901 +#: ../IkiWiki.pm:1932 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2044 -msgid "Sort::Naturally needed for title_natural sort" -msgstr "" +#: ../IkiWiki.pm:2009 +#, fuzzy, perl-format +msgid "invalid sort type %s" +msgstr "okänd sorteringstyp %s" -#: ../IkiWiki.pm:2055 +#: ../IkiWiki.pm:2030 #, perl-format msgid "unknown sort type %s" msgstr "okänd sorteringstyp %s" -#: ../IkiWiki.pm:2074 +#: ../IkiWiki.pm:2166 #, fuzzy, perl-format msgid "cannot match pages: %s" msgstr "kan inte läsa %s: %s" @@ -1251,6 +1258,13 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "" +#, fuzzy +#~ msgid "failed to process" +#~ msgstr "misslyckades med att behandla mall:" + +#~ msgid "getctime not implemented" +#~ msgstr "getctime inte implementerad" + #, fuzzy #~ msgid "failed to read %s" #~ msgstr "misslyckades med att skriva %s: %s" @@ -1305,10 +1319,6 @@ msgstr "" #~ "REV är inte inställt, kör inte från svn post-commit-hook, kan inte skicka " #~ "notifieringar" -#, fuzzy -#~ msgid "%s not found" -#~ msgstr "mallen %s hittades inte" - #~ msgid "What's this?" #~ msgstr "Vad är det här?" -- cgit v1.2.3 From 970373548fda77223ebbeb6aadbdbe4884b67cef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 13:44:13 -0400 Subject: Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. --- IkiWiki.pm | 22 ++++++++++++++++++++-- IkiWiki/Plugin/comments.pm | 2 +- IkiWiki/Plugin/inline.pm | 12 +----------- IkiWiki/Plugin/relativedate.pm | 15 ++++++++++++--- IkiWiki/Render.pm | 2 +- debian/changelog | 7 +++++++ doc/bugs/html5_support.mdwn | 3 +++ doc/plugins/write.mdwn | 5 ++++- 8 files changed, 49 insertions(+), 19 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index ed57710bb..c428de77f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -998,10 +998,18 @@ sub abs2rel ($$) { return $ret; } -sub displaytime ($;$) { +sub displaytime ($;$$) { # Plugins can override this function to mark up the time to # display. - return ''.formattime(@_).''; + my $time=formattime($_[0], $_[1]); + if ($config{html5}) { + return ''; + } + else { + return ''.$time.''; + } } sub formattime ($;$) { @@ -1017,6 +1025,16 @@ sub formattime ($;$) { return decode_utf8(POSIX::strftime($format, localtime($time))); } +sub date_3339 ($) { + my $time=shift; + + my $lc_time=POSIX::setlocale(&POSIX::LC_TIME); + POSIX::setlocale(&POSIX::LC_TIME, "C"); + my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", gmtime($time)); + POSIX::setlocale(&POSIX::LC_TIME, $lc_time); + return $ret; +} + sub beautify_urlpath ($) { my $url=shift; diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index f7dc99dca..02f1d9301 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -672,7 +672,7 @@ sub previewcomment ($$$) { my $template = template("comment.tmpl"); $template->param(content => $preview); - $template->param(ctime => displaytime($time)); + $template->param(ctime => displaytime($time, undef, 1)); IkiWiki::run_hooks(pagetemplate => sub { shift->(page => $location, diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 95fe90312..2df59f414 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -358,7 +358,7 @@ sub preprocess_inline (@) { $template->param(pageurl => urlto($page, $params{destpage})); $template->param(inlinepage => $page); $template->param(title => pagetitle(basename($page))); - $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); + $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}, 1)); $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat})); $template->param(first => 1) if $page eq $list[0]; $template->param(last => 1) if $page eq $list[$#list]; @@ -500,16 +500,6 @@ sub date_822 ($) { return $ret; } -sub date_3339 ($) { - my $time=shift; - - my $lc_time=POSIX::setlocale(&POSIX::LC_TIME); - POSIX::setlocale(&POSIX::LC_TIME, "C"); - my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", gmtime($time)); - POSIX::setlocale(&POSIX::LC_TIME, $lc_time); - return $ret; -} - sub absolute_urls ($$) { # sucky sub because rss sucks my $content=shift; diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 7e615f7f1..fe8ef0901 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -43,9 +43,10 @@ sub include_javascript ($;$) { '" type="text/javascript" charset="utf-8">'; } -sub mydisplaytime ($;$) { +sub mydisplaytime ($;$$) { my $time=shift; my $format=shift; + my $pubdate=shift; # This needs to be in a form that can be parsed by javascript. # Being fairly human readable is also nice, as it will be exposed @@ -53,8 +54,16 @@ sub mydisplaytime ($;$) { my $gmtime=decode_utf8(POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time))); - return ''. - IkiWiki::formattime($time, $format).''; + my $mid=' class="relativedate" title="'.$gmtime.'">'. + IkiWiki::formattime($time, $format); + + if ($config{html5}) { + return '