From 6a0af02d3f30103196b9452077b5a68177c9fde4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Jan 2010 16:07:01 -0500 Subject: make decode_form_utf8 safe for arrays --- IkiWiki/CGI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 866711a71..cd4a5574c 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -65,8 +65,9 @@ sub decode_form_utf8 ($) { if ($] >= 5.01) { my $form = shift; foreach my $f ($form->field) { + my @value=map { decode_utf8($_) } $form->field($f); $form->field(name => $f, - value => decode_utf8($form->field($f)), + value => \@value, force => 1, ); } -- cgit v1.2.3 From 59d929d6b1271c84c6d17ffbff65b57bf67d49e6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Jan 2010 16:20:09 -0500 Subject: websetup: Fix utf-8 problems. --- IkiWiki/Plugin/websetup.pm | 9 +++++++-- debian/changelog | 1 + doc/bugs/utf-8_bug_in_websetup.pm.mdwn | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 9edd22d26..75aa3681c 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -139,7 +139,11 @@ sub showfields ($$$@) { my $value=$config{$key}; if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { - $value=[(ref $value eq 'ARRAY' ? @{$value} : ""), "", ""]; # blank items for expansion + $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) } @{$value} : ""), + "", ""]; # blank items for expansion + } + else { + $value=Encode::encode_utf8($value); } if ($info{type} eq "string") { @@ -290,7 +294,6 @@ sub showform ($$) { shift->(form => $form, cgi => $cgi, session => $session, buttons => $buttons); }); - IkiWiki::decode_form_utf8($form); my %fields=showfields($form, undef, undef, IkiWiki::getsetup()); @@ -308,6 +311,8 @@ sub showform ($$) { $fields{$_}=$shown{$_} foreach keys %shown; } } + + IkiWiki::decode_form_utf8($form); if ($form->submitted eq "Cancel") { IkiWiki::redirect($cgi, $config{url}); diff --git a/debian/changelog b/debian/changelog index 4f7c1a60c..5d5cdd564 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low are disabled. * comments: Fix permalinks for comments using new conflict-free filenames. * img: Support alignment of images with captions. (Giuseppe Bilotta) + * websetup: Fix utf-8 problems. -- Joey Hess Mon, 04 Jan 2010 12:53:24 -0500 diff --git a/doc/bugs/utf-8_bug_in_websetup.pm.mdwn b/doc/bugs/utf-8_bug_in_websetup.pm.mdwn index c3a5262cd..debedb01c 100644 --- a/doc/bugs/utf-8_bug_in_websetup.pm.mdwn +++ b/doc/bugs/utf-8_bug_in_websetup.pm.mdwn @@ -4,6 +4,8 @@ I type chinese characters into the fields. After press "save setup" button the c I submit a patch that solve the problem for me. --Lingo +> Fully fixing it is slightly more complex, but now [[done]] --[[Joey]] + ---- --- websetup.pm 2009-12-02 05:07:46.000000000 +0800 -- cgit v1.2.3 From 1f51af907e93ee45b01a4a7f6015575522a3105d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Jan 2010 16:27:08 -0500 Subject: websetup: Fix bug in array change detection. --- IkiWiki/Plugin/websetup.pm | 6 +++++- debian/changelog | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 75aa3681c..e477bcc20 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -362,7 +362,11 @@ sub showform ($$) { @value=sort grep { length $_ } @value; my @oldvalue=sort grep { length $_ } (defined $config{$key} ? @{$config{$key}} : ()); - if ((@oldvalue) == (@value)) { + my $same=(@oldvalue) == (@value); + for (my $x=0; $same && $x < @value; $x++) { + $same=0 if $value[$x] ne $oldvalue[$x]; + } + if ($same) { delete $rebuild{$field}; } else { diff --git a/debian/changelog b/debian/changelog index 5d5cdd564..bd638b36f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low * comments: Fix permalinks for comments using new conflict-free filenames. * img: Support alignment of images with captions. (Giuseppe Bilotta) * websetup: Fix utf-8 problems. + * websetup: Fix bug in array change detection. -- Joey Hess Mon, 04 Jan 2010 12:53:24 -0500 -- cgit v1.2.3 From 9dc5685de44760d2c06a0376c97eb699de2f2964 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 9 Jan 2010 23:10:26 -0500 Subject: linkmap: Simplify and improve browser compatability by using an img, not object tag. I noticed that chromium was not hyperlinking the areas in the object-based linkmap, while img works ok. Dunno why, but img based is nicer anyway since it is allowed right through the htmlscrubber with no workarounds. --- IkiWiki/Plugin/linkmap.pm | 30 ++++-------------------------- debian/changelog | 2 ++ 2 files changed, 6 insertions(+), 26 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 28acbda32..68eb6c8c6 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -9,7 +9,6 @@ use IPC::Open2; sub import { hook(type => "getsetup", id => "linkmap", call => \&getsetup); hook(type => "preprocess", id => "linkmap", call => \&preprocess); - hook(type => "format", id => "linkmap", call => \&format); } sub getsetup () { @@ -21,34 +20,13 @@ sub getsetup () { } my $mapnum=0; -my %maps; sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; - # Can't just return the linkmap here, since the htmlscrubber - # scrubs out all tags (with good reason!) - # Instead, insert a placeholder tag, which will be expanded during - # formatting. $mapnum++; - $maps{$mapnum}=\%params; - return "
"; -} - -sub format (@) { - my %params=@_; - - $params{content}=~s/
<\/div>/genmap($1)/eg; - - return $params{content}; -} - -sub genmap ($) { - my $mapnum=shift; - return "" unless exists $maps{$mapnum}; - my %params=%{$maps{$mapnum}}; my $connected=IkiWiki::yesno($params{connected}); # Get all the items to map. @@ -102,10 +80,10 @@ sub genmap ($) { close OUT || error gettext("failed to run dot"); local $/=undef; - my $ret="\n". - . - ""; + my $ret="\"".gettext("linkmap").\n". + ; close IN || error gettext("failed to run dot"); waitpid $pid, 0; diff --git a/debian/changelog b/debian/changelog index bd638b36f..55213df9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low * img: Support alignment of images with captions. (Giuseppe Bilotta) * websetup: Fix utf-8 problems. * websetup: Fix bug in array change detection. + * linkmap: Simplify and improve browser compatability by using an img, + not object tag. -- Joey Hess Mon, 04 Jan 2010 12:53:24 -0500 -- cgit v1.2.3 From 97bc5d8bcacd482874d0050166ba3f7a87ef9fd1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 12:08:26 -0500 Subject: typos --- IkiWiki/CGI.pm | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index cd4a5574c..bb26add9a 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -52,7 +52,7 @@ sub redirect ($$) { } sub decode_cgi_utf8 ($) { - # decode_form_utf8 method is needed for 5.10 + # decode_form_utf8 method is needed for 5.01 if ($] < 5.01) { my $cgi = shift; foreach my $f ($cgi->param) { diff --git a/debian/changelog b/debian/changelog index 55213df9c..f17eed3e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -262,7 +262,7 @@ ikiwiki (3.141592) unstable; urgency=low * Add new hooks: canremove, canrename, rename. (intrigeri) * rename: Refactor subpage rename handling code into rename hook. (intrigeri) - * po: New plugin, suporting translation of wiki pages using po files. + * po: New plugin, suporting translation of wiki pages using po files. (intrigeri) * Add build machinery to build po files to translate the underlay wikis, * Add further build machinery to generate translated underlays from -- cgit v1.2.3 From 461804a5e4e267dce332e0b953a164ba6b82a91e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 12:09:54 -0500 Subject: clarify error --- IkiWiki/Plugin/remove.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 2b8cf0414..3c1e0c713 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -51,7 +51,7 @@ sub check_canremove ($$$) { IkiWiki::Plugin::attachment::check_canattach($session, $page, $file); } else { - error("renaming of attachments is not allowed"); + error("removal of attachments is not allowed"); } } -- cgit v1.2.3 From 32472c02ebcd646783855fcabd7f9f8c7f2bb4be Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 12:33:25 -0500 Subject: brace style --- IkiWiki/CGI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index bb26add9a..07369ac10 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -15,7 +15,8 @@ sub printheader ($) { if ($config{sslcookie}) { print $session->header(-charset => 'utf-8', -cookie => $session->cookie(-httponly => 1, -secure => 1)); - } else { + } + else { print $session->header(-charset => 'utf-8', -cookie => $session->cookie(-httponly => 1)); } -- cgit v1.2.3 From ccf14b185e37fad9b208b6a3d4490e1130ad9def Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 12:34:19 -0500 Subject: brace style and layout --- IkiWiki/Plugin/git.pm | 5 ++++- IkiWiki/Plugin/monotone.pm | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index c5c83a3a7..786c7b1f2 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -419,7 +419,10 @@ sub git_sha1 (;$) { '--', $file); if ($sha1) { ($sha1) = $sha1 =~ m/($sha1_pattern)/; # sha1 is untainted now - } else { debug("Empty sha1sum for '$file'.") } + } + else { + debug("Empty sha1sum for '$file'."); + } return defined $sha1 ? $sha1 : q{}; } diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index c717ceefb..9502804f1 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -558,7 +558,8 @@ sub rcs_recentchanges ($) { # from the changelog if ($cert->{key} eq $config{mtnkey}) { $committype = "web"; - } else { + } + else { $committype = "mtn"; } } elsif ($cert->{name} eq "date") { -- cgit v1.2.3 From 8bf2f5a31ae3569b0c1c5b139640f7e8356a90f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 19 Jan 2010 23:42:04 -0500 Subject: handle git-notes breakage The new git-notes feature in git 1.6.6 changes git log output in a way that broke ikiwiki's parser if notes are added to commits. I decided to deal with this by disabling notes when ikiwiki uses git, by setting GIT_NOTES_REF="". AFAICS, looking up notes when dumping logs will only waste time, since it does not currently seem to make sense for ikiwiki to do anything with the notes. --- IkiWiki/Plugin/git.pm | 3 +++ debian/changelog | 3 +++ 2 files changed, 6 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 786c7b1f2..1eec6aee6 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -51,6 +51,9 @@ sub checkconfig () { wrappermode => (defined $config{git_wrappermode} ? $config{git_wrappermode} : "06755"), }; } + + # Avoid notes, parser does not handle and they only slow things down. + $ENV{GIT_NOTES_REF}=""; # Run receive test only if being called by the wrapper, and not # when generating same. diff --git a/debian/changelog b/debian/changelog index f17eed3e5..6fbbe0a23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low * websetup: Fix bug in array change detection. * linkmap: Simplify and improve browser compatability by using an img, not object tag. + * git: The new git-notes feature in git 1.6.6 changes git log output + in a way that broke ikiwiki's parser if notes are added to commits. + Deal with this. -- Joey Hess Mon, 04 Jan 2010 12:53:24 -0500 -- cgit v1.2.3 From ee9ae0a3149f04e9373a0b7b1fece99f5cc78e9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 Jan 2010 15:23:25 -0500 Subject: po: avoid crash when page is empty Note that there is an associated po4a warning when a page is empty: Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/Locale/Po4a/Text.pm line 205. I've filed a bug with po4a about that, but the important thing is fixing the crash here. --- IkiWiki/Plugin/po.pm | 12 ++---------- debian/changelog | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 02fc4a89e..f8801185e 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -1057,11 +1057,8 @@ sub commit_and_refresh ($$) { IkiWiki::saveindex(); } -# on success, returns the filtered content. -# on error, if $nonfatal, warn and return undef; else, error out. -sub po_to_markup ($$;$) { +sub po_to_markup ($$) { my ($page, $content) = (shift, shift); - my $nonfatal = shift; $content = '' unless defined $content; $content = decode_utf8(encode_utf8($content)); @@ -1084,10 +1081,6 @@ sub po_to_markup ($$;$) { my $fail = sub ($) { my $msg = "po(po_to_markup) - $page : " . shift; - if ($nonfatal) { - warn $msg; - return undef; - } error($msg, sub { unlink $infile, $outfile}); }; @@ -1108,8 +1101,7 @@ sub po_to_markup ($$;$) { $doc->write($outfile) or return $fail->(sprintf(gettext("failed to write %s"), $outfile)); - $content = readfile($outfile) - or return $fail->(sprintf(gettext("failed to read %s"), $outfile)); + $content = readfile($outfile); # Unlinking should happen automatically, thanks to File::Temp, # but it does not work here, probably because of the way writefile() diff --git a/debian/changelog b/debian/changelog index 6fbbe0a23..91f5d7807 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low * git: The new git-notes feature in git 1.6.6 changes git log output in a way that broke ikiwiki's parser if notes are added to commits. Deal with this. + * po: Avoid crash when a page is empty. -- Joey Hess Mon, 04 Jan 2010 12:53:24 -0500 -- cgit v1.2.3 From 73253d6925ef84f9dd9e72919f8a136b93a0d277 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 26 Jan 2010 22:26:50 -0500 Subject: template: Preprocess parameters before htmlizing. Consider a template like: [[!template type=note text=""" [[!inline pages="*foo*"]] """]] The text parameter is htmlized before being passed into the template (in case the template wraps it in a that prevents markdown from htmlizing it later). But, when markdown sees "*foo*", it turns that into foo. Later, when preprocessing the inline directive, that leads to suprising results. To fix this, I made template parameters be preprocessed (and filtered) before being htmlized. Note that I left in the preprocessing (and filtering) of the template output at the end. That's still relevant when the template itself contains preprocessor directives. --- IkiWiki/Plugin/template.pm | 19 +++++++++++-------- debian/changelog | 6 ++++++ 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index b6097bb49..39d9667f9 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -25,6 +25,10 @@ sub getsetup () { sub preprocess (@) { my %params=@_; + # This needs to run even in scan mode, in order to process + # links and other metadata included via the template. + my $scan=! defined wantarray; + if (! exists $params{id}) { error gettext("missing id parameter") } @@ -58,24 +62,23 @@ sub preprocess (@) { $params{basename}=IkiWiki::basename($params{page}); foreach my $param (keys %params) { + my $value=IkiWiki::preprocess($params{page}, $params{destpage}, + IkiWiki::filter($params{page}, $params{destpagea}, + $params{$param}), $scan); if ($template->query(name => $param)) { $template->param($param => IkiWiki::htmlize($params{page}, $params{destpage}, pagetype($pagesources{$params{page}}), - $params{$param})); + $value)); } if ($template->query(name => "raw_$param")) { - $template->param("raw_$param" => $params{$param}); + $template->param("raw_$param" => $value); } } - # This needs to run even in scan mode, in order to process - # links and other metadata includes via the template. - my $scan=! defined wantarray; - return IkiWiki::preprocess($params{page}, $params{destpage}, - IkiWiki::filter($params{page}, $params{destpage}, - $template->output), $scan); + IkiWiki::filter($params{page}, $params{destpage}, + $template->output), $scan); } 1 diff --git a/debian/changelog b/debian/changelog index 4e76b1d69..0ec696d3c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100123) UNRELEASED; urgency=low + + * template: Preprocess parameters before htmlizing. + + -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 + ikiwiki (3.20100122) unstable; urgency=low * inline: Avoid showing edit links if page editing is disabled. -- cgit v1.2.3 From f91d79f469956c423373c8747c92218c668f0ba8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 28 Jan 2010 21:07:23 -0500 Subject: img: Fix a bug that could taint @links with undef values. --- IkiWiki/Plugin/img.pm | 4 ++++ debian/changelog | 1 + 2 files changed, 5 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index c1048d3c9..82db15a7e 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -26,6 +26,10 @@ sub preprocess (@) { my ($image) = $_[0] =~ /$config{wiki_file_regexp}/; # untaint my %params=@_; + if (! defined $image) { + error("bad image filename"); + } + if (exists $imgdefaults{$params{page}}) { foreach my $key (keys %{$imgdefaults{$params{page}}}) { if (! exists $params{$key}) { diff --git a/debian/changelog b/debian/changelog index 0ec696d3c..5d27b7af0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * template: Preprocess parameters before htmlizing. + * img: Fix a bug that could taint @links with undef values. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From 49d8c5b821743355fa60b30e1b2b456c44aaa221 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Feb 2010 15:18:53 -0500 Subject: setup automator: Configure Term::Readline to use bold for prompt, rather than default underline. Closes: #517656 --- IkiWiki/Setup/Automator.pm | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 7af93e73c..9fee4dcb7 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -15,6 +15,7 @@ sub ask ($$) { my ($question, $default)=@_; my $r=Term::ReadLine->new("ikiwiki"); + $r->ornaments("md,me"); $r->readline(encode_utf8($question)." ", $default); } diff --git a/debian/changelog b/debian/changelog index 5d27b7af0..8e01950a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * template: Preprocess parameters before htmlizing. * img: Fix a bug that could taint @links with undef values. + * setup automator: Configure Term::Readline to use bold for prompt, rather + than default underline. Closes: #517656 -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From f3abeac919c4736429bd3362af6edf51ede8e7fe Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sat, 30 Jan 2010 18:12:01 +0100 Subject: Code deduplication fin find_src_files() This also has the advantage that I can use the resulting new function elsewhere. --- IkiWiki/Render.pm | 59 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 32 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 3ebb1a324..44b2fb9c2 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -280,6 +280,27 @@ sub srcdir_check () { } +sub verify_src_file ($$) { + my $file=decode_utf8(shift); + my $dir=shift; + + return if -l $file || -d $file; + $file=~s/^\Q$dir\E\/?//; + return if ! length $file; + my $page = pagename($file); + if (! exists $pagesources{$page} && + file_pruned($file)) { + $File::Find::prune=1; + return; + } + + my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint + if (! defined $f) { + warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); + } + return ($file,$page,$f); +} + sub find_src_files () { my @files; my %pages; @@ -288,22 +309,9 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my $file=decode_utf8($_); - $file=~s/^\Q$config{srcdir}\E\/?//; - return if -l $_ || -d _ || ! length $file; - my $page = pagename($file); - if (! exists $pagesources{$page} && - file_pruned($file)) { - $File::Find::prune=1; - return; - } - - my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint - if (! defined $f) { - warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); - } - else { - push @files, $f; + my ($file,$page,$f) = verify_src_file($_,$config{srcdir}); + if ($file) { + push @files, $file; if ($pages{$page}) { debug(sprintf(gettext("%s has multiple possible source pages"), $page)); } @@ -315,24 +323,11 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my $file=decode_utf8($_); - $file=~s/^\Q$dir\E\/?//; - return if -l $_ || -d _ || ! length $file; - my $page=pagename($file); - if (! exists $pagesources{$page} && - file_pruned($file)) { - $File::Find::prune=1; - return; - } - - my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint - if (! defined $f) { - warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); - } - else { + my ($file,$page,$f) = verify_src_file($_,$dir); + if ($f) { # avoid underlaydir override # attacks; see security.mdwn - if (! -l "$config{srcdir}/$f" && + if (! -l "$config{srcdir}/$f" && ! -e _) { if (! $pages{$page}) { push @files, $f; -- cgit v1.2.3 From f35d35abe36166893f68061a1fcb2a26bc056fbc Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sat, 30 Jan 2010 18:22:32 +0100 Subject: Automatically create tag pages, if "tag_autocreate=1" is set in the configuration. The pages will be created in tagbase, if and only if they do not exist in the srcdir yet. Tag pages will be create from "autotag.tmpl". At this stage a second refresh is needed for the tag pages to be rendered. Add autotag.tmpl template. --- IkiWiki/Plugin/tag.pm | 26 ++++++++++++++++++++++++++ templates/autotag.tmpl | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 templates/autotag.tmpl (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index cdcfaf536..6c43a053d 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -36,6 +36,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + tag_autocreate => { + type => "boolean", + example => 0, + description => "Autocreate new tag pages", + safe => 1, + rebuild => 1, + }, } sub tagpage ($) { @@ -59,6 +66,21 @@ sub taglink ($$$;@) { return htmllink($page, $destpage, tagpage($tag), %opts); } +sub gentag ($) { + my $tag=shift; + if (defined $config{tag_autocreate} && $config{tag_autocreate}) { + my $tagfile = newpagefile(tagpage($tag), $config{default_pageext}); + $tagfile=~s/^\///; + return if (srcfile($tagfile,1)); + + debug(sprintf(gettext("creating tag page %s"), $tag)); + + my $template=template("autotag.tmpl"); + $template->param(tag => $tag); + writefile($tagfile, $config{srcdir}, $template->output); + } +} + sub preprocess_tag (@) { if (! @_) { return ""; @@ -72,6 +94,10 @@ sub preprocess_tag (@) { foreach my $tag (keys %params) { $tag=linkpage($tag); $tags{$page}{$tag}=1; + + # add tagpage if necessary + gentag($tag); + # hidden WikiLink add_link($page, tagpage($tag)); } diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl new file mode 100644 index 000000000..754e0b35b --- /dev/null +++ b/templates/autotag.tmpl @@ -0,0 +1,3 @@ +## Pagest tagged ## + +[[!inline pages="tagged()" actions="no" archive="yes"]] -- cgit v1.2.3 From f3c59ed3e52f6e68e73338f6e7799a4de7b6f9d6 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sun, 31 Jan 2010 02:23:11 +0100 Subject: Process files from @autofiles in refresh(). To make automatically added files render they have to be added to the $files, $pages, $new, and $changed variables. After that scan() is called on them. --- IkiWiki/Render.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 44b2fb9c2..dd4d9ca0c 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -642,6 +642,20 @@ sub refresh () { scan($file); } + while (my $autofile = shift (@autofiles)) { + my $page=pagename($autofile); + if ($pages->{$page}) { + debug(sprintf(gettext("%s has multiple possible source pages"), $page)); + } + $pages->{$page}=1; + + push @{$files}, $autofile; + push @{$new}, $autofile if find_new_files([$autofile]); + push @{$changed}, $autofile if find_changed([$autofile]); + + scan($autofile); + } + calculate_links(); remove_del(@$del, @$internal_del); -- cgit v1.2.3 From a8d313aba1094fc6d976c9ba3d09f58b768435c5 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sun, 31 Jan 2010 01:12:20 +0100 Subject: Use add_autofile() in tag.pm to make the automatically created tagpages render. --- IkiWiki/Plugin/tag.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 6c43a053d..90833fd9c 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -78,6 +78,8 @@ sub gentag ($) { my $template=template("autotag.tmpl"); $template->param(tag => $tag); writefile($tagfile, $config{srcdir}, $template->output); + + IkiWiki::add_autofile("$config{srcdir}/$tagfile"); } } -- cgit v1.2.3 From f58f3e1bec41ccf9316f37b014ce0b373c8e49e1 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Tue, 2 Feb 2010 11:01:24 +0100 Subject: Revert the effects of find_del_files() for (re)autoadded files. This also means that if autoadded files are deleted they will just be recreated. --- IkiWiki.pm | 3 ++- IkiWiki/Render.pm | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 115c512d3..ad9fb7c79 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -14,7 +14,8 @@ 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 @autofiles}; + %forcerebuild %loaded_plugins @autofiles %dellinks + %delrenderedfiles}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index dd4d9ca0c..d2fa80fbb 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -392,7 +392,9 @@ sub find_del_files ($) { else { push @del, $pagesources{$page}; } + $dellinks{$page}= $links{$page}; $links{$page}=[]; + $delrenderedfiles{$page}= $renderedfiles{$page}; $renderedfiles{$page}=[]; $pagemtime{$page}=0; } @@ -642,8 +644,14 @@ sub refresh () { scan($file); } + my %del_hash = map {$_, 1} @$del; while (my $autofile = shift (@autofiles)) { my $page=pagename($autofile); + if (exists $del_hash{$page}) { + $links{$page}= $dellinks{$page}; + $renderedfiles{$page}= $delrenderedfiles{$page}; + delete $del_hash{$page}; + } if ($pages->{$page}) { debug(sprintf(gettext("%s has multiple possible source pages"), $page)); } @@ -655,6 +663,7 @@ sub refresh () { scan($autofile); } + $del = [keys %del_hash]; calculate_links(); -- cgit v1.2.3 From 25741100b0a0d81ae5113dfabe5a1ed84cdf8746 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Tue, 2 Feb 2010 12:12:23 +0100 Subject: Export add_autofile() for use in Plugins. --- IkiWiki.pm | 2 +- IkiWiki/Plugin/tag.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index ad9fb7c79..7d7f430b3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -23,7 +23,7 @@ our @EXPORT = qw(hook debug error template htmlpage deptype htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext urlto targetpage add_underlay pagetitle titlepage linkpage newpagefile - inject add_link + inject add_link add_autofile %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 90833fd9c..c0b7feb23 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -79,7 +79,7 @@ sub gentag ($) { $template->param(tag => $tag); writefile($tagfile, $config{srcdir}, $template->output); - IkiWiki::add_autofile("$config{srcdir}/$tagfile"); + add_autofile("$config{srcdir}/$tagfile"); } } -- cgit v1.2.3 From da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0 Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Wed, 3 Feb 2010 06:57:20 +0100 Subject: fix bugs in `find_src_files()`. Use `_` to avoid superfluous stat. Check for `defined $file`, instead of just `$file`. Add spaces after commas. Change return values of `verify_src_file()` to not return the tainted filename. Rename `$f` to `$file_untainted in `verify_src_file()`. $f changes to `$file` in `find_src_files()`. This attempts to fix commit f3abeac919c4736429bd3362af6edf51ede8e7fe. For discussion see --- IkiWiki/Render.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index d2fa80fbb..5b72b6de1 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -284,7 +284,7 @@ sub verify_src_file ($$) { my $file=decode_utf8(shift); my $dir=shift; - return if -l $file || -d $file; + return if -l $file || -d _; $file=~s/^\Q$dir\E\/?//; return if ! length $file; my $page = pagename($file); @@ -294,11 +294,11 @@ sub verify_src_file ($$) { return; } - my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint - if (! defined $f) { + my ($file_untainted) = $file =~ /$config{wiki_file_regexp}/; # untaint + if (! defined $file_untainted) { warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); } - return ($file,$page,$f); + return ($file_untainted, $page); } sub find_src_files () { @@ -309,8 +309,8 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my ($file,$page,$f) = verify_src_file($_,$config{srcdir}); - if ($file) { + my ($file, $page) = verify_src_file($_, $config{srcdir}); + if (defined $file) { push @files, $file; if ($pages{$page}) { debug(sprintf(gettext("%s has multiple possible source pages"), $page)); @@ -323,14 +323,14 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my ($file,$page,$f) = verify_src_file($_,$dir); - if ($f) { + my ($file, $page) = verify_src_file($_, $dir); + if (defined $file) { # avoid underlaydir override # attacks; see security.mdwn - if (! -l "$config{srcdir}/$f" && + if (! -l "$config{srcdir}/$file" && ! -e _) { if (! $pages{$page}) { - push @files, $f; + push @files, $file; $pages{$page}=1; } } -- cgit v1.2.3 From 345b40c65288874e458e2bec51f81f429f0b3db1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Feb 2010 14:51:56 -0500 Subject: Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register --- IkiWiki/Plugin/passwordauth.pm | 16 ++++++++++++---- debian/changelog | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 8cf5af51e..1898030b5 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -104,11 +104,11 @@ sub formbuilder_setup (@) { my $session=$params{session}; my $cgi=$params{cgi}; - if ($form->title eq "signin" || $form->title eq "register") { + if ($form->title eq "signin" || $form->title eq "register" || $cgi->param("do") eq "register") { $form->field(name => "name", required => 0); $form->field(name => "password", type => "password", required => 0); - if ($form->submitted eq "Register" || $form->submitted eq "Create Account") { + if ($form->submitted eq "Register" || $form->submitted eq "Create Account" || $cgi->param("do") eq "register") { $form->field(name => "confirm_password", type => "password"); $form->field(name => "account_creation_password", type => "password") if (defined $config{account_creation_password} && @@ -232,7 +232,7 @@ sub formbuilder (@) { my $buttons=$params{buttons}; if ($form->title eq "signin" || $form->title eq "register") { - if ($form->submitted && $form->validate) { + if (($form->submitted && $form->validate) || $cgi->param("do") eq "register") { if ($form->submitted eq 'Login') { $session->param("name", $form->field("name")); IkiWiki::cgi_postsignin($cgi, $session); @@ -295,7 +295,7 @@ sub formbuilder (@) { $form->field(name => "name", required => 0); push @$buttons, "Reset Password"; } - elsif ($form->submitted eq "Register") { + elsif ($form->submitted eq "Register" || $cgi->param("do") eq "register") { @$buttons="Create Account"; } } @@ -336,6 +336,14 @@ sub sessioncgi ($$) { IkiWiki::cgi_prefs($q, $session); exit; } + elsif ($q->param("do") eq "register") { + # After registration, need to go somewhere, so show prefs page. + $session->param(postsignin => "do=prefs"); + # Due to do=register, this will run in registration-only + # mode. + IkiWiki::cgi_signin($q, $session); + exit; + } } sub auth ($$) { diff --git a/debian/changelog b/debian/changelog index 8e01950a8..7beb0db82 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * img: Fix a bug that could taint @links with undef values. * setup automator: Configure Term::Readline to use bold for prompt, rather than default underline. Closes: #517656 + * Allow jumping directly into account registration process by going to + ikiwiki.cgi?do=register -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From b547170a965e93a759de1612d4ce64d38eeea59c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Feb 2010 15:07:10 -0500 Subject: Improve display of openid in preferences page. Now that openiduser is in IkiWiki core, it's ok to have passwordauth check for it, and avoid displaying useless password fields when showing preferences for an openid. Also improved the styling of the display of the openid in the preferneces page. --- IkiWiki/Plugin/openid.pm | 14 +++++++------- IkiWiki/Plugin/passwordauth.pm | 3 ++- debian/changelog | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index dc0e0f48e..b60740c0e 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -82,13 +82,13 @@ sub formbuilder_setup (@) { } } } - elsif ($form->title eq "preferences") { - if (! defined $form->field(name => "name")) { - $form->field(name => "OpenID", disabled => 1, - value => $session->param("name"), - size => 50, force => 1, - fieldset => "login"); - } + elsif ($form->title eq "preferences" && + IkiWiki::openiduser($session->param("name"))) { + $form->field(name => "openid_url", disabled => 1, + label => htmllink("", "", "ikiwiki/OpenID", noimageinline => 1), + value => $session->param("name"), + size => 50, force => 1, + fieldset => "login"); } } diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 1898030b5..b70f9b788 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -206,7 +206,8 @@ sub formbuilder_setup (@) { } } } - elsif ($form->title eq "preferences") { + elsif ($form->title eq "preferences" && + IkiWiki::openiduser($session->param("name"))) { $form->field(name => "name", disabled => 1, value => $session->param("name"), force => 1, fieldset => "login"); diff --git a/debian/changelog b/debian/changelog index 7beb0db82..9867cf75a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low than default underline. Closes: #517656 * Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register + * Improve display of openid in preferences page. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From 68f7be91e59b304f4deb4ce84506a2bdd63917db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Feb 2010 15:10:55 -0500 Subject: typo --- IkiWiki/Plugin/passwordauth.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index b70f9b788..94c5b0492 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -207,7 +207,7 @@ sub formbuilder_setup (@) { } } elsif ($form->title eq "preferences" && - IkiWiki::openiduser($session->param("name"))) { + ! IkiWiki::openiduser($session->param("name"))) { $form->field(name => "name", disabled => 1, value => $session->param("name"), force => 1, fieldset => "login"); -- cgit v1.2.3 From a2e78ebcf27680eedf30e00f1ee9b86ed1d9e127 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Feb 2010 15:30:41 -0500 Subject: Add link to userpage (or creation link) to top of preferences page. --- IkiWiki/Plugin/passwordauth.pm | 44 ++++++++++++++++++++++++++++-------------- debian/changelog | 1 + 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 94c5b0492..b3a798055 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -206,21 +206,35 @@ sub formbuilder_setup (@) { } } } - elsif ($form->title eq "preferences" && - ! IkiWiki::openiduser($session->param("name"))) { - $form->field(name => "name", disabled => 1, - value => $session->param("name"), force => 1, - fieldset => "login"); - $form->field(name => "password", type => "password", - fieldset => "login", - validate => sub { - shift eq $form->field("confirm_password"); - }), - $form->field(name => "confirm_password", type => "password", - fieldset => "login", - validate => sub { - shift eq $form->field("password"); - }), + elsif ($form->title eq "preferences") { + my $user=$session->param("name"); + if (! IkiWiki::openiduser($user)) { + $form->field(name => "name", disabled => 1, + value => $user, force => 1, + fieldset => "login"); + $form->field(name => "password", type => "password", + fieldset => "login", + validate => sub { + shift eq $form->field("confirm_password"); + }); + $form->field(name => "confirm_password", type => "password", + fieldset => "login", + validate => sub { + shift eq $form->field("password"); + }); + + my $userpage=$config{userdir} ? $config{userdir}."/".$user : $user; + if (exists $pagesources{$userpage}) { + $form->text(gettext("Your user page: "). + htmllink("", "", $userpage, + noimageinline => 1)); + } + else { + $form->text(" "edit", page => $userpage). + "\">".gettext("Create your user page").""); + } + } } } diff --git a/debian/changelog b/debian/changelog index 9867cf75a..e07bada28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register * Improve display of openid in preferences page. + * Add link to userpage (or creation link) to top of preferences page. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From 8380a9d0009fee740f980aee3d45a933a5b24219 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Feb 2010 18:24:15 -0500 Subject: factor out a userpage function Not yet exported, as only 4 quite core plugins use it. --- IkiWiki.pm | 5 +++++ IkiWiki/Plugin/comments.pm | 5 ++--- IkiWiki/Plugin/editpage.pm | 5 +++-- IkiWiki/Plugin/passwordauth.pm | 2 +- IkiWiki/Plugin/recentchanges.pm | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 6226824df..0715f1869 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1090,6 +1090,11 @@ sub htmllink ($$$;@) { return "$linktext"; } +sub userpage ($) { + my $user=shift; + return length $config{userdir} ? "$config{userdir}/$user" : $user; +} + sub openiduser ($) { my $user=shift; diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 5586cca52..caed0d58c 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -171,9 +171,8 @@ sub preprocess { else { $commentauthorurl = IkiWiki::cgiurl( do => 'goto', - page => (length $config{userdir} - ? "$config{userdir}/$commentuser" - : "$commentuser")); + page => IkiWiki::userpage($commentuser) + ); $commentauthor = $commentuser; } diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index fca970c60..219386a30 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -245,8 +245,9 @@ sub cgi_editpage ($$) { push @page_locs, $dir.$page; } - push @page_locs, "$config{userdir}/$page" - if length $config{userdir}; + my $userpage=IkiWiki::userpage($page); + push @page_locs, $userpage + if ! grep { $_ eq $userpage } @page_locs; } @page_locs = grep { diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index b3a798055..c07065b7d 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -223,7 +223,7 @@ sub formbuilder_setup (@) { shift eq $form->field("password"); }); - my $userpage=$config{userdir} ? $config{userdir}."/".$user : $user; + my $userpage=IkiWiki::userpage($user); if (exists $pagesources{$userpage}) { $form->text(gettext("Your user page: "). htmllink("", "", $userpage, diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index fa851e466..5c7b71aaa 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -124,7 +124,7 @@ sub store ($$$) { elsif (length $config{cgiurl}) { $change->{authorurl} = IkiWiki::cgiurl( do => "goto", - page => (length $config{userdir} ? "$config{userdir}/" : "").$change->{author}, + page => IkiWiki::userpage($change->{author}), ); } -- cgit v1.2.3 From 5541b06de43c70ca9c23231d175d474789dacd25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Feb 2010 15:22:02 -0500 Subject: response --- IkiWiki/Plugin/httpauth.pm | 14 +++++++++++++- doc/forum/where_are_the_tags.mdwn | 7 +++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index 127c321f0..c1811643b 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -9,6 +9,8 @@ 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); } sub getsetup () { @@ -33,10 +35,20 @@ sub auth ($$) { if (defined $cgi->remote_user()) { $session->param("name", $cgi->remote_user()); } - elsif (defined $config{cgiauthurl}) { +} + +sub canedit ($$$) { + my $page=shift; + my $cgi=shift; + my $session=shift; + + if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) { IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); exit; } + else { + return undef; + } } 1 diff --git a/doc/forum/where_are_the_tags.mdwn b/doc/forum/where_are_the_tags.mdwn index 3a4debfe5..ecb49fe43 100644 --- a/doc/forum/where_are_the_tags.mdwn +++ b/doc/forum/where_are_the_tags.mdwn @@ -1,2 +1,9 @@ Where is the tag cloud/tag listing of all the tags used in this wiki? I know we have tags enabled. --[[jerojasro]] + +> This wiki does not use one global toplevel set of tags (`tagbase` is not +> set). +> +> There are tags used for the [[plugins]], and a tag cloud of those +> there. [[wishlist]] and [[patch]] are tags too, but I don't see the point +> of a tag cloud for such tags. --[[Joey]] -- cgit v1.2.3 From 1af8db763b76856a3f8fb4d79333b19ef5083637 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Feb 2010 23:06:29 -0500 Subject: revert accidental code change --- IkiWiki/Plugin/httpauth.pm | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index c1811643b..127c321f0 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -9,8 +9,6 @@ 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); } sub getsetup () { @@ -35,20 +33,10 @@ sub auth ($$) { if (defined $cgi->remote_user()) { $session->param("name", $cgi->remote_user()); } -} - -sub canedit ($$$) { - my $page=shift; - my $cgi=shift; - my $session=shift; - - if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) { + elsif (defined $config{cgiauthurl}) { IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); exit; } - else { - return undef; - } } 1 -- cgit v1.2.3 From e33a65719a58a65201c1c742f544f5cab38ad23c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Feb 2010 16:12:29 -0500 Subject: ensure opendiscussion hook is always called before lockedit This was only ordered ok due to luck before. --- IkiWiki/Plugin/opendiscussion.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 4517ff88b..4b91f5d83 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -7,7 +7,8 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "opendiscussion", call => \&getsetup); - hook(type => "canedit", id => "opendiscussion", call => \&canedit); + hook(type => "canedit", id => "opendiscussion", call => \&canedit, + first => 1); } sub getsetup () { -- 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 'IkiWiki') 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 5a2de27947d084f73fdbbc55028af378f62b42b3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Feb 2010 16:25:39 -0500 Subject: Fix color and format plugins to appear in the websetup interface. --- IkiWiki/Plugin/color.pm | 9 +++++++++ IkiWiki/Plugin/format.pm | 9 +++++++++ debian/changelog | 1 + 3 files changed, 19 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/color.pm b/IkiWiki/Plugin/color.pm index 20505893b..b9407ba28 100644 --- a/IkiWiki/Plugin/color.pm +++ b/IkiWiki/Plugin/color.pm @@ -10,6 +10,15 @@ use IkiWiki 3.00; sub import { hook(type => "preprocess", id => "color", call => \&preprocess); hook(type => "format", id => "color", call => \&format); + hook(type => "getsetup", id => "color", call => \&getsetup); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, } sub preserve_style ($$$) { diff --git a/IkiWiki/Plugin/format.pm b/IkiWiki/Plugin/format.pm index 1513cbed7..c8041209f 100644 --- a/IkiWiki/Plugin/format.pm +++ b/IkiWiki/Plugin/format.pm @@ -7,6 +7,15 @@ use IkiWiki 3.00; sub import { hook(type => "preprocess", id => "format", call => \&preprocess); + hook(type => "getsetup", id => "format", call => \&getsetup); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, } sub preprocess (@) { diff --git a/debian/changelog b/debian/changelog index 794dec418..06d11aa29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low to otherwise locked-down sites. * auto-blog.setup: Lock all pages, so only admin can post to the blog by default, and enable opendiscussion so others can comment. + * Fix color and format plugins to appear in the websetup interface. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From a4ec579d1a6632447db91f2e52e90633b96a070f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Feb 2010 16:24:14 -0500 Subject: amazon_s3: Fix to support the EU S3 datacenter, which is more picky about attempts to create already existing buckets. --- IkiWiki/Plugin/amazon_s3.pm | 6 +++++- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm index 3571c4189..cfd8cd347 100644 --- a/IkiWiki/Plugin/amazon_s3.pm +++ b/IkiWiki/Plugin/amazon_s3.pm @@ -132,6 +132,10 @@ sub getbucket { }); } + if (! $bucket) { + # Try to use existing bucket. + $bucket=$s3->bucket($config{amazon_s3_bucket}); + } if (! $bucket) { error(gettext("Failed to create S3 bucket: "). $s3->err.": ".$s3->errstr."\n"); @@ -178,7 +182,7 @@ sub writefile ($$$;$$) { # First, write the file to disk. my $ret=$IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::writefile'}->($file, $destdir, $content, $binary, $writer); - + my @keys=IkiWiki::Plugin::amazon_s3::file2keys("$destdir/$file"); # Store the data in S3. diff --git a/debian/changelog b/debian/changelog index 06d11aa29..358a5dc5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ ikiwiki (3.20100123) UNRELEASED; urgency=low * auto-blog.setup: Lock all pages, so only admin can post to the blog by default, and enable opendiscussion so others can comment. * 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. -- Joey Hess Tue, 26 Jan 2010 22:25:33 -0500 -- cgit v1.2.3 From f2d6d4f6b24bb399481c40dc6eb6f3fe25190c5d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 16:36:19 -0500 Subject: patch so far --- IkiWiki/Plugin/httpauth.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index 127c321f0..a18f8ca54 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -9,6 +9,8 @@ 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); } sub getsetup () { @@ -33,9 +35,21 @@ 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; +} + +sub canedit ($$$) { + my $page=shift; + my $cgi=shift; + my $session=shift; + + if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) { + return sub { + IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); + exit; + }; + } + else { + return undef; } } -- 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 'IkiWiki') 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 'IkiWiki') 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 e6678275a98bd00e888018409998fd67686149c8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 18:32:07 -0500 Subject: fix logic error --- IkiWiki/Plugin/httpauth.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index 202ca1153..5b7d65253 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -75,13 +75,16 @@ sub formbuilder_setup (@) { } } +sub need_httpauth_pagespec () { + return defined $config{httpauth_pagespec} && + length $config{httpauth_pagespec} && + defined $config{cgiauthurl}; +} + 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}); + pagespec_match($page, $config{httpauth_pagespec}); } sub canedit ($$$) { @@ -89,7 +92,9 @@ sub canedit ($$$) { my $cgi=shift; my $session=shift; - if (! defined $cgi->remote_user() && test_httpauth_pagespec($page)) { + if (! defined $cgi->remote_user() && + need_httpauth_pagespec() && + ! test_httpauth_pagespec($page)) { return sub { IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string()); @@ -106,6 +111,7 @@ sub pagetemplate (@_) { my $template=$params{template}; if ($template->param("editurl") && + need_httpauth_pagespec() && test_httpauth_pagespec($params{page})) { # go directly to cgiauthurl when editing a page matching # the pagespec -- cgit v1.2.3 From 6f1d6236185148930a2c7694c9ae59877997d0d4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 19:54:40 -0500 Subject: partially fix httpauth canedit hook My logic was right before. Cleaned up some code. (Page creation is still a problem.) Also, I removed the Edit url munging, because that is not necessary with the canedit hook, since canedit will handle redirection through cgiauthurl if necessary. --- IkiWiki/Plugin/httpauth.pm | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm index 5b7d65253..b2bb2701a 100644 --- a/IkiWiki/Plugin/httpauth.pm +++ b/IkiWiki/Plugin/httpauth.pm @@ -11,8 +11,8 @@ sub import { hook(type => "auth", id => "httpauth", call => \&auth); hook(type => "formbuilder_setup", id => "httpauth", call => \&formbuilder_setup); - hook(type => "canedit", id => "httpauth", call => \&canedit); - hook(type => "pagetemplate", id => "httpauth", call => \&pagetemplate); + hook(type => "canedit", id => "httpauth", call => \&canedit, + first => 1); } sub getsetup () { @@ -41,7 +41,9 @@ sub redir_cgiauthurl ($;@) { my $cgi=shift; IkiWiki::redirect($cgi, - IkiWiki::cgiurl(cgiurl => $config{cgiauthurl}, @_)); + @_ > 1 ? IkiWiki::cgiurl(cgiurl => $config{cgiauthurl}, @_) + : $config{cgiauthurl}."?@_" + ); exit; } @@ -75,16 +77,11 @@ sub formbuilder_setup (@) { } } -sub need_httpauth_pagespec () { - return defined $config{httpauth_pagespec} && - length $config{httpauth_pagespec} && - defined $config{cgiauthurl}; -} - sub test_httpauth_pagespec ($) { my $page=shift; - pagespec_match($page, $config{httpauth_pagespec}); + return ( + ); } sub canedit ($$$) { @@ -93,12 +90,13 @@ sub canedit ($$$) { my $session=shift; if (! defined $cgi->remote_user() && - need_httpauth_pagespec() && - ! test_httpauth_pagespec($page)) { + defined $config{httpauth_pagespec} && + length $config{httpauth_pagespec} && + defined $config{cgiauthurl} && + pagespec_match($page, $config{httpauth_pagespec})) { return sub { - IkiWiki::redirect($cgi, - $config{cgiauthurl}.'?'.$cgi->query_string()); - exit; + # bounce thru cgiauthurl and back to edit action + redir_cgiauthurl($cgi, $cgi->query_string()); }; } else { @@ -106,19 +104,4 @@ sub canedit ($$$) { } } -sub pagetemplate (@_) { - my %params=@_; - my $template=$params{template}; - - if ($template->param("editurl") && - need_httpauth_pagespec() && - 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 -- cgit v1.2.3 From 7af18f2a1ec8b5ce4764813b0464112f517e806f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 20:13:30 -0500 Subject: reorder canedit checks during page creation to have best_loc first When creating a page, multiple locations are tested to see if they can be edited. If all fail, one of the failure subs is called, to log the user in to allow them to proceed with the edit. So far so good. But, what if some pages fail for one reason, and some for another? This occurs when httpauth_pagespec is used in conjunction with signinedit (and openid or something). When the user is not signed in at all The former will fail to edit a page because the user was not httpauthed. The latter will fail to edit a different page, because the user was not signed in. One of their failure methods gets to run first. The page creation code always ran the failure method corresponding to the topmost page location. So, when editing a foo/Discussion page, and with httpauth_pagespec => "*!/Discussion", it ran the httpauth failure method, which was exactly the wrong thing to do. I fixed this by making it instead run the failure method for the *best* page location. In the above example, that's foo/Discussion, so signinedit runs, as desired, and we get the signin page. This seems like it will be the right choice, or at least an acceptable choice. If a user wants to use httpauth they can always choose it on the signin page. --- IkiWiki/Plugin/editpage.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 219386a30..9211cca89 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -272,8 +272,10 @@ sub cgi_editpage ($$) { check_canedit($_, $q, $session, 1) } @page_locs; if (! @editable_locs) { - # let it throw an error this time - map { check_canedit($_, $q, $session) } @page_locs; + # now let it throw an error, or prompt for + # login + map { check_canedit($_, $q, $session) } + ($best_loc, @page_locs); } my @page_types; -- 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 'IkiWiki') 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 8fdc238c8c9bdfd196310c6261d9ad328a4d9fd2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 22:55:35 -0500 Subject: fix websetup display of unsafe arrays in expert mode --- IkiWiki/Plugin/websetup.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index e477bcc20..76ca1c9e2 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -138,9 +138,9 @@ sub showfields ($$$@) { my $value=$config{$key}; - if ($info{safe} && (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { - $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) } @{$value} : ""), - "", ""]; # blank items for expansion + 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 } else { $value=Encode::encode_utf8($value); -- cgit v1.2.3 From 18394f6ba99422b50e3796e91030498f93e7c4a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 00:21:12 -0500 Subject: improve websetup fieldset display to handle sections --- IkiWiki/Plugin/websetup.pm | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 76ca1c9e2..445552e40 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -66,6 +66,11 @@ sub showfields ($$$@) { while (@_) { my $key=shift; my %info=%{shift()}; + + if ($key eq 'plugin') { + %plugininfo=%info; + next; + } # skip internal settings next if defined $info{type} && $info{type} eq "internal"; @@ -78,15 +83,12 @@ sub showfields ($$$@) { # these are handled specially, so don't show next if $key eq 'add_plugins' || $key eq 'disable_plugins'; - if ($key eq 'plugin') { - %plugininfo=%info; - next; - } - push @show, $key, \%info; } - my $section=defined $plugin ? $plugin." ".gettext("plugin") : "main"; + my $section=defined $plugin + ? sprintf(gettext("%s plugin:"), $plugininfo{section}).$plugin + : "main"; my %enabledfields; my $shownfields=0; @@ -97,6 +99,16 @@ sub showfields ($$$@) { @show=(); } + my $section_fieldset; + if (defined $plugin) { + # Define the combined fieldset for the plugin's section. + # This ensures that this fieldset comes first. + $section_fieldset=sprintf(gettext("%s plugins"), $plugininfo{section}); + $form->field(name => "placeholder.$plugininfo{section}", + type => "hidden", + fieldset => $section_fieldset); + } + # show plugin toggle if (defined $plugin && (! $plugin_forced || $config{websetup_advanced})) { my $name="enable.$plugin"; @@ -137,6 +149,9 @@ sub showfields ($$$@) { my $name=defined $plugin ? $plugin.".".$key : $section.".".$key; my $value=$config{$key}; + if (! defined $value) { + $value=""; + } if (ref $value eq 'ARRAY' || ref $info{example} eq 'ARRAY') { $value=[(ref $value eq 'ARRAY' ? map { Encode::encode_utf8($_) } @{$value} : "")]; @@ -203,11 +218,11 @@ sub showfields ($$$@) { $shownfields++; } - # if no fields were shown for the plugin, drop it into the - # plugins fieldset + # if no fields were shown for the plugin, drop it into a combined + # fieldset for its section if (defined $plugin && (! $plugin_forced || $config{websetup_advanced}) && ! $shownfields) { - $form->field(name => "enable.$plugin", fieldset => "plugins"); + $form->field(name => "enable.$plugin", fieldset => $section_fieldset); } return %enabledfields; @@ -258,7 +273,6 @@ sub showform ($$) { params => $cgi, fieldsets => [ [main => gettext("main")], - [plugins => gettext("plugins")] ], action => $config{cgiurl}, template => {type => 'div'}, -- cgit v1.2.3 From 5b76fc824cf5fdf8d78afb74724a6d5453c79baa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 00:22:00 -0500 Subject: reword --- IkiWiki/Setup.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index b21bd7bfe..7a7683fab 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -103,7 +103,7 @@ sub getsetup () { # hashref between array and hash) my %s=@s; if (! exists $s{plugin} || ! $s{plugin}->{section}) { - $s{plugin}->{section}="misc"; + $s{plugin}->{section}="other"; } # only the selected rcs plugin is included -- cgit v1.2.3 From 0ea2f0936bf9d51f4760fe5a8e57d46d1b6ecce6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 00:51:19 -0500 Subject: add plugin section, and show which plugins need no configuration --- IkiWiki/Setup/Standard.pm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index c99dbb620..bdf52f25a 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -90,16 +90,24 @@ sub gendump ($) { # disable logging to syslog while dumping $config{syslog}=undef; - my $curr_section; + eval q{use Text::Wrap}; + die $@ if $@; + + my %section_plugins; 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#"; + push @{$section_plugins{$section}}, $plugin; + if (@{$section_plugins{$section}} == 1) { + push @ret, "", "\t#", "\t# $section plugins", + sub { + wrap("\t# (", "\t# ", + join(", ", @{$section_plugins{$section}})).")" + }, + "\t#"; } my @values=dumpvalues(\%setup, @{$setup}); @@ -119,7 +127,7 @@ sub gendump ($) { "use IkiWiki::Setup::Standard {"; push @ret, "}"; - return @ret; + return map { ref $_ ? $_->() : $_ } @ret; } 1 -- 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 'IkiWiki') 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 2d4b84e45f1dc947e8bb9ff92ab543861223ff42 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 01:16:20 -0500 Subject: borders --- IkiWiki/Setup/Standard.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index bdf52f25a..71abb1cfb 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -102,12 +102,12 @@ sub gendump ($) { my $section=$s{plugin}->{section}; push @{$section_plugins{$section}}, $plugin; if (@{$section_plugins{$section}} == 1) { - push @ret, "", "\t#", "\t# $section plugins", + push @ret, "", "\t".("#" x 70), "\t# $section plugins", sub { wrap("\t# (", "\t# ", join(", ", @{$section_plugins{$section}})).")" }, - "\t#"; + "\t".("#" x 70); } my @values=dumpvalues(\%setup, @{$setup}); -- cgit v1.2.3 From 73242f0890eb7823e2e864dab6477d8fc2bdd69f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 04:01:04 -0500 Subject: remove unnecessary IkiWiki:: --- IkiWiki/Plugin/typography.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/typography.pm b/IkiWiki/Plugin/typography.pm index f62be82bb..9389b24d4 100644 --- a/IkiWiki/Plugin/typography.pm +++ b/IkiWiki/Plugin/typography.pm @@ -9,7 +9,7 @@ use IkiWiki 3.00; sub import { hook(type => "getopt", id => "typography", call => \&getopt); hook(type => "getsetup", id => "typography", call => \&getsetup); - IkiWiki::hook(type => "sanitize", id => "typography", call => \&sanitize); + hook(type => "sanitize", id => "typography", call => \&sanitize); } sub getopt () { -- cgit v1.2.3 From 805b3afff7158a7912b06948d134478308b5855b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 04:09:57 -0500 Subject: formatting sillyness --- IkiWiki/Setup/Standard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 71abb1cfb..f7a322317 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -104,7 +104,7 @@ sub gendump ($) { if (@{$section_plugins{$section}} == 1) { push @ret, "", "\t".("#" x 70), "\t# $section plugins", sub { - wrap("\t# (", "\t# ", + wrap("\t# (", "\t# ", join(", ", @{$section_plugins{$section}})).")" }, "\t".("#" x 70); -- 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 'IkiWiki') 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 34fff64e7b56f4f8cd99430f9f927d2a5d1e3619 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 06:35:52 -0500 Subject: setup file ordering --- IkiWiki/Plugin/aggregate.pm | 1 - IkiWiki/Plugin/amazon_s3.pm | 1 - IkiWiki/Plugin/autoindex.pm | 1 - IkiWiki/Plugin/calendar.pm | 1 + IkiWiki/Plugin/color.pm | 1 + IkiWiki/Plugin/conditional.pm | 2 +- IkiWiki/Plugin/cutpaste.pm | 1 + IkiWiki/Plugin/date.pm | 1 + IkiWiki/Plugin/format.pm | 1 + IkiWiki/Plugin/fortune.pm | 1 + IkiWiki/Plugin/graphviz.pm | 1 + IkiWiki/Plugin/haiku.pm | 1 + IkiWiki/Plugin/img.pm | 1 + IkiWiki/Plugin/linkmap.pm | 1 + IkiWiki/Plugin/listdirectives.pm | 1 + IkiWiki/Plugin/map.pm | 1 + IkiWiki/Plugin/more.pm | 1 + IkiWiki/Plugin/orphans.pm | 1 + IkiWiki/Plugin/pagecount.pm | 1 + IkiWiki/Plugin/pagestats.pm | 1 + IkiWiki/Plugin/pingee.pm | 1 - IkiWiki/Plugin/pinger.pm | 1 - IkiWiki/Plugin/poll.pm | 1 + IkiWiki/Plugin/polygen.pm | 1 + IkiWiki/Plugin/postsparkline.pm | 1 + IkiWiki/Plugin/progress.pm | 1 + IkiWiki/Plugin/recentchanges.pm | 1 - IkiWiki/Plugin/rsync.pm | 1 - IkiWiki/Plugin/shortcut.pm | 1 + IkiWiki/Plugin/sparkline.pm | 1 + IkiWiki/Plugin/table.pm | 1 + IkiWiki/Plugin/template.pm | 1 + IkiWiki/Plugin/testpagespec.pm | 1 - IkiWiki/Plugin/teximg.pm | 1 + IkiWiki/Plugin/toc.pm | 1 + IkiWiki/Plugin/toggle.pm | 1 + IkiWiki/Plugin/underlay.pm | 1 - IkiWiki/Plugin/version.pm | 1 + IkiWiki/Setup.pm | 4 +++- 39 files changed, 32 insertions(+), 11 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index c18d413e6..5a9eb433d 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -43,7 +43,6 @@ 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 f2f4dbcf2..cfd8cd347 100644 --- a/IkiWiki/Plugin/amazon_s3.pm +++ b/IkiWiki/Plugin/amazon_s3.pm @@ -45,7 +45,6 @@ sub getsetup () { plugin => { safe => 0, rebuild => 0, - section => "special-purpose", }, amazon_s3_key_id => { type => "string", diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index e50464dca..555856b11 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -16,7 +16,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, - section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 2b87451ce..aaee2c610 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -38,6 +38,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, archivebase => { type => "string", diff --git a/IkiWiki/Plugin/color.pm b/IkiWiki/Plugin/color.pm index b9407ba28..d550dd9f4 100644 --- a/IkiWiki/Plugin/color.pm +++ b/IkiWiki/Plugin/color.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index beeddc672..892b1cff9 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -16,7 +16,7 @@ sub getsetup { plugin => { safe => 1, rebuild => undef, - section => "core", + section => "widget", }, } diff --git a/IkiWiki/Plugin/cutpaste.pm b/IkiWiki/Plugin/cutpaste.pm index 417442f34..01e9ce043 100644 --- a/IkiWiki/Plugin/cutpaste.pm +++ b/IkiWiki/Plugin/cutpaste.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/date.pm b/IkiWiki/Plugin/date.pm index 652e6df0a..ea5c9a9c5 100644 --- a/IkiWiki/Plugin/date.pm +++ b/IkiWiki/Plugin/date.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/format.pm b/IkiWiki/Plugin/format.pm index c8041209f..d54e71131 100644 --- a/IkiWiki/Plugin/format.pm +++ b/IkiWiki/Plugin/format.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/fortune.pm b/IkiWiki/Plugin/fortune.pm index 17e57dea1..f481c7eac 100644 --- a/IkiWiki/Plugin/fortune.pm +++ b/IkiWiki/Plugin/fortune.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index 32e994d6b..bec122076 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/haiku.pm b/IkiWiki/Plugin/haiku.pm index 5a062a276..bf23dce67 100644 --- a/IkiWiki/Plugin/haiku.pm +++ b/IkiWiki/Plugin/haiku.pm @@ -16,6 +16,7 @@ sub getsetup { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 82db15a7e..f06121578 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 68eb6c8c6..ac26e072e 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/listdirectives.pm b/IkiWiki/Plugin/listdirectives.pm index 09f08c567..8a67f7160 100644 --- a/IkiWiki/Plugin/listdirectives.pm +++ b/IkiWiki/Plugin/listdirectives.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, directive_description_dir => { type => "string", diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 788b96827..ce3ac1d24 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -21,6 +21,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/more.pm b/IkiWiki/Plugin/more.pm index 77d5fb077..266c8e1d0 100644 --- a/IkiWiki/Plugin/more.pm +++ b/IkiWiki/Plugin/more.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 702943f87..e3cc3c940 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index 8d36f057e..dd5de3c83 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -15,6 +15,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 4313aa271..1c0b46830 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -27,6 +27,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/pingee.pm b/IkiWiki/Plugin/pingee.pm index aafce9e70..f5386d0ca 100644 --- a/IkiWiki/Plugin/pingee.pm +++ b/IkiWiki/Plugin/pingee.pm @@ -15,7 +15,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, - section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/pinger.pm b/IkiWiki/Plugin/pinger.pm index a797fc7bd..c20ecb5d4 100644 --- a/IkiWiki/Plugin/pinger.pm +++ b/IkiWiki/Plugin/pinger.pm @@ -21,7 +21,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => 0, - section => "special-purpose", }, pinger_timeout => { type => "integer", diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index bc1e3501e..6bc4579c2 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/polygen.pm b/IkiWiki/Plugin/polygen.pm index bc21d71c7..78e3611e1 100644 --- a/IkiWiki/Plugin/polygen.pm +++ b/IkiWiki/Plugin/polygen.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index 0d5a12e33..2fae9c5fe 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/progress.pm b/IkiWiki/Plugin/progress.pm index fe64b40b1..d27df5ca8 100644 --- a/IkiWiki/Plugin/progress.pm +++ b/IkiWiki/Plugin/progress.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 04219b721..5c7b71aaa 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -22,7 +22,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, - section => "core", }, recentchangespage => { type => "string", diff --git a/IkiWiki/Plugin/rsync.pm b/IkiWiki/Plugin/rsync.pm index 8dd983be7..e38801e4a 100644 --- a/IkiWiki/Plugin/rsync.pm +++ b/IkiWiki/Plugin/rsync.pm @@ -16,7 +16,6 @@ sub getsetup () { plugin => { safe => 0, rebuild => 0, - section => "special-purpose", }, rsync_command => { type => "string", diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm index 1840a5722..0cedbe447 100644 --- a/IkiWiki/Plugin/shortcut.pm +++ b/IkiWiki/Plugin/shortcut.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index fb4849492..42665ac63 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -24,6 +24,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm index 96d63f455..2edd1eacd 100644 --- a/IkiWiki/Plugin/table.pm +++ b/IkiWiki/Plugin/table.pm @@ -16,6 +16,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index 39d9667f9..3e024c5f8 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -19,6 +19,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 17a77cb69..440fca33b 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -15,7 +15,6 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, - section => "special-purpose", }, } diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm index f92ed0132..0aaa79698 100644 --- a/IkiWiki/Plugin/teximg.pm +++ b/IkiWiki/Plugin/teximg.pm @@ -31,6 +31,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, teximg_dvipng => { type => "boolean", diff --git a/IkiWiki/Plugin/toc.pm b/IkiWiki/Plugin/toc.pm index b8537d3eb..ac07b9af6 100644 --- a/IkiWiki/Plugin/toc.pm +++ b/IkiWiki/Plugin/toc.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm index ef066a42f..f9c899540 100644 --- a/IkiWiki/Plugin/toggle.pm +++ b/IkiWiki/Plugin/toggle.pm @@ -20,6 +20,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index ab74fc37e..116fe7324 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -18,7 +18,6 @@ sub getsetup () { plugin => { safe => 0, rebuild => undef, - section => "special-purpose", }, add_underlays => { type => "string", diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index 587cd55fa..c13643478 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 7a7683fab..a3fd5ce66 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -121,9 +121,11 @@ sub getsetup () { $config{syslog}=$syslog; return map { sort { $a->[0] cmp $b->[0] } @{$sections{$_}} } - sort { # core first, then alphabetical + sort { # core first, other last, otherwise alphabetical ($b eq "core") <=> ($a eq "core") || + ($a eq "other") <=> ($b eq "other") + || $a cmp $b } keys %sections; } -- cgit v1.2.3 From 9a0b9bdc88c1b47c14ad0b587c93bbac400e61ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Feb 2010 18:09:28 -0500 Subject: minor refactor/optimisation --- IkiWiki/Plugin/comments.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 1e71749a4..5bcf4a981 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -742,28 +742,24 @@ sub pagetemplate (@) { } } - if ($template->query(name => 'commentsurl')) { - if ($shown) { + if ($shown) { + if ($template->query(name => 'commentsurl')) { $template->param(commentsurl => urlto($page, undef, 1).'#comments'); } - } - if ($template->query(name => 'atomcommentsurl') && $config{usedirs}) { - if ($shown) { + if ($template->query(name => 'atomcommentsurl') && $config{usedirs}) { # This will 404 until there are some comments, but I # think that's probably OK... $template->param(atomcommentsurl => urlto($page, undef, 1).'comments.atom'); } - } - if ($template->query(name => 'commentslink')) { # XXX Would be nice to say how many comments there are in # the link. But, to update the number, blog pages # would have to update whenever comments of any inlines # page are added, which is not currently done. - if ($shown) { + if ($template->query(name => 'commentslink')) { $template->param(commentslink => htmllink($page, $params{destpage}, $page, linktext => gettext("Comments"), -- cgit v1.2.3 From c21eb47e627de2dfd5409b459b2e11498c534f3c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Feb 2010 18:27:47 -0500 Subject: comments: Display number of comments in comment action link. This was not doable before, but when I added transitive dependency handling in the big dependency rewrite, it became possible to include a comment count when inlining. This also improves the action link when a page has no comments. It will link direct to the cgi to allow posting the first comment. And if the page is locked to prevent posting new comments, the link is no longer shown. --- IkiWiki/Plugin/comments.pm | 36 +++++++++++++++++++++++++----------- debian/changelog | 8 ++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 5bcf4a981..8f8472f07 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -736,9 +736,7 @@ sub pagetemplate (@) { } if ($shown && commentsopen($page)) { - my $addcommenturl = IkiWiki::cgiurl(do => 'comment', - page => $page); - $template->param(addcommenturl => $addcommenturl); + $template->param(addcommenturl => addcommenturl($page)); } } @@ -755,16 +753,26 @@ sub pagetemplate (@) { urlto($page, undef, 1).'comments.atom'); } - # XXX Would be nice to say how many comments there are in - # the link. But, to update the number, blog pages - # would have to update whenever comments of any inlines - # page are added, which is not currently done. if ($template->query(name => 'commentslink')) { - $template->param(commentslink => - htmllink($page, $params{destpage}, $page, - linktext => gettext("Comments"), + my $num=num_comments($page, $config{srcdir}); + my $link; + if ($num > 0) { + $link = htmllink($page, $params{destpage}, $page, + linktext => sprintf(ngettext("%i comment", "%i comments", $num), $num), anchor => "comments", - noimageinline => 1)); + noimageinline => 1 + ); + } + elsif (commentsopen($page)) { + $link = "". + #translators: Here "Comment" is a verb; + #translators: the user clicks on it to + #translators: post a comment. + gettext("Comment"). + ""; + } + $template->param(commentslink => $link) + if defined $link; } } @@ -812,6 +820,12 @@ sub pagetemplate (@) { } } +sub addcommenturl ($) { + my $page=shift; + + return IkiWiki::cgiurl(do => 'comment', page => $page); +} + sub num_comments ($$) { my $page=shift; my $dir=shift; diff --git a/debian/changelog b/debian/changelog index c91feae0d..e3ec89eed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ikiwiki (3.20100213) UNRELEASED; urgency=low + + * comments: Display number of comments in comment action link. + * Rebuild wikis on upgrade to this version to get the comment counts + added to existing pages. + + -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 + ikiwiki (3.20100212) unstable; urgency=low * template: Preprocess parameters before htmlizing. -- cgit v1.2.3 From 068e47aa459028c260880ed5f27da2044cb79998 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Feb 2010 20:28:52 -0500 Subject: catch failure to open the filetypes file --- IkiWiki/Plugin/highlight.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index 947fb692e..e517ac5c0 100644 --- a/IkiWiki/Plugin/highlight.pm +++ b/IkiWiki/Plugin/highlight.pm @@ -80,7 +80,7 @@ my %highlighters; # Parse highlight's config file to get extension => language mappings. sub read_filetypes () { - open (IN, $filetypes); + open (IN, $filetypes) || error("$filetypes: $!"); while () { chomp; if (/^\$ext\((.*)\)=(.*)$/) { -- cgit v1.2.3 From a12c386c86d000971125d70bf22213fd9595ed45 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Feb 2010 16:26:13 -0500 Subject: Add force_overwrite setting to make setup automator overwrite existing files/directories. This can be useful if you're driving the setup automator from another program. --- IkiWiki/Setup/Automator.pm | 22 ++++++++++++---------- debian/changelog | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9fee4dcb7..79a610e20 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -40,17 +40,19 @@ sub import (@) { my $this=shift; IkiWiki::Setup::merge({@_}); - # Avoid overwriting any existing files. - foreach my $key (qw{srcdir destdir repository dumpsetup}) { - next unless exists $config{$key}; - my $add=""; - my $dir=IkiWiki::dirname($config{$key})."/"; - my $base=IkiWiki::basename($config{$key}); - while (-e $dir.$add.$base) { - $add=1 if ! $add; - $add++; + if (! $config{force_overwrite}) { + # Avoid overwriting any existing files. + foreach my $key (qw{srcdir destdir repository dumpsetup}) { + next unless exists $config{$key}; + my $add=""; + my $dir=IkiWiki::dirname($config{$key})."/"; + my $base=IkiWiki::basename($config{$key}); + while (-e $dir.$add.$base) { + $add=1 if ! $add; + $add++; + } + $config{$key}=$dir.$add.$base; } - $config{$key}=$dir.$add.$base; } # Set up wrapper diff --git a/debian/changelog b/debian/changelog index 1960a1226..bdbd818e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low * Rebuild wikis on upgrade to this version to get the comment counts added to existing pages. * Loosen regexp, to allow empty quoted parameters in directives. + * Add force_overwrite setting to make setup automator overwrite existing + files/directories. -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 -- cgit v1.2.3 From 6aaa6e0d245e450315a073f62e27c233cefbe9ec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Feb 2010 16:36:57 -0500 Subject: Fix admin openid detection in setup automator, and avoid prompting for a password. --- IkiWiki/Setup/Automator.pm | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 79a610e20..9da594e99 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -144,7 +144,7 @@ sub import (@) { # Create admin user(s). foreach my $admin (@{$config{adminuser}}) { - next if $admin=~/^http\?:\/\//; # openid + next if defined IkiWiki::openiduser($admin); # Prompt for password w/o echo. my ($password, $password2); diff --git a/debian/changelog b/debian/changelog index bdbd818e1..832bbaa85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low * Loosen regexp, to allow empty quoted parameters in directives. * Add force_overwrite setting to make setup automator overwrite existing files/directories. + * Fix admin openid detection in setup automator, and avoid prompting + for a password. -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 -- cgit v1.2.3 From 60d2dd318f66563c3ee3bde950d7f53426530acc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Feb 2010 00:12:47 -0500 Subject: Add new --clean option; this makes ikiwiki remove all built files in the destdir, as well as wrappers and the .ikiwiki directory. --- IkiWiki.pm | 7 +++++++ IkiWiki/Render.pm | 11 +++++++++++ Makefile.PL | 2 +- debian/changelog | 4 +++- doc/usage.mdwn | 8 ++++++++ ikiwiki.in | 12 +++++++++++- ikiwiki.spec | 2 +- 7 files changed, 42 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 9df6c90d6..00eadfd98 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -409,6 +409,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + clean => { + type => "internal", + default => 0, + description => "running in clean mode", + safe => 0, + rebuild => 0, + }, refresh => { type => "internal", default => 0, diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 3ebb1a324..af24df155 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -683,6 +683,17 @@ sub refresh () { } } +sub clean_rendered { + lockwiki(); + loadindex(); + remove_unrendered(); + foreach my $page (keys %oldrenderedfiles) { + foreach my $file (@{$oldrenderedfiles{$page}}) { + prune($config{destdir}."/".$file); + } + } +} + sub commandline_render () { lockwiki(); loadindex(); diff --git a/Makefile.PL b/Makefile.PL index 462f7364d..52421a711 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -51,7 +51,7 @@ docwiki: ikiwiki.out $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh extra_clean: - rm -rf html doc/.ikiwiki + $(PERL) -I. $(extramodules) $(tflag) ikiwiki.in -libdir . -setup docwiki.setup -clean rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc $(MAKE) -C po clean diff --git a/debian/changelog b/debian/changelog index 832bbaa85..3b92c598d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100213) UNRELEASED; urgency=low +ikiwiki (3.20100228) UNRELEASED; urgency=low * comments: Display number of comments in comment action link. * Rebuild wikis on upgrade to this version to get the comment counts @@ -8,6 +8,8 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low files/directories. * Fix admin openid detection in setup automator, and avoid prompting for a password. + * Add new --clean option; this makes ikiwiki remove all built + files in the destdir, as well as wrappers and the .ikiwiki directory. -- Joey Hess Sun, 14 Feb 2010 17:02:10 -0500 diff --git a/doc/usage.mdwn b/doc/usage.mdwn index e4808d4c2..a105d7e59 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -50,6 +50,14 @@ These options control the mode that ikiwiki operates in. If used with --setup --refresh, this makes it also update any configured wrappers. +* --clean + + This makes ikiwiki clean up by removing any files it denerated in the + `destination` directory, as well as any configured wrappers, and the + `.ikiwiki` state directory. This is mostly useful if you're running + ikiwiki in a Makefile to build documentation and want a corresponding + `clean` target. + * --cgi Enable [[CGI]] mode. In cgi mode ikiwiki runs as a cgi script, and diff --git a/ikiwiki.in b/ikiwiki.in index b8581d880..ae1251ff6 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -37,6 +37,7 @@ sub getconfig () { "syslog!" => \$config{syslog}, "rebuild!" => \$config{rebuild}, "refresh!" => \$config{refresh}, + "clean!" => \$config{clean}, "post-commit" => \$config{post_commit}, "render=s" => \$config{render}, "wrappers!" => \$config{genwrappers}, @@ -135,6 +136,7 @@ sub main () { if (@{$config{wrappers}} && ! $config{render} && ! $config{dumpsetup} && + ! $config{clean} && ((! $config{refresh} && ! $config{post_commit}) || $config{genwrappers})) { debug(gettext("generating wrappers..")); @@ -159,7 +161,7 @@ sub main () { # setup implies a wiki rebuild by default if (! $config{refresh} && ! $config{render} && - ! $config{post_commit}) { + ! $config{post_commit} && ! $config{clean}) { $config{rebuild}=1; } } @@ -190,6 +192,14 @@ sub main () { elsif ($config{post_commit} && ! commit_hook_enabled()) { # do nothing } + elsif ($config{clean}) { + require IkiWiki::Render; + foreach my $wrapper (@{$config{wrappers}}) { + prune($wrapper->{wrapper}); + } + clean_rendered(); + system("rm", "-rf", $config{wikistatedir}); + } else { if ($config{rebuild}) { debug(gettext("rebuilding wiki..")); diff --git a/ikiwiki.spec b/ikiwiki.spec index 865c9a325..1dba9f463 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20100212 +Version: 3.20100228 Release: 1%{?dist} Summary: A wiki compiler -- cgit v1.2.3 From 6d27bbd026ebed85f8501b6b4daefaba73061574 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Mar 2010 19:55:19 -0500 Subject: Fix utf8 issues in calls to md5_hex. This prevented comments containing some utf-8, including euro sign, from being submitted. Since md5_hex is a C implementation, the string has to be converted from perl's internal encoding to utf-8 when it is called. Some utf-8 happened to work before, apparently by accident. Note that this will change the checksums returned. unique_comment_location is only used when posting comments, so the checksum does not need to be stable there. I only changed page_to_id for completeness; it is passed a comment page name, and they can currently never contain utf-8. In teximg, the bug could perhaps be triggered if the tex source contained utf-8. If that happens, the checksum will change, and some extra work might be performed on upgrade to rebuild the image. --- IkiWiki/Plugin/comments.pm | 4 ++-- IkiWiki/Plugin/teximg.pm | 3 ++- debian/changelog | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 8f8472f07..bbf850a17 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -839,7 +839,7 @@ sub unique_comment_location ($$$) { eval q{use Digest::MD5 'md5_hex'}; error($@) if $@; - my $content_md5=md5_hex(shift); + my $content_md5=md5_hex(Encode::encode_utf8(shift)); my $dir=shift; @@ -862,7 +862,7 @@ sub page_to_id ($) { eval q{use Digest::MD5 'md5_hex'}; error($@) if $@; - return "comment-".md5_hex($page); + return "comment-".md5_hex(Encode::encode_utf8(($page)); } package IkiWiki::PageSpec; diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm index 0aaa79698..521af499f 100644 --- a/IkiWiki/Plugin/teximg.pm +++ b/IkiWiki/Plugin/teximg.pm @@ -8,6 +8,7 @@ use strict; use Digest::MD5 qw(md5_hex); use File::Temp qw(tempdir); use HTML::Entities; +use Encode; use IkiWiki 3.00; my $default_prefix = <{page} . "/$digest.png"; my $imglog = $params->{page} . "/$digest.log"; diff --git a/debian/changelog b/debian/changelog index c0f99291f..d1253c079 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100303) UNRELEASED; urgency=low + + * Fix utf8 issues in calls to md5_hex. + + -- Joey Hess Tue, 09 Mar 2010 19:46:35 -0500 + ikiwiki (3.20100302) unstable; urgency=low * comments: Display number of comments in comment action link. -- cgit v1.2.3 From 6eb71547dd5ba29d18bf8f19213e58e5d785a015 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Mar 2010 19:55:50 -0500 Subject: typo --- IkiWiki/Plugin/comments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index bbf850a17..ceb7c7836 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -855,7 +855,7 @@ sub unique_comment_location ($$$) { sub page_to_id ($) { # Converts a comment page name into a unique, legal html id - # addtibute value, that can be used as an anchor to link to the + # attribute value, that can be used as an anchor to link to the # comment. my $page=shift; -- 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 'IkiWiki') 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 45dfdcb2571953be6815342510b9bb2a73ce59e7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Mar 2010 16:10:04 -0500 Subject: search: Avoid '$' in the wikiname appearing unescaped on omega's query template, where it might crash omega. Really, a more general fix, this deals with any $ that might appear on the misctemplate. --- IkiWiki/Plugin/search.pm | 15 +++++++++++++-- debian/changelog | 2 ++ .../Exception:_Unknown_function___96__this__39___.mdwn | 6 ++++++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index fb68396a1..c0e8703d8 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -110,6 +110,7 @@ sub index (@) { # data used by omega # Decode html entities in it, since omega re-encodes them. eval q{use HTML::Entities}; + error $@ if $@; $doc->set_data( "url=".urlto($params{page}, "")."\n". "sample=".decode_entities($sample)."\n". @@ -214,9 +215,19 @@ sub setupfiles () { writefile("omega.conf", $config{wikistatedir}."/xapian", "database_dir .\n". "template_dir ./templates\n"); + + # Avoid omega interpreting anything in the misctemplate + # as an omegascript command. + my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0"); + eval q{use HTML::Entities}; + error $@ if $@; + $misctemplate=encode_entities($misctemplate, '\$'); + + my $querytemplate=readfile(IkiWiki::template_file("searchquery.tmpl")); + $misctemplate=~s/\0/$querytemplate/; + writefile("query", $config{wikistatedir}."/xapian/templates", - IkiWiki::misctemplate(gettext("search"), - readfile(IkiWiki::template_file("searchquery.tmpl")))); + $misctemplate); $setup=1; } } diff --git a/debian/changelog b/debian/changelog index 6b5671e3e..6828e6b3f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ ikiwiki (3.20100303) UNRELEASED; urgency=low * moderatedcomments: The moderate_users setting is deprecated. Instead, set moderate_pagespec to "!admin()" or "user(*)" instead. * Fix missing span on recentchanges page template. + * search: Avoid '$' in the wikiname appearing unescaped on omega's + query template, where it might crash omega. -- Joey Hess Tue, 09 Mar 2010 19:46:35 -0500 diff --git a/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn b/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn index 4f94b77bd..035247100 100644 --- a/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn +++ b/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn @@ -50,3 +50,9 @@ What might be causing this exception and how I might go about debugging exceptio } >>>>>> So `$foobar` clashes with Omega's template tags. Does this help? + +>>>>>>> Ahh. I had somehow gotten it into my head that you were talking +>>>>>>> about the title of a single page, not of the whole wiki. But +>>>>>>> you were clear all along it was the wiki title. Sorry for +>>>>>>> misunderstanding. I've put in a complete fix for this problem. +>>>>>>> if this was in [[bugs]], I'd close it. :) --[[Joey]] -- cgit v1.2.3 From 2ad3e60ee8272b7cccfd83ae02d5b45e2cec003d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Mar 2010 14:49:13 -0500 Subject: htmlscrubber: Security fix: In data:image/* uris, only allow a few whitelisted image types. No svg. --- IkiWiki/Plugin/htmlscrubber.pm | 6 +++--- debian/changelog | 4 +++- doc/security.mdwn | 12 ++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index ee284a45c..26e18ffc7 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -30,9 +30,9 @@ sub import { "msnim", "notes", "rsync", "secondlife", "skype", "ssh", "sftp", "smb", "sms", "snews", "webcal", "ymsgr", ); - # data is a special case. Allow data:image/*, but - # disallow data:text/javascript and everything else. - $safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/|[^:]+(?:$|\/))/i; + # data is a special case. Allow a few data:image/ types, + # but disallow data:text/javascript and everything else. + $safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/(?:png|jpeg|gif)|[^:]+(?:$|\/))/i; } sub getsetup () { diff --git a/debian/changelog b/debian/changelog index bae0e7ee0..7fdbbcb63 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100303) UNRELEASED; urgency=low +ikiwiki (3.20100312) unstable; urgency=HIGH * Fix utf8 issues in calls to md5_hex. * moderatedcomments: Added moderate_pagespec that can be used @@ -12,6 +12,8 @@ ikiwiki (3.20100303) UNRELEASED; urgency=low * Fix missing span on recentchanges page template. * search: Avoid '$' in the wikiname appearing unescaped on omega's query template, where it might crash omega. + * htmlscrubber: Security fix: In data:image/* uris, only allow a few + whitelisted image types. No svg. -- Joey Hess Tue, 09 Mar 2010 19:46:35 -0500 diff --git a/doc/security.mdwn b/doc/security.mdwn index 3924186c2..21aef316b 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -427,3 +427,15 @@ enabling TeX configuration options that disallow unsafe TeX commands. The fix was released on 30 Aug 2009 in version 3.1415926, and was backported to stable in version 2.53.4. If you use the teximg plugin, I recommend upgrading. ([[!cve CVE-2009-2944]]) + +## javascript insertion via svg uris + +Ivan Shmakov pointed out that the htmlscrubber allowed `data:image/*` urls, +including `data:image/svg+xml`. But svg can contain javascript, so that is +unsafe. + +This hole was discovered on 12 March 2010 and fixed the same day +with the release of ikiwiki 3.20100312. +A fix was also backported to Debian etch, as version 2.53.5. I recommend +upgrading to one of these versions if your wiki can be edited by third +parties. -- cgit v1.2.3 From edec9514f49bf335e8c71a19b169ccbba6a0ba95 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Mar 2010 15:01:24 -0500 Subject: typo --- IkiWiki/Plugin/comments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ceb7c7836..98786f432 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -862,7 +862,7 @@ sub page_to_id ($) { eval q{use Digest::MD5 'md5_hex'}; error($@) if $@; - return "comment-".md5_hex(Encode::encode_utf8(($page)); + return "comment-".md5_hex(Encode::encode_utf8(($page))); } package IkiWiki::PageSpec; -- 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 'IkiWiki') 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 a01e0679f4134f849473f8a98cb43f5a4aa8d7d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 13 Mar 2010 19:08:15 -0500 Subject: openid: Use Openid Simple Registration or OpenID Attribute Exchange to get the user's email address and username. The info is stored in the session database, not the user database. There should be no reason to need it when a user is not logged in. Also, hide the email field in the preferences page for openid users. Note that the email and username are not yet actually used for anything. The email will be useful for gravatar, while the username might be used for a more pretty display of the openid. --- IkiWiki/Plugin/openid.pm | 44 ++++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 2 ++ 2 files changed, 46 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index bb99446b4..9355cd85a 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -90,6 +90,7 @@ sub formbuilder_setup (@) { value => $session->param("name"), size => 50, force => 1, fieldset => "login"); + $form->field(name => "email", type => "hidden"); } } @@ -113,6 +114,26 @@ sub validate ($$$;$) { } } + # Ask for client to provide a name and email, if possible. + # Try sreg and ax + $claimed_identity->set_extension_args( + 'http://openid.net/extensions/sreg/1.1', + { + optional => 'email,fullname,nickname', + }, + ); + $claimed_identity->set_extension_args( + 'http://openid.net/srv/ax/1.0', + { + mode => 'fetch_request', + 'required' => 'email,fullname,nickname,firstname', + 'type.email' => "http://schema.openid.net/contact/email", + 'type.fullname' => "http://axschema.org/namePerson", + 'type.nickname' => "http://axschema.org/namePerson/friendly", + 'type.firstname' => "http://axschema.org/namePerson/first", + }, + ); + my $check_url = $claimed_identity->check_url( return_to => IkiWiki::cgiurl(do => "postsignin"), trust_root => $config{cgiurl}, @@ -139,6 +160,29 @@ sub auth ($$) { } elsif (my $vident = $csr->verified_identity) { $session->param(name => $vident->url); + + my @extensions=grep { defined } ( + $vident->signed_extension_fields('http://openid.net/extensions/sreg/1.1'), + $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), + ); + foreach my $ext (@extensions) { + foreach my $field (qw{value.email email}) { + if (exists $ext->{$field} && + defined $ext->{$field} && + length $ext->{$field}) { + $session->param(email => $ext->{$field}); + last; + } + } + foreach my $field (qw{value.nickname nickname value.fullname fullname value.firstname}) { + if (exists $ext->{$field} && + defined $ext->{$field} && + length $ext->{$field}) { + $session->param(username => $ext->{$field}); + last; + } + } + } } else { error("OpenID failure: ".$csr->err); diff --git a/debian/changelog b/debian/changelog index 9e779bb18..854d83130 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20100313) UNRELEASED; urgency=low * websetup: Add websetup_unsafe to allow marking other settings as unsafe. + * openid: Use Openid Simple Registration or OpenID Attribute Exchange + to get the user's email address and username. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 -- cgit v1.2.3 From b4ab74e722aaca406922fe614d9e6541dd87c3bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Mar 2010 17:35:59 -0400 Subject: C warning cleanup --- IkiWiki/Wrapper.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 5427a5c80..830b04877 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -76,8 +76,8 @@ EOF { int fd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR, 0666); if (fd != -1 && flock(fd, LOCK_EX) == 0) { - char *fd_s; - asprintf(&fd_s, "%i", fd); + char *fd_s=malloc(8); + sprintf(fd_s, "%i", fd); setenv("IKIWIKI_CGILOCK_FD", fd_s, 1); } } @@ -105,7 +105,7 @@ extern char **environ; char *newenviron[$#envsave+6]; int i=0; -addenv(char *var, char *val) { +void addenv(char *var, char *val) { char *s=malloc(strlen(var)+1+strlen(val)+1); if (!s) perror("malloc"); -- cgit v1.2.3 From dddd6aa99055d8505f73e39b12f049633d9cb4c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 18 Mar 2010 17:44:46 -0400 Subject: Allow wrappers to be built using tcc. --- IkiWiki/Wrapper.pm | 10 +++++++--- debian/changelog | 1 + .../post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 11 ++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 830b04877..f175b4a0b 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -101,7 +101,6 @@ EOF #include #include -extern char **environ; char *newenviron[$#envsave+6]; int i=0; @@ -121,8 +120,13 @@ $check_commit_hook $envsave newenviron[i++]="HOME=$ENV{HOME}"; newenviron[i++]="WRAPPED_OPTIONS=$configstring"; - newenviron[i]=NULL; - environ=newenviron; + + if (clearenv() != 0) { + perror("clearenv"); + exit(1); + } + for (; i>0; i--) + putenv(newenviron[i-1]); if (setregid(getegid(), -1) != 0 && setregid(getegid(), -1) != 0) { diff --git a/debian/changelog b/debian/changelog index e5347e2a1..73f6fcff8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.20100313) UNRELEASED; urgency=low wiki source files, such as .htaccess, that would normally be skipped for security or other reasons. Closes: #447267 (Thanks to Aaron Wilson for the original patch.) + * Allow wrappers to be built using tcc. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn index 4226c026a..a8fb19888 100644 --- a/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn +++ b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn @@ -9,6 +9,11 @@ Everything works fine with gcc. versions: Debian lenny + backports - - - +> Seems that tcc does not respect changing where `environ` points as a way +> to change the environment seen after `exec` +> +> Given that the man page for `clearenv` suggests using `environ=NULL` +> if `clearenv` is not available, I would be lerry or using tcc to compile +> stuff, since that could easily lead to a security compromise of code that +> expects that to work. However, I have fixed ikiwiki to use `clearenv`. +> --[[Joey]] [[done]] -- cgit v1.2.3 From cbf269eee29a66e1350e5553f38eee5b4683be8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 13:10:17 -0400 Subject: audited use POSIX The POSIX perl module exports a huge number of functions by default, so make sure all imports are qualified. (And remove one that was not necessary.) --- IkiWiki.pm | 2 +- IkiWiki/Plugin/calendar.pm | 2 +- IkiWiki/Plugin/relativedate.pm | 2 +- IkiWiki/Plugin/wmd.pm | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index a618836cf..6e333504e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -7,7 +7,7 @@ use strict; use Encode; use HTML::Entities; use URI::Escape q{uri_escape_utf8}; -use POSIX; +use POSIX (); use Storable; use open qw{:utf8 :std}; diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index aaee2c610..ff84bc440 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -22,7 +22,7 @@ use warnings; use strict; use IkiWiki 3.00; use Time::Local; -use POSIX; +use POSIX (); my $time=time; my @now=localtime($time); diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 06df2efd5..7f006af83 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'redefine'; use strict; use IkiWiki 3.00; -use POSIX; +use POSIX (); use Encode; sub import { diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 5361d2914..99b136281 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -4,7 +4,6 @@ package IkiWiki::Plugin::wmd; use warnings; use strict; use IkiWiki 3.00; -use POSIX; use Encode; sub import { -- cgit v1.2.3 From b1dade8d960ce7ccb549e5652d35a8e9dbccf5c6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 14:52:17 -0400 Subject: allow multiple setup file types, and support safe parsing Finally removed the last hardcoding of IkiWiki::Setup::Standard. Take the first "IkiWiki::Setup::*" in the setup file to define the setuptype, and remember that type to use in dumping later. (But it can be overridden using --set, etc.) Also, support setup file types that are not evaled. --- IkiWiki.pm | 7 +++++++ IkiWiki/Setup.pm | 40 +++++++++++++++++++++++++++++----------- IkiWiki/Setup/Standard.pm | 4 +++- 3 files changed, 39 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 6e333504e..241fb45b7 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -467,6 +467,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + setuptype => { + type => "internal", + default => "IkiWiki::Setup::Standard", + description => "perl class to use to dump setup file", + safe => 0, + rebuild => 0, + }, allow_symlinks_before_srcdir => { type => "boolean", default => 0, diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index a3fd5ce66..3accf3591 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -1,6 +1,8 @@ #!/usr/bin/perl -# Ikiwiki setup files are perl files that 'use IkiWiki::Setup::foo', -# passing it some sort of configuration data. +# Ikiwiki setup files can be perl files that 'use IkiWiki::Setup::foo', +# passing it some sort of configuration data. Or, they can contain +# the module name at the top, without the 'use', and the whole file is +# then fed into that module. package IkiWiki::Setup; @@ -10,24 +12,39 @@ use IkiWiki; use open qw{:utf8 :std}; use File::Spec; -sub load ($) { +sub load ($;$) { my $setup=IkiWiki::possibly_foolish_untaint(shift); + my $safemode=shift; + $config{setupfile}=File::Spec->rel2abs($setup); #translators: The first parameter is a filename, and the second #translators: is a (probably not translated) error message. open (IN, $setup) || error(sprintf(gettext("cannot read %s: %s"), $setup, $!)); - my $code; + my $content; { local $/=undef; - $code= || error("$setup: $!"); + $content= || error("$setup: $!"); } - - ($code)=$code=~/(.*)/s; close IN; - eval $code; - error("$setup: ".$@) if $@; + if ($content=~/(use\s+)?(IkiWiki::Setup::\w+)/) { + $config{setuptype}=$2; + if ($1) { + error sprintf(gettext("cannot load %s in safe mode"), $setup) + if $safemode; + eval IkiWiki::possibly_foolish_untaint($content); + error("$setup: ".$@) if $@; + } + else { + eval qq{require $config{setuptype}}; + error $@ if $@; + $config{setuptype}->loaddump(IkiWiki::possibly_foolish_untaint($content)); + } + } + else { + error sprintf(gettext("failed to parse %s"), $setup); + } } sub merge ($) { @@ -133,8 +150,9 @@ sub getsetup () { sub dump ($) { my $file=IkiWiki::possibly_foolish_untaint(shift); - require IkiWiki::Setup::Standard; - my @dump=IkiWiki::Setup::Standard::gendump("Setup file for ikiwiki."); + eval qq{require $config{setuptype}}; + error $@ if $@; + my @dump=$config{setuptype}->gendump("Setup file for ikiwiki."); open (OUT, ">", $file) || die "$file: $!"; print OUT "$_\n" foreach @dump; diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index f7a322317..4022ff03c 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -82,8 +82,10 @@ sub dumpvalues ($@) { return @ret; } -sub gendump ($) { +sub gendump ($$) { + my $class=shift; my $description=shift; + my %setup=(%config); my @ret; -- cgit v1.2.3 From 8a5084bc62d8f59320efc43fcd5e36bcc668374d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:09:08 -0400 Subject: whitespace --- IkiWiki/Plugin/darcs.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 1c9538e83..bc8394b90 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -51,7 +51,7 @@ sub darcs_info ($$$) { return $_; } -sub file_in_vc($$) { +sub file_in_vc ($$) { my $repodir = shift; my $file = shift; @@ -69,7 +69,7 @@ sub file_in_vc($$) { return $found; } -sub darcs_rev($) { +sub darcs_rev ($) { my $file = shift; # Relative to the repodir. my $repodir = $config{srcdir}; @@ -78,7 +78,7 @@ sub darcs_rev($) { return defined $hash ? $hash : ""; } -sub checkconfig() { +sub checkconfig () { if (defined $config{darcs_wrapper} && length $config{darcs_wrapper}) { push @{$config{wrappers}}, { wrapper => $config{darcs_wrapper}, @@ -87,7 +87,7 @@ sub checkconfig() { } } -sub getsetup() { +sub getsetup () { return plugin => { safe => 0, # rcs plugin @@ -238,7 +238,7 @@ sub rcs_commit ($$$;$$) { } } -sub rcs_commit_staged($$$) { +sub rcs_commit_staged ($$$) { my ($message, $user, $ipaddr) = @_; my $author; -- cgit v1.2.3 From 522daa7ea8111482701ce222800096edaf8eb2d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:27:15 -0400 Subject: factored out generic commented line dumping --- IkiWiki/Setup.pm | 94 +++++++++++++++++++++++++++++++++++++++-------- IkiWiki/Setup/Standard.pm | 94 +++++++++-------------------------------------- 2 files changed, 96 insertions(+), 92 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 3accf3591..369ff44d0 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -13,28 +13,28 @@ use open qw{:utf8 :std}; use File::Spec; sub load ($;$) { - my $setup=IkiWiki::possibly_foolish_untaint(shift); + my $file=IkiWiki::possibly_foolish_untaint(shift); my $safemode=shift; - $config{setupfile}=File::Spec->rel2abs($setup); + $config{setupfile}=File::Spec->rel2abs($file); #translators: The first parameter is a filename, and the second #translators: is a (probably not translated) error message. - open (IN, $setup) || error(sprintf(gettext("cannot read %s: %s"), $setup, $!)); + open (IN, $file) || error(sprintf(gettext("cannot read %s: %s"), $file, $!)); my $content; { local $/=undef; - $content= || error("$setup: $!"); + $content= || error("$file: $!"); } close IN; if ($content=~/(use\s+)?(IkiWiki::Setup::\w+)/) { $config{setuptype}=$2; if ($1) { - error sprintf(gettext("cannot load %s in safe mode"), $setup) + error sprintf(gettext("cannot load %s in safe mode"), $file) if $safemode; eval IkiWiki::possibly_foolish_untaint($content); - error("$setup: ".$@) if $@; + error("$file: ".$@) if $@; } else { eval qq{require $config{setuptype}}; @@ -43,10 +43,22 @@ sub load ($;$) { } } else { - error sprintf(gettext("failed to parse %s"), $setup); + error sprintf(gettext("failed to parse %s"), $file); } } +sub dump ($) { + my $file=IkiWiki::possibly_foolish_untaint(shift); + + eval qq{require $config{setuptype}}; + error $@ if $@; + my @dump=$config{setuptype}->gendump("Setup file for ikiwiki."); + + open (OUT, ">", $file) || die "$file: $!"; + print OUT "$_\n" foreach @dump; + close OUT; +} + sub merge ($) { # Merge setup into existing config and untaint. my %setup=%{shift()}; @@ -147,16 +159,68 @@ sub getsetup () { } keys %sections; } -sub dump ($) { - my $file=IkiWiki::possibly_foolish_untaint(shift); +sub commented_dump ($) { + my $dumpline=shift; + + my %setup=(%config); + my @ret; - eval qq{require $config{setuptype}}; - error $@ if $@; - my @dump=$config{setuptype}->gendump("Setup file for ikiwiki."); + # disable logging to syslog while dumping + $config{syslog}=undef; + + eval q{use Text::Wrap}; + die $@ if $@; + + my %section_plugins; + push @ret, commented_dumpvalues($dumpline, \%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}; + push @{$section_plugins{$section}}, $plugin; + if (@{$section_plugins{$section}} == 1) { + push @ret, "", "\t".("#" x 70), "\t# $section plugins", + sub { + wrap("\t# (", "\t# ", + join(", ", @{$section_plugins{$section}})).")" + }, + "\t".("#" x 70); + } - open (OUT, ">", $file) || die "$file: $!"; - print OUT "$_\n" foreach @dump; - close OUT; + my @values=commented_dumpvalues($dumpline, \%setup, @{$setup}); + if (@values) { + push @ret, "", "\t# $plugin plugin", @values; + } + } + + return map { ref $_ ? $_->() : $_ } @ret; +} + +sub commented_dumpvalues ($$@) { + my $dumpline=shift; + my $setup=shift; + my @ret; + while (@_) { + my $key=shift; + my %info=%{shift()}; + + next if $key eq "plugin" || $info{type} eq "internal"; + + push @ret, "\t# ".$info{description} if exists $info{description}; + + if (exists $setup->{$key} && defined $setup->{$key}) { + push @ret, $dumpline->($key, $setup->{$key}, $info{type}, ""); + delete $setup->{$key}; + } + elsif (exists $info{example}) { + push @ret, $dumpline->($key, $info{example}, $info{type}, "#"); + } + else { + push @ret, $dumpline->($key, "", $info{type}, "#"); + } + } + return @ret; } 1 diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 4022ff03c..9c177e497 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -1,7 +1,6 @@ #!/usr/bin/perl # Standard ikiwiki setup module. -# Parameters to import should be all the standard ikiwiki config stuff, -# plus an array of wrappers to set up. +# Parameters to import should be all the standard ikiwiki config stuff. package IkiWiki::Setup::Standard; @@ -13,6 +12,22 @@ sub import { IkiWiki::Setup::merge($_[1]); } +sub gendump ($$) { + my $class=shift; + my $description=shift; + + "#!/usr/bin/perl", + "# $description", + "#", + "# Passing this to ikiwiki --setup will make ikiwiki generate", + "# wrappers and build the wiki.", + "#", + "# Remember to re-run ikiwiki --setup any time you edit this file.", + "use IkiWiki::Setup::Standard {", + IkiWiki::Setup::commented_dump(\&dumpline), + "}"; +} + sub dumpline ($$$$) { my $key=shift; my $value=shift; @@ -57,79 +72,4 @@ sub dumpline ($$$$) { return "\t$prefix$key => $dumpedvalue,"; } -sub dumpvalues ($@) { - my $setup=shift; - my @ret; - while (@_) { - my $key=shift; - my %info=%{shift()}; - - next if $key eq "plugin" || $info{type} eq "internal"; - - push @ret, "\t# ".$info{description} if exists $info{description}; - - if (exists $setup->{$key} && defined $setup->{$key}) { - push @ret, dumpline($key, $setup->{$key}, $info{type}, ""); - delete $setup->{$key}; - } - elsif (exists $info{example}) { - push @ret, dumpline($key, $info{example}, $info{type}, "#"); - } - else { - push @ret, dumpline($key, "", $info{type}, "#"); - } - } - return @ret; -} - -sub gendump ($$) { - my $class=shift; - my $description=shift; - - my %setup=(%config); - my @ret; - - # disable logging to syslog while dumping - $config{syslog}=undef; - - eval q{use Text::Wrap}; - die $@ if $@; - - my %section_plugins; - 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}; - push @{$section_plugins{$section}}, $plugin; - if (@{$section_plugins{$section}} == 1) { - push @ret, "", "\t".("#" x 70), "\t# $section plugins", - sub { - wrap("\t# (", "\t# ", - join(", ", @{$section_plugins{$section}})).")" - }, - "\t".("#" x 70); - } - - my @values=dumpvalues(\%setup, @{$setup}); - if (@values) { - push @ret, "", "\t# $plugin plugin", @values; - } - } - - unshift @ret, - "#!/usr/bin/perl", - "# $description", - "#", - "# Passing this to ikiwiki --setup will make ikiwiki generate", - "# wrappers and build the wiki.", - "#", - "# Remember to re-run ikiwiki --setup any time you edit this file.", - "use IkiWiki::Setup::Standard {"; - push @ret, "}"; - - return map { ref $_ ? $_->() : $_ } @ret; -} - 1 -- cgit v1.2.3 From bbe1f2e493f009b49aba6ab83304f9484e37c61d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:35:21 -0400 Subject: move generic comment into IkiWiki::Setup --- IkiWiki/Setup.pm | 9 ++++++++- IkiWiki/Setup/Standard.pm | 11 +++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 369ff44d0..45f263bc8 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -52,7 +52,14 @@ sub dump ($) { eval qq{require $config{setuptype}}; error $@ if $@; - my @dump=$config{setuptype}->gendump("Setup file for ikiwiki."); + my @dump=$config{setuptype}->gendump( + "Setup file for ikiwiki.", + "", + "Passing this to ikiwiki --setup will make ikiwiki generate", + "wrappers and build the wiki.", + "", + "Remember to re-run ikiwiki --setup any time you edit this file.", + ); open (OUT, ">", $file) || die "$file: $!"; print OUT "$_\n" foreach @dump; diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 9c177e497..92e97c4b4 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -12,20 +12,15 @@ sub import { IkiWiki::Setup::merge($_[1]); } -sub gendump ($$) { +sub gendump ($@) { my $class=shift; - my $description=shift; "#!/usr/bin/perl", - "# $description", "#", - "# Passing this to ikiwiki --setup will make ikiwiki generate", - "# wrappers and build the wiki.", - "#", - "# Remember to re-run ikiwiki --setup any time you edit this file.", + (map { "# $_" } @_), "use IkiWiki::Setup::Standard {", IkiWiki::Setup::commented_dump(\&dumpline), - "}"; + "}" } sub dumpline ($$$$) { -- cgit v1.2.3 From 10f8a2c85841d5884ccee096145498af96f06f05 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:36:33 -0400 Subject: improve comments --- IkiWiki/Setup/Standard.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 92e97c4b4..33b578e12 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -1,6 +1,4 @@ #!/usr/bin/perl -# Standard ikiwiki setup module. -# Parameters to import should be all the standard ikiwiki config stuff. package IkiWiki::Setup::Standard; @@ -8,6 +6,7 @@ use warnings; use strict; use IkiWiki; +# Parameters to import should be all the standard ikiwiki config, in a hash. sub import { IkiWiki::Setup::merge($_[1]); } -- cgit v1.2.3 From 19a794b4829c548a7f5b9dc22e22c24d7f28bad8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:44:28 -0400 Subject: parameterized indent --- IkiWiki/Setup.pm | 20 +++++++++++--------- IkiWiki/Setup/Standard.pm | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 45f263bc8..a71a12d9d 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -166,8 +166,9 @@ sub getsetup () { } keys %sections; } -sub commented_dump ($) { +sub commented_dump ($$) { my $dumpline=shift; + my $indent=shift; my %setup=(%config); my @ret; @@ -179,7 +180,7 @@ sub commented_dump ($) { die $@ if $@; my %section_plugins; - push @ret, commented_dumpvalues($dumpline, \%setup, IkiWiki::getsetup()); + push @ret, commented_dumpvalues($dumpline, $indent, \%setup, IkiWiki::getsetup()); foreach my $pair (IkiWiki::Setup::getsetup()) { my $plugin=$pair->[0]; my $setup=$pair->[1]; @@ -187,25 +188,26 @@ sub commented_dump ($) { my $section=$s{plugin}->{section}; push @{$section_plugins{$section}}, $plugin; if (@{$section_plugins{$section}} == 1) { - push @ret, "", "\t".("#" x 70), "\t# $section plugins", + push @ret, "", $indent.("#" x 70), "$indent# $section plugins", sub { - wrap("\t# (", "\t# ", + wrap("$indent# (", "$indent# ", join(", ", @{$section_plugins{$section}})).")" }, - "\t".("#" x 70); + $indent.("#" x 70); } - my @values=commented_dumpvalues($dumpline, \%setup, @{$setup}); + my @values=commented_dumpvalues($dumpline, $indent, \%setup, @{$setup}); if (@values) { - push @ret, "", "\t# $plugin plugin", @values; + push @ret, "", "$indent# $plugin plugin", @values; } } return map { ref $_ ? $_->() : $_ } @ret; } -sub commented_dumpvalues ($$@) { +sub commented_dumpvalues ($$$@) { my $dumpline=shift; + my $indent=shift; my $setup=shift; my @ret; while (@_) { @@ -214,7 +216,7 @@ sub commented_dumpvalues ($$@) { next if $key eq "plugin" || $info{type} eq "internal"; - push @ret, "\t# ".$info{description} if exists $info{description}; + push @ret, "$indent# ".$info{description} if exists $info{description}; if (exists $setup->{$key} && defined $setup->{$key}) { push @ret, $dumpline->($key, $setup->{$key}, $info{type}, ""); diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 33b578e12..c85069304 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -18,7 +18,7 @@ sub gendump ($@) { "#", (map { "# $_" } @_), "use IkiWiki::Setup::Standard {", - IkiWiki::Setup::commented_dump(\&dumpline), + IkiWiki::Setup::commented_dump(\&dumpline, "\t"), "}" } -- cgit v1.2.3 From bba513a3e52170dc06b545a44f2d859ae4b757b5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:50:59 -0400 Subject: Add support for setup files written in YAML. Not the default. (Yet?) --- IkiWiki/Setup/Yaml.pm | 43 +++++++++++++++++++++++++++++++++++++++++++ debian/changelog | 1 + 2 files changed, 44 insertions(+) create mode 100644 IkiWiki/Setup/Yaml.pm (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm new file mode 100644 index 000000000..ba9192faf --- /dev/null +++ b/IkiWiki/Setup/Yaml.pm @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +package IkiWiki::Setup::Yaml; + +use warnings; +use strict; +use IkiWiki; +use YAML; + +sub loaddump ($$) { + my $class=shift; + my $content=shift; + + IkiWiki::Setup::merge(Load($content)); +} + +sub gendump ($@) { + my $class=shift; + + "# IkiWiki::Setup::Yaml - YAML formatted setup file", + "#", + (map { "# $_" } @_), + "#", + IkiWiki::Setup::commented_dump(\&dumpline, "") +} + + +sub dumpline ($$$$) { + my $key=shift; + my $value=shift; + my $type=shift; + my $prefix=shift; + + $YAML::UseHeader=0; + my $dump=Dump({$key => $value}); + chomp $dump; + if (length $prefix) { + $dump=join("", map { $prefix.$_ } split(/\n/, $dump)); + } + return $dump; +} + +1 diff --git a/debian/changelog b/debian/changelog index 73f6fcff8..e020b380f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ ikiwiki (3.20100313) UNRELEASED; urgency=low for security or other reasons. Closes: #447267 (Thanks to Aaron Wilson for the original patch.) * Allow wrappers to be built using tcc. + * Add support for setup files written in YAML. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 -- cgit v1.2.3 From 07bb08d0944a0282d6ed332deeefe347bc88139c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 15:55:10 -0400 Subject: shorten setuptype --- IkiWiki.pm | 2 +- IkiWiki/Setup.pm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 241fb45b7..022bfe3bd 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -469,7 +469,7 @@ sub getsetup () { }, setuptype => { type => "internal", - default => "IkiWiki::Setup::Standard", + default => "Standard", description => "perl class to use to dump setup file", safe => 0, rebuild => 0, diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index a71a12d9d..2cf01ea68 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -28,7 +28,7 @@ sub load ($;$) { } close IN; - if ($content=~/(use\s+)?(IkiWiki::Setup::\w+)/) { + if ($content=~/(use\s+)?IkiWiki::Setup::(\w+)/) { $config{setuptype}=$2; if ($1) { error sprintf(gettext("cannot load %s in safe mode"), $file) @@ -37,9 +37,9 @@ sub load ($;$) { error("$file: ".$@) if $@; } else { - eval qq{require $config{setuptype}}; + eval qq{require IkiWiki::Setup::$config{setuptype}}; error $@ if $@; - $config{setuptype}->loaddump(IkiWiki::possibly_foolish_untaint($content)); + "IkiWiki::Setup::$config{setuptype}"->loaddump(IkiWiki::possibly_foolish_untaint($content)); } } else { @@ -50,9 +50,9 @@ sub load ($;$) { sub dump ($) { my $file=IkiWiki::possibly_foolish_untaint(shift); - eval qq{require $config{setuptype}}; + eval qq{require IkiWiki::Setup::$config{setuptype}}; error $@ if $@; - my @dump=$config{setuptype}->gendump( + my @dump="IkiWiki::Setup::$config{setuptype}"->gendump( "Setup file for ikiwiki.", "", "Passing this to ikiwiki --setup will make ikiwiki generate", -- cgit v1.2.3 From 3b08789e6fb5809dd9b8f51f5c5e7df1d78e6930 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 16:09:07 -0400 Subject: load YAML on demand so as not to break test suite if YAML is not avilable --- IkiWiki/Setup/Yaml.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index ba9192faf..c7ff1988e 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -5,17 +5,21 @@ package IkiWiki::Setup::Yaml; use warnings; use strict; use IkiWiki; -use YAML; sub loaddump ($$) { my $class=shift; my $content=shift; + eval q{use YAML}; + die $@ if $@; IkiWiki::Setup::merge(Load($content)); } sub gendump ($@) { my $class=shift; + + eval q{use YAML}; + die $@ if $@; "# IkiWiki::Setup::Yaml - YAML formatted setup file", "#", -- cgit v1.2.3 From dc128dd829bfd08dba5d6929956d9064e7d37b81 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 17:54:58 -0400 Subject: fix newlines in commented defaults --- IkiWiki/Setup/Yaml.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index c7ff1988e..0fc273675 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -39,7 +39,7 @@ sub dumpline ($$$$) { my $dump=Dump({$key => $value}); chomp $dump; if (length $prefix) { - $dump=join("", map { $prefix.$_ } split(/\n/, $dump)); + $dump=join("\n", map { $prefix.$_ } split(/\n/, $dump)); } return $dump; } -- cgit v1.2.3 From aea5bf9b40f6676e93f987c28d9f2aa23608f5da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Mar 2010 14:51:47 -0400 Subject: reset setuptype to standard after an automator setup file is loaded so a standard file is generated (by default) --- IkiWiki/Setup/Automator.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9da594e99..9f694e18e 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -39,6 +39,7 @@ sub sanitize_wikiname ($) { sub import (@) { my $this=shift; IkiWiki::Setup::merge({@_}); + $config{setuptype}='Standard'; if (! $config{force_overwrite}) { # Avoid overwriting any existing files. -- cgit v1.2.3 From 85778f59fd0d84410f6e4191802e634b0f3c8935 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Mar 2010 14:52:21 -0400 Subject: check for 'require' instead of 'use' --- IkiWiki/Setup.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 2cf01ea68..06102058b 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -28,7 +28,7 @@ sub load ($;$) { } close IN; - if ($content=~/(use\s+)?IkiWiki::Setup::(\w+)/) { + if ($content=~/((?:use|require)\s+)?IkiWiki::Setup::(\w+)/) { $config{setuptype}=$2; if ($1) { error sprintf(gettext("cannot load %s in safe mode"), $file) -- cgit v1.2.3 From 440e18bc15389780833fc8b9c04116a97eeaeaa2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Mar 2010 14:59:21 -0400 Subject: reset setuptype first, actually so setup file can override default --- IkiWiki/Setup/Automator.pm | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 9f694e18e..e9a572450 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -38,8 +38,8 @@ sub sanitize_wikiname ($) { sub import (@) { my $this=shift; - IkiWiki::Setup::merge({@_}); $config{setuptype}='Standard'; + IkiWiki::Setup::merge({@_}); if (! $config{force_overwrite}) { # Avoid overwriting any existing files. diff --git a/debian/changelog b/debian/changelog index e020b380f..4d0639a58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100313) UNRELEASED; urgency=low +ikiwiki (3.20100320) UNRELEASED; urgency=low * websetup: Add websetup_unsafe to allow marking other settings as unsafe. -- cgit v1.2.3 From 0618f099dab8bd4f7f47e2695db01eabe49e3316 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 24 Mar 2010 00:59:01 +0000 Subject: Have the meta plugin add a meta_title sort order --- IkiWiki/Plugin/meta.pm | 15 +++++++++++++++ doc/ikiwiki/pagespec/sorting.mdwn | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 5f046cb2a..bf8159814 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -13,6 +13,7 @@ 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 () { @@ -282,6 +283,20 @@ sub pagetemplate (@) { } } +sub title { + my $title = $pagestate{$_[0]}{meta}{title}; + + if (defined $title) { + return $title; + } + + return pagetitle(IkiWiki::basename($_[0])); +} + +sub sort_meta_title { + return title($_[0]) cmp title($_[1]); +} + sub match { my $field=shift; my $page=shift; diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index 9007c23bf..3a9fef9b6 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -9,7 +9,12 @@ orders can be specified. * `title_natural` - Only available if [[!cpan Sort::Naturally]] is 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") +[[!if test="enabled(meta)" then=""" +* `meta_title` - Order by the full title set by the `\[[!meta title="foo"]]` + [[ikiwiki/directive]]. +"""]] -Plugins can add additional sort orders. +Plugins can add additional sort orders, so more might be available on this +wiki. [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From b0ae19872d443860aeaab7069255e3a68a520887 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 24 Mar 2010 03:18:24 +0000 Subject: Add an optional "sort" argument to meta titles, defaulting to the title This allows correct sorting of titles, names, etc., with: [[!meta title="David Bowie" sort="Bowie, David"]] [[!meta title="The Beatles" sort="Beatles, The"]] --- IkiWiki/Plugin/meta.pm | 16 +++++++++++----- doc/ikiwiki/directive/meta.mdwn | 7 +++++++ doc/ikiwiki/pagespec/sorting.mdwn | 7 ++++--- 3 files changed, 22 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index bf8159814..a470041c9 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -90,6 +90,12 @@ sub preprocess (@) { # Metadata collection that needs to happen during the scan pass. if ($key eq 'title') { $pagestate{$page}{meta}{title}=HTML::Entities::encode_numeric($value); + if (exists $params{sort}) { + $pagestate{$page}{meta}{titlesort}=$params{sort}; + } + else { + $pagestate{$page}{meta}{titlesort}=$value; + } return ""; } elsif ($key eq 'description') { @@ -283,18 +289,18 @@ sub pagetemplate (@) { } } -sub title { - my $title = $pagestate{$_[0]}{meta}{title}; +sub titlesort { + my $key = $pagestate{$_[0]}{meta}{titlesort}; - if (defined $title) { - return $title; + if (defined $key) { + return $key; } return pagetitle(IkiWiki::basename($_[0])); } sub sort_meta_title { - return title($_[0]) cmp title($_[1]); + return titlesort($_[0]) cmp titlesort($_[1]); } sub match { diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn index 557441c0b..8d2a5b1ad 100644 --- a/doc/ikiwiki/directive/meta.mdwn +++ b/doc/ikiwiki/directive/meta.mdwn @@ -23,6 +23,13 @@ Supported fields: be set to a true value in the template; this can be used to format things differently in this case. + An optional `sort` parameter will be used preferentially when + [[ikiwiki/pagespec/sorting]] by `meta_title`: + + \[[!meta title="The Beatles" sort="Beatles, The"]] + + \[[!meta title="David Bowie" sort="Bowie, David"]] + * license Specifies a license for the page, for example, "GPL". Can contain diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn index 3a9fef9b6..61516bec5 100644 --- a/doc/ikiwiki/pagespec/sorting.mdwn +++ b/doc/ikiwiki/pagespec/sorting.mdwn @@ -5,13 +5,14 @@ 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. +* `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 as such, ("1 2 9 10 20" instead of "1 10 2 20 9") [[!if test="enabled(meta)" then=""" -* `meta_title` - Order by the full title set by the `\[[!meta title="foo"]]` - [[ikiwiki/directive]]. +* `meta_title` - Order according to the `\[[!meta title="foo" sort="bar"]]` + or `\[[!meta title="foo"]]` [[ikiwiki/directive]], or the page name if no + full title was set. """]] Plugins can add additional sort orders, so more might be available on this -- cgit v1.2.3 From 271449062a2a3fa897aff7f5bb40d6b5da06a1a8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Mar 2010 14:30:38 -0400 Subject: use YAML::Any to allow faster versions to be used if available --- IkiWiki/Setup/Yaml.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index 0fc273675..58cba4222 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -10,7 +10,7 @@ sub loaddump ($$) { my $class=shift; my $content=shift; - eval q{use YAML}; + eval q{use YAML::Any}; die $@ if $@; IkiWiki::Setup::merge(Load($content)); } @@ -18,7 +18,7 @@ sub loaddump ($$) { sub gendump ($@) { my $class=shift; - eval q{use YAML}; + eval q{use YAML::Any}; die $@ if $@; "# IkiWiki::Setup::Yaml - YAML formatted setup file", -- cgit v1.2.3 From 3166479fe4b170bf6ffd3f06c1422f65f7bbfe7e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Mar 2010 14:53:32 -0400 Subject: fall back from YAML::Any to just YAML for portabilty to old YAML in Debian stable that lacks the former. --- IkiWiki/Setup/Yaml.pm | 2 ++ ikiwiki.in | 1 + 2 files changed, 3 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index 58cba4222..8ad44eb4a 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -11,6 +11,7 @@ sub loaddump ($$) { my $content=shift; eval q{use YAML::Any}; + eval q{use YAML} if $@; die $@ if $@; IkiWiki::Setup::merge(Load($content)); } @@ -19,6 +20,7 @@ sub gendump ($@) { my $class=shift; eval q{use YAML::Any}; + eval q{use YAML} if $@; die $@ if $@; "# IkiWiki::Setup::Yaml - YAML formatted setup file", diff --git a/ikiwiki.in b/ikiwiki.in index 7028bdb7d..a8343ed0f 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -102,6 +102,7 @@ sub getconfig () { die gettext("usage: --set-yaml var=value"), "\n"; } eval q{use YAML::Any}; + eval q{use YAML} if $@; die $@ if $@; $config{$var}=Load($val); }, -- cgit v1.2.3 From a76206d4809364eaab288df45b126893887e46f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Mar 2010 15:32:35 -0400 Subject: fix back-compat with old Net::OpenID Debian stable's Net::OpenID does not support getting extension fields. --- IkiWiki/Plugin/openid.pm | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 9355cd85a..7b1a17831 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -116,23 +116,25 @@ sub validate ($$$;$) { # Ask for client to provide a name and email, if possible. # Try sreg and ax - $claimed_identity->set_extension_args( - 'http://openid.net/extensions/sreg/1.1', - { - optional => 'email,fullname,nickname', - }, - ); - $claimed_identity->set_extension_args( - 'http://openid.net/srv/ax/1.0', - { - mode => 'fetch_request', - 'required' => 'email,fullname,nickname,firstname', - 'type.email' => "http://schema.openid.net/contact/email", - 'type.fullname' => "http://axschema.org/namePerson", - 'type.nickname' => "http://axschema.org/namePerson/friendly", - 'type.firstname' => "http://axschema.org/namePerson/first", - }, - ); + if ($claimed_identity->can("set_extension_args")) { + $claimed_identity->set_extension_args( + 'http://openid.net/extensions/sreg/1.1', + { + optional => 'email,fullname,nickname', + }, + ); + $claimed_identity->set_extension_args( + 'http://openid.net/srv/ax/1.0', + { + mode => 'fetch_request', + 'required' => 'email,fullname,nickname,firstname', + 'type.email' => "http://schema.openid.net/contact/email", + 'type.fullname' => "http://axschema.org/namePerson", + 'type.nickname' => "http://axschema.org/namePerson/friendly", + 'type.firstname' => "http://axschema.org/namePerson/first", + }, + ); + } my $check_url = $claimed_identity->check_url( return_to => IkiWiki::cgiurl(do => "postsignin"), @@ -161,10 +163,13 @@ sub auth ($$) { elsif (my $vident = $csr->verified_identity) { $session->param(name => $vident->url); - my @extensions=grep { defined } ( - $vident->signed_extension_fields('http://openid.net/extensions/sreg/1.1'), - $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), - ); + my @extensions; + if ($vident->can("signed_extension_fields")) { + @extensions=grep { defined } ( + $vident->signed_extension_fields('http://openid.net/extensions/sreg/1.1'), + $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), + ); + } foreach my $ext (@extensions) { foreach my $field (qw{value.email email}) { if (exists $ext->{$field} && -- cgit v1.2.3 From eb06a0135511fc5b5422f07ca5344ce114402a61 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Mar 2010 16:12:35 -0400 Subject: use perl YAML for dumping Only it understands $YAML::UseHeader --- IkiWiki/Setup/Yaml.pm | 8 ++++---- debian/changelog | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index 8ad44eb4a..8b876e297 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -19,10 +19,6 @@ sub loaddump ($$) { sub gendump ($@) { my $class=shift; - eval q{use YAML::Any}; - eval q{use YAML} if $@; - die $@ if $@; - "# IkiWiki::Setup::Yaml - YAML formatted setup file", "#", (map { "# $_" } @_), @@ -37,7 +33,11 @@ sub dumpline ($$$$) { my $type=shift; my $prefix=shift; + eval q{use YAML::Old}; + eval q{use YAML} if $@; + die $@ if $@; $YAML::UseHeader=0; + my $dump=Dump({$key => $value}); chomp $dump; if (length $prefix) { diff --git a/debian/changelog b/debian/changelog index e7499b6f2..12dd0dc02 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100320) UNRELEASED; urgency=low +ikiwiki (3.20100324) UNRELEASED; urgency=low * websetup: Add websetup_unsafe to allow marking other settings as unsafe. -- cgit v1.2.3 From 021952969933388021001b259462406cbc94c2a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Mar 2010 16:19:50 -0400 Subject: fix unicode with YAML::Syck Syck-- it doesn't use unicode by default?! Hello, 2010 calling.. --- IkiWiki/Setup/Yaml.pm | 1 + ikiwiki.in | 1 + 2 files changed, 2 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup/Yaml.pm b/IkiWiki/Setup/Yaml.pm index 8b876e297..904784728 100644 --- a/IkiWiki/Setup/Yaml.pm +++ b/IkiWiki/Setup/Yaml.pm @@ -13,6 +13,7 @@ sub loaddump ($$) { eval q{use YAML::Any}; eval q{use YAML} if $@; die $@ if $@; + $YAML::Syck::ImplicitUnicode=1; IkiWiki::Setup::merge(Load($content)); } diff --git a/ikiwiki.in b/ikiwiki.in index 1758399ea..b62962ad8 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -103,6 +103,7 @@ sub getconfig () { } eval q{use YAML::Any}; eval q{use YAML} if $@; + $YAML::Syck::ImplicitUnicode=1; die $@ if $@; $config{$var}=Load($val."\n"); }, -- cgit v1.2.3 From baa07e0b526fd23630f6cedcdc04960c99703722 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Mar 2010 14:23:16 -0400 Subject: remove a few leftover manual folding indicators --- IkiWiki/Plugin/filecheck.pm | 2 +- IkiWiki/Plugin/po.pm | 2 +- IkiWiki/Plugin/tla.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index 01d490961..0501ba99c 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -5,7 +5,7 @@ use warnings; use strict; use IkiWiki 3.00; -my %units=( #{{{ # size in bytes +my %units=( # size in bytes B => 1, byte => 1, KB => 2 ** 10, diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 2cbfb0a45..2250a7f9f 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -308,7 +308,7 @@ sub pagetemplate (@) { if (ishomepage($page) && $template->query(name => "title")) { $template->param(title => $config{wikiname}); } -} # }}} +} # Add the renamed page translations to the list of to-be-renamed pages. sub renamepages (@) { diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index 16d73b136..764da9b98 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -162,7 +162,7 @@ sub rcs_remove ($) { error("rcs_remove not implemented for tla"); # TODO } -sub rcs_rename ($$) { # {{{a +sub rcs_rename ($$) { my ($src, $dest) = @_; error("rcs_rename not implemented for tla"); # TODO -- cgit v1.2.3 From 3d671ea8c1df4534d8ffa59b235dd6ded99bb13f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Mar 2010 14:39:09 -0400 Subject: filecheck: Fix bug that prevented the pagespecs from matching when not called by attachment plugin. --- IkiWiki/Plugin/filecheck.pm | 16 ++++++++-------- debian/changelog | 2 ++ doc/bugs/filecheck_failing_to_find_files.mdwn | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index 0501ba99c..1549b82db 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -75,9 +75,9 @@ sub match_maxsize ($$;@) { } my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (-s $file > $maxsize) { @@ -96,9 +96,9 @@ sub match_minsize ($$;@) { } my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (-s $file < $minsize) { @@ -114,9 +114,9 @@ sub match_mimetype ($$;@) { my $wanted=shift; my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } # Use ::magic to get the mime type, the idea is to only trust @@ -147,9 +147,9 @@ sub match_virusfree ($$;@) { my $wanted=shift; my %params=@_; - my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; + my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page}); if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); + return IkiWiki::ErrorReason->new("file does not exist"); } if (! exists $IkiWiki::config{virus_checker} || diff --git a/debian/changelog b/debian/changelog index 12dd0dc02..7249cdfa4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low * Allow wrappers to be built using tcc. * Add support for setup files written in YAML. * Add --set-yaml switch for setting more complex config file options. + * filecheck: Fix bug that prevented the pagespecs from matching when + not called by attachment plugin. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index be6cdbb20..e896f2129 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -10,6 +10,11 @@ It turns out that the filecheck plugin couldn't find the file, because it was me >> But if it is given `/path/to/srcdir/foo/bar.gif` instead, then it *can* find the file, and returns the mime-type correctly. >> --[[KathrynAndersen]] +>>> Ok, so it's not removal specific, can in fact be triggered by using +>>> testpagespec (or really anything besides attachment, which passes +>>> the filename parameter). Nor is it limited to mimetype, all the tests in +>>> filecheck have the problem. [[Fixed|done]] --[[Joey]] + The following patch fixes the problem: diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm -- 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 'IkiWiki') 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 243b0dd082cf4b66dfef55b2c9b459109bee7398 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Mar 2010 00:16:21 -0400 Subject: fix the other half of the filecheck filename bug --- IkiWiki/Plugin/remove.pm | 2 +- IkiWiki/Plugin/rename.pm | 4 ++-- debian/changelog | 2 +- doc/bugs/filecheck_failing_to_find_files.mdwn | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index f59d0269e..0fc180f69 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -49,7 +49,7 @@ sub check_canremove ($$$) { # This is sorta overkill, but better safe than sorry. if (! defined pagetype($pagesources{$page})) { if (IkiWiki::Plugin::attachment->can("check_canattach")) { - IkiWiki::Plugin::attachment::check_canattach($session, $page, $file); + IkiWiki::Plugin::attachment::check_canattach($session, $page, "$config{srcdir}/$file"); } else { error("removal of attachments is not allowed"); diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 3908443ca..1a9da6363 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -50,7 +50,7 @@ sub check_canrename ($$$$$$) { IkiWiki::check_canedit($src, $q, $session); if ($attachment) { if (IkiWiki::Plugin::attachment->can("check_canattach")) { - IkiWiki::Plugin::attachment::check_canattach($session, $src, $srcfile); + IkiWiki::Plugin::attachment::check_canattach($session, $src, "$config{srcdir}/$srcfile"); } else { error("renaming of attachments is not allowed"); @@ -85,7 +85,7 @@ sub check_canrename ($$$$$$) { if ($attachment) { # Note that $srcfile is used here, not $destfile, # because it wants the current file, to check it. - IkiWiki::Plugin::attachment::check_canattach($session, $dest, $srcfile); + IkiWiki::Plugin::attachment::check_canattach($session, $dest, "$config{srcdir}/$srcfile"); } } diff --git a/debian/changelog b/debian/changelog index 7249cdfa4..da1ab890e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,7 +15,7 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low * Allow wrappers to be built using tcc. * Add support for setup files written in YAML. * Add --set-yaml switch for setting more complex config file options. - * filecheck: Fix bug that prevented the pagespecs from matching when + * filecheck: Fix bugs that prevented the pagespecs from matching when not called by attachment plugin. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index f8d8e83e6..6501508e4 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -25,6 +25,8 @@ It turns out that the filecheck plugin couldn't find the file, because it was me >>>>>> Yes, it works! --[[KathrynAndersen]] +applied && [[done]] +
 diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
 index f59d026..0fc180f 100644
-- 
cgit v1.2.3


From 0d07bca315d19e6e957072004393138db6f33d3d Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 17:17:07 -0400
Subject: fix printing of $@, which is clobbered by the call to gettext

problem reported by viric
---
 IkiWiki/Setup/Automator.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm
index e9a572450..38e0d4422 100644
--- a/IkiWiki/Setup/Automator.pm
+++ b/IkiWiki/Setup/Automator.pm
@@ -124,9 +124,10 @@ sub import (@) {
 				IkiWiki::run_hooks(checkconfig => sub { shift->() });
 			};
 			if ($@) {
+				my $err=$@;
 				print STDERR sprintf(gettext("** Disabling plugin %s, since it is failing with this message:"),
 					$plugin)."\n";
-				print STDERR "$@\n";
+				print STDERR "$err\n";
 				push @{$bakconfig{disable_plugins}}, $plugin;
 			}
 		}
-- 
cgit v1.2.3


From 0c6e467aa6931ec6bd7720ecaea5e33aeca4d1be Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 18:27:23 -0400
Subject: use __TINYC__ define to avoid tinyc compat fixes breaking FreeBSD

To review, tcc does not really use environ, so you have to use clearenv
there. But POSIX, in their wisdom, didn't standardise clearenv yet,
so on FreeBSD, one still needs to manipulate environ on their own.

(If you use tcc on FreeBSD, this may leave you unsatisfied.)
---
 IkiWiki/Wrapper.pm                             | 6 ++++++
 doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn | 3 +++
 2 files changed, 9 insertions(+)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index f175b4a0b..3f3e63ca6 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -101,6 +101,7 @@ EOF
 #include 
 #include 
 
+extern char **environ;
 char *newenviron[$#envsave+6];
 int i=0;
 
@@ -121,12 +122,17 @@ $envsave
 	newenviron[i++]="HOME=$ENV{HOME}";
 	newenviron[i++]="WRAPPED_OPTIONS=$configstring";
 
+#ifdef __TINYC__
 	if (clearenv() != 0) {
 		perror("clearenv");
 		exit(1);
 	}
 	for (; i>0; i--)
 		putenv(newenviron[i-1]);
+#else
+	newenviron[i]=NULL;
+	environ=newenviron;
+#endif
 
 	if (setregid(getegid(), -1) != 0 &&
 	    setregid(getegid(), -1) != 0) {
diff --git a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
index 6ad7975eb..c2355d6aa 100644
--- a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
+++ b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
@@ -1,2 +1,5 @@
 When build wrapper on FreeBSD system, is error occured with clearenv reference. clearenv() das not exists at FreeBSD system, use workaround environ[0]=NULL;
 P.S. new git instalation, FreeBSD 7.x
+
+> #include  fixed with nasty ifdefs to handle tcc w/o
+> breaking everything else. ||done]] --[[Joey]] 
-- 
cgit v1.2.3


From 799b93d258bad917262ac160df74136f05d4a451 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 20:23:22 -0400
Subject: don't check $@ after pagespec_translate

pagespec_translate may set $@ if it fails to parse a pagespec, but
due to memoization, this is not reliable. If a memoized call is repeated,
and $@ is already set for some other reason previously, it will remain
set through the call to pagespec_translate.

Instead, just check if pagespec_translate returns undef.
---
 IkiWiki.pm        | 9 ++++-----
 IkiWiki/Render.pm | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 927d62940..6739ba56c 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1796,7 +1796,7 @@ sub add_depends ($$;$) {
 
 	# Add explicit dependencies for influences.
 	my $sub=pagespec_translate($pagespec);
-	return if $@;
+	return unless defined $sub;
 	foreach my $p (keys %pagesources) {
 		my $r=$sub->($p, location => $page);
 		my $i=$r->influences;
@@ -2001,7 +2001,7 @@ sub pagespec_match ($$;@) {
 
 	my $sub=pagespec_translate($spec);
 	return IkiWiki::ErrorReason->new("syntax error in pagespec \"$spec\"")
-		if $@ || ! defined $sub;
+		if ! defined $sub;
 	return $sub->($page, @params);
 }
 
@@ -2019,7 +2019,7 @@ sub pagespec_match_list ($$;@) {
 
 	my $sub=pagespec_translate($pagespec);
 	error "syntax error in pagespec \"$pagespec\""
-		if $@ || ! defined $sub;
+		if ! defined $sub;
 
 	my @candidates;
 	if (exists $params{list}) {
@@ -2092,8 +2092,7 @@ sub pagespec_match_list ($$;@) {
 sub pagespec_valid ($) {
 	my $spec=shift;
 
-	my $sub=pagespec_translate($spec);
-	return ! $@;
+	return defined pagespec_translate($spec);
 }
 
 sub glob2re ($) {
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index af24df155..abafb0887 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -565,7 +565,7 @@ sub render_dependent ($$$$$$$) {
 		if (exists $depends{$p} && ! defined $reason) {
 			foreach my $dep (keys %{$depends{$p}}) {
 				my $sub=pagespec_translate($dep);
-				next if $@ || ! defined $sub;
+				next unless defined $sub;
 
 				# only consider internal files
 				# if the page explicitly depends
-- 
cgit v1.2.3


From 891238e075f0c4716ec8f51d5832745b0348ab77 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Mon, 29 Mar 2010 11:54:18 -0400
Subject: add warning messages about bzr and mercurial hooks that are not
 correctly setup

---
 IkiWiki/Setup/Automator.pm | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm
index 38e0d4422..402212150 100644
--- a/IkiWiki/Setup/Automator.pm
+++ b/IkiWiki/Setup/Automator.pm
@@ -72,9 +72,11 @@ sub import (@) {
 		}
 		elsif ($config{rcs} eq 'bzr') {
 			# TODO
+			print STDERR "warning: do not know how to set up the bzr_wrapper hook!\n";
 		}
 		elsif ($config{rcs} eq 'mercurial') {
 			# TODO
+			print STDERR "warning: do not know how to set up the mercurial_wrapper hook!\n";
 		}
 		elsif ($config{rcs} eq 'cvs') {
 			$config{cvs_wrapper}=$config{repository}."/CVSROOT/post-commit";
-- 
cgit v1.2.3


From e466d11fd363b4758bc4f624ff73664d89891f9e Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Mon, 29 Mar 2010 13:17:32 -0400
Subject: add warning about incomplete tla support

---
 IkiWiki/Setup/Automator.pm | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm
index 402212150..2dcb424e5 100644
--- a/IkiWiki/Setup/Automator.pm
+++ b/IkiWiki/Setup/Automator.pm
@@ -78,6 +78,10 @@ sub import (@) {
 			# TODO
 			print STDERR "warning: do not know how to set up the mercurial_wrapper hook!\n";
 		}
+		elsif ($config{rcs} eq 'tla') {
+			# TODO
+			print STDERR "warning: do not know how to set up the tla_wrapper hook!\n";
+		}
 		elsif ($config{rcs} eq 'cvs') {
 			$config{cvs_wrapper}=$config{repository}."/CVSROOT/post-commit";
 		}
-- 
cgit v1.2.3


From 104919ee07b70b166c6c6be13b4f6e5bc5225179 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 2 Apr 2010 16:05:14 -0400
Subject: htmlscrubber: Allow colons in url fragments after '?'

Colons are not allowed at the start of urls, because it can be interpreted
as a protocol, and allowing arbitrary protocols can be unsafe
(CVE-2008-0809). However, this check was too restrictive, not allowing
use of eg, "video.ogv?t=0:03:00/0:04:00" to seek to a given place in a
video, or "somecgi?foo=bar:baz" to pass parameters with colons.

It's still not allowed to have a filename with a colon in it (ie
"foo:bar.png") -- to link to such a file, a fully qualified url must be
used.
---
 IkiWiki/Plugin/htmlscrubber.pm | 2 +-
 debian/changelog               | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm
index 26e18ffc7..9f40c752f 100644
--- a/IkiWiki/Plugin/htmlscrubber.pm
+++ b/IkiWiki/Plugin/htmlscrubber.pm
@@ -32,7 +32,7 @@ sub import {
 	);
 	# data is a special case. Allow a few data:image/ types,
 	# but disallow data:text/javascript and everything else.
-	$safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/(?:png|jpeg|gif)|[^:]+(?:$|\/))/i;
+	$safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/(?:png|jpeg|gif)|[^:]+(?:$|[\/\?]))/i;
 }
 
 sub getsetup () {
diff --git a/debian/changelog b/debian/changelog
index bbca7cffe..adf0dfed6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,7 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low
     used, but they are available in the session object now.)
   * page.tmpl: Add Cache-Control must-revalidate to ensure that users
     (especially of Firefox) see fresh page content.
+  * htmlscrubber: Allow colons in urls after '?'
 
  -- Joey Hess   Sat, 13 Mar 2010 14:48:10 -0500
 
-- 
cgit v1.2.3


From 59ba938822ba0752e8d97e769c0d14f2eb0bbeb3 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 2 Apr 2010 16:54:06 -0400
Subject: template: Search for templates in the templatedir, if they are not
 found as pages in the wiki.

---
 IkiWiki/Plugin/template.pm                            | 10 ++++++++--
 debian/changelog                                      |  2 ++
 doc/templates.mdwn                                    |  6 ++++++
 doc/todo/user-defined_templates_outside_the_wiki.mdwn |  2 ++
 doc/wikitemplates.mdwn                                |  6 ++++--
 5 files changed, 22 insertions(+), 4 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 3e024c5f8..36282055a 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -37,7 +37,13 @@ sub preprocess (@) {
 	my $template_page="templates/$params{id}";
 	add_depends($params{page}, $template_page);
 
-	my $template_file=$pagesources{$template_page};
+	my $template_file;
+	if (exists $pagesources{$template_page}) {
+		$template_file=srcfile($pagesources{$template_page});
+	}
+	else {
+		$template_file=template_file("$params{id}.tmpl")
+	}
 	return sprintf(gettext("template %s not found"),
 		htmllink($params{page}, $params{destpage}, "/".$template_page))
 			unless defined $template_file;
@@ -50,7 +56,7 @@ sub preprocess (@) {
 	                        $$text_ref=&Encode::decode_utf8($$text_ref);
 				chomp $$text_ref;
 	                },
-	                filename => srcfile($template_file),
+	                filename => $template_file,
        			die_on_bad_params => 0,
 			no_includes => 1,
 			blind_cache => 1,
diff --git a/debian/changelog b/debian/changelog
index adf0dfed6..362ba54ab 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low
   * page.tmpl: Add Cache-Control must-revalidate to ensure that users
     (especially of Firefox) see fresh page content.
   * htmlscrubber: Allow colons in urls after '?'
+  * template: Search for templates in the templatedir, if they are not
+    found as pages in the wiki.
 
  -- Joey Hess   Sat, 13 Mar 2010 14:48:10 -0500
 
diff --git a/doc/templates.mdwn b/doc/templates.mdwn
index eff0e15e9..07531ae98 100644
--- a/doc/templates.mdwn
+++ b/doc/templates.mdwn
@@ -43,6 +43,12 @@ page will provide a link that can be used to create the template. The template
 is a regular wiki page, located in the `templates/` subdirectory inside
 the source directory of the wiki.
 
+(Alternatively, templates can be stored in a directory outside the wiki,
+as files with the extension ".tmpl".
+By default, these are searched for in `/usr/share/ikiwiki/templates`;
+the `templatedir` setting can be used to make another directory be searched
+first.)
+
 The template uses the syntax used by the [[!cpan HTML::Template]] perl
 module, which allows for some fairly complex things to be done. Consult its
 documentation for the full syntax, but all you really need to know are a
diff --git a/doc/todo/user-defined_templates_outside_the_wiki.mdwn b/doc/todo/user-defined_templates_outside_the_wiki.mdwn
index 880ad6493..1d72aa6a7 100644
--- a/doc/todo/user-defined_templates_outside_the_wiki.mdwn
+++ b/doc/todo/user-defined_templates_outside_the_wiki.mdwn
@@ -6,3 +6,5 @@ source, but also looks in the system templates directory (the one with
 invoked via `\[[!template]]`, but don't have to "work" as wiki pages in their
 own right. I think the normal [[plugins/template]] plugin could benefit from
 this functionality.
+
+[[done]] --[[Joey]] 
diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn
index 6c0480cea..6e5a7261d 100644
--- a/doc/wikitemplates.mdwn
+++ b/doc/wikitemplates.mdwn
@@ -5,7 +5,8 @@ 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.
+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
@@ -43,7 +44,8 @@ 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 stored in the wiki and inserted into pages.
+[[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
-- 
cgit v1.2.3


From f7a2a4b4d4f1868878e8ad294e9641d8adb51aef Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 2 Apr 2010 16:55:29 -0400
Subject: qualify template_file

---
 IkiWiki/Plugin/template.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 36282055a..98a13b5fa 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -42,7 +42,7 @@ sub preprocess (@) {
 		$template_file=srcfile($pagesources{$template_page});
 	}
 	else {
-		$template_file=template_file("$params{id}.tmpl")
+		$template_file=IkiWiki::template_file("$params{id}.tmpl")
 	}
 	return sprintf(gettext("template %s not found"),
 		htmllink($params{page}, $params{destpage}, "/".$template_page))
-- 
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 'IkiWiki')

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 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 'IkiWiki')

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 a358d74bef51dae31332ff27e897fe04834571e6 Mon Sep 17 00:00:00 2001
From: David Riebenbauer 
Date: Wed, 3 Feb 2010 04:29:10 +0100
Subject: Check for existence off srcfile in add_autofile

add_autofile has to have checks, whether to create the file, anyway, so this
will make things more consistent.

Correcter check for the result of verify_src_file().

Cosmetic rename of a variable $addfile to $autofile.
---
 IkiWiki.pm            | 11 ++++++++---
 IkiWiki/Plugin/tag.pm |  5 ++---
 2 files changed, 10 insertions(+), 6 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 90e623330..56c491339 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1897,9 +1897,14 @@ sub add_link ($$) {
 }
 
 sub add_autofile ($) {
-	my $addfile=shift;
-	my ($file,$page) = verify_src_file($addfile,$config{srcdir});
-	if ($page) {
+	my $autofile=shift;
+
+	if (srcfile($autofile, 1)) {
+		return 0;
+	}
+
+	my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir});
+	if (defined $file) {
 		push @autofiles, $file;
 	}
 }
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index c0b7feb23..c6c99ae45 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -71,15 +71,14 @@ sub gentag ($) {
 	if (defined $config{tag_autocreate} && $config{tag_autocreate}) {
 		my $tagfile = newpagefile(tagpage($tag), $config{default_pageext});
 		$tagfile=~s/^\///;
-		return if (srcfile($tagfile,1));
+
+		return if (! add_autofile($tagfile));
 
 		debug(sprintf(gettext("creating tag page %s"), $tag));
 
 		my $template=template("autotag.tmpl");
 		$template->param(tag => $tag);
 		writefile($tagfile, $config{srcdir}, $template->output);
-
-		add_autofile("$config{srcdir}/$tagfile");
 	}
 }
 
-- 
cgit v1.2.3


From 628a52a6c49f5d2fc5af251f2d718c8dff5e8ed5 Mon Sep 17 00:00:00 2001
From: David Riebenbauer 
Date: Sat, 3 Apr 2010 21:17:20 +0200
Subject: Revert "Revert the effects of find_del_files() for (re)autoadded
 files."

This reverts commit 31680111f0062f07727d14fcf291c98978ad5a2f.
---
 IkiWiki.pm        | 3 +--
 IkiWiki/Render.pm | 9 ---------
 2 files changed, 1 insertion(+), 11 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 56c491339..1770703a5 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -14,8 +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 @autofiles %dellinks
-	    %delrenderedfiles};
+	    %forcerebuild %loaded_plugins @autofiles};
 
 use Exporter q{import};
 our @EXPORT = qw(hook debug error template htmlpage deptype
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 5b72b6de1..fc71c8919 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -392,9 +392,7 @@ sub find_del_files ($) {
 			else {
 				push @del, $pagesources{$page};
 			}
-			$dellinks{$page}= $links{$page};
 			$links{$page}=[];
-			$delrenderedfiles{$page}= $renderedfiles{$page};
 			$renderedfiles{$page}=[];
 			$pagemtime{$page}=0;
 		}
@@ -644,14 +642,8 @@ sub refresh () {
 		scan($file);
 	}
 
-	my %del_hash = map {$_, 1} @$del;
 	while (my $autofile = shift (@autofiles)) {
 		my $page=pagename($autofile);
-    if (exists $del_hash{$page}) {
-			$links{$page}= $dellinks{$page};
-			$renderedfiles{$page}= $delrenderedfiles{$page};
-			delete $del_hash{$page};
-		}
 		if ($pages->{$page}) {
 			debug(sprintf(gettext("%s has multiple possible source pages"), $page));
 		}
@@ -663,7 +655,6 @@ sub refresh () {
 
 		scan($autofile);
 	}
-	$del = [keys %del_hash];
 
 	calculate_links();
 	
-- 
cgit v1.2.3


From 981400177d68a279f485727be3f013e68f0bf691 Mon Sep 17 00:00:00 2001
From: David Riebenbauer 
Date: Sat, 3 Apr 2010 21:10:16 +0200
Subject: Make sure deleted tag pages don't get recreated.

The reason to do this is basically a user interaction design decision.

It is achieved by adding an entry, associated to the creating plugin, to
%pagestate. To find out if files were deleted a new global hash %del_hash is
%introduced.
---
 IkiWiki.pm            | 19 +++++++++++++++----
 IkiWiki/Plugin/tag.pm |  2 +-
 IkiWiki/Render.pm     |  5 ++++-
 3 files changed, 20 insertions(+), 6 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 1770703a5..966a3bbc6 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 @autofiles};
+	    %forcerebuild %loaded_plugins %autofiles %del_hash};
 
 use Exporter q{import};
 our @EXPORT = qw(hook debug error template htmlpage deptype
@@ -1895,17 +1895,28 @@ sub add_link ($$) {
 		unless grep { $_ eq $link } @{$links{$page}};
 }
 
-sub add_autofile ($) {
+sub add_autofile ($$) {
 	my $autofile=shift;
+	my $plugin=shift;
 
 	if (srcfile($autofile, 1)) {
 		return 0;
 	}
 
 	my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir});
-	if (defined $file) {
-		push @autofiles, $file;
+
+	if ((!defined $file) ||
+	(exists $pagestate{$page}{$plugin}{autofile_deleted})) {
+		return 0;
+	}
+
+	if (exists $del_hash{$file}) {
+		$pagestate{$page}{$plugin}{autofile_deleted}=1;
+		return 0;
 	}
+
+	$autofiles{$file}=$plugin;
+	return 1;
 }
 
 sub pagespec_translate ($) {
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index c6c99ae45..fdd63d637 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -72,7 +72,7 @@ sub gentag ($) {
 		my $tagfile = newpagefile(tagpage($tag), $config{default_pageext});
 		$tagfile=~s/^\///;
 
-		return if (! add_autofile($tagfile));
+		return if (! add_autofile($tagfile, "tag"));
 
 		debug(sprintf(gettext("creating tag page %s"), $tag));
 
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index fc71c8919..0c21455fb 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -637,12 +637,14 @@ sub refresh () {
 	my ($changed, $internal_changed)=find_changed($files);
 	run_hooks(needsbuild => sub { shift->($changed) });
 	my $oldlink_targets=calculate_old_links($changed, $del);
+	%del_hash = map { $_ => 1 } @{$del};
 
 	foreach my $file (@$changed) {
 		scan($file);
 	}
 
-	while (my $autofile = shift (@autofiles)) {
+	while (my $autofile = shift @{[keys %autofiles]}) {
+		my $plugin=$autofiles{$autofile};
 		my $page=pagename($autofile);
 		if ($pages->{$page}) {
 			debug(sprintf(gettext("%s has multiple possible source pages"), $page));
@@ -654,6 +656,7 @@ sub refresh () {
 		push @{$changed}, $autofile if find_changed([$autofile]);
 
 		scan($autofile);
+		delete $autofiles{$autofile};
 	}
 
 	calculate_links();
-- 
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 'IkiWiki')

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 f127857676ad014c97537c39cc7758a423f08b9a Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Sun, 4 Apr 2010 00:21:01 +0100
Subject: Fix some typos that would break Render during changed-link
 calculation

---
 IkiWiki/Render.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 5810fc974..e98888d76 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -511,13 +511,13 @@ sub link_types_changed ($$) {
 
 	while (my ($type, $links) = each %$new) {
 		foreach my $link (keys %$links) {
-			return 1 unless exists $old{$type}{$link};
+			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 1 unless exists $new->{$type}{$link};
 		}
 	}
 
@@ -554,7 +554,7 @@ sub calculate_changed_links ($$$) {
 		# 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})) {
+			if (link_types_changed($typedlinks{$page}, $oldtypedlinks{$page})) {
 				$linkchangers{lc($page)}=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 'IkiWiki')

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 618bbaee3815daffe329fc1e2d77f04fcd8392b8 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Sat, 3 Apr 2010 14:17:48 +0100
Subject: meta: generalize meta_title into meta(title); support author,
 updated, date

I've left meta_title in, undocumented, as a possible replacement for
sort=title in IkiWiki 4.0 or something.
---
 IkiWiki/Plugin/meta.pm            | 58 +++++++++++++++++++++++++++++++++------
 doc/ikiwiki/directive/meta.mdwn   |  7 ++++-
 doc/ikiwiki/pagespec/sorting.mdwn |  5 ++--
 3 files changed, 58 insertions(+), 12 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index cd7d0d127..c9fdbc934 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -122,6 +122,12 @@ sub preprocess (@) {
 	}
 	elsif ($key eq 'author') {
 		$pagestate{$page}{meta}{author}=$value;
+		if (exists $params{sort}) {
+			$pagestate{$page}{meta}{authorsort}=$params{sort};
+		}
+		else {
+			$pagestate{$page}{meta}{authorsort}=$value;
+		}
 		# fallthorough
 	}
 	elsif ($key eq 'authorurl') {
@@ -288,14 +294,31 @@ sub pagetemplate (@) {
 	}
 }
 
-sub titlesort {
-	my $key = $pagestate{$_[0]}{meta}{titlesort};
+sub get_sort_key {
+	my $page = $_[0];
+	my $meta = $_[1];
 
-	if (defined $key) {
-		return $key;
-	}
+	# e.g. titlesort (also makes sense for author)
+	my $key = $pagestate{$page}{meta}{$meta . "sort"};
+	return $key if defined $key;
+
+	# e.g. title
+	$key = $pagestate{$page}{meta}{$meta};
+	return $key if defined $key;
 
-	return pagetitle(IkiWiki::basename($_[0]));
+	# fall back to closer-to-core things
+	if ($meta eq 'title') {
+		return pagetitle(IkiWiki::basename($page));
+	}
+	elsif ($meta eq 'date') {
+		return $IkiWiki::pagectime{$page};
+	}
+	elsif ($meta eq 'updated') {
+		return $IkiWiki::pagemtime{$page};
+	}
+	else {
+		return '';
+	}
 }
 
 sub match {
@@ -350,10 +373,27 @@ sub match_copyright ($$;@) {
 
 package IkiWiki::SortSpec;
 
+sub cmp_meta {
+	my $left = $_[0];
+	my $right = $_[1];
+	my $meta = $_[2];
+	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)
+			<=>
+			IkiWiki::Plugin::meta::get_sort_key($right, $meta);
+	}
+
+	return IkiWiki::Plugin::meta::get_sort_key($left, $meta)
+		cmp
+		IkiWiki::Plugin::meta::get_sort_key($right, $meta);
+}
+
+# A prototype of how sort=title could behave in 4.0 or something
 sub cmp_meta_title {
-	IkiWiki::Plugin::meta::titlesort($_[0])
-	cmp
-	IkiWiki::Plugin::meta::titlesort($_[1])
+	$_[2] = 'title';
+	return cmp_meta(@_);
 }
 
 1
diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn
index 8d2a5b1ad..c5f74fac5 100644
--- a/doc/ikiwiki/directive/meta.mdwn
+++ b/doc/ikiwiki/directive/meta.mdwn
@@ -24,7 +24,7 @@ Supported fields:
   differently in this case.
 
   An optional `sort` parameter will be used preferentially when
-  [[ikiwiki/pagespec/sorting]] by `meta_title`:
+  [[ikiwiki/pagespec/sorting]] by `meta(title)`:
 
 	\[[!meta title="The Beatles" sort="Beatles, The"]]
 
@@ -44,6 +44,11 @@ Supported fields:
 
   Specifies the author of a page.
 
+  An optional `sort` parameter will be used preferentially when
+  [[ikiwiki/pagespec/sorting]] by `meta(author)`:
+
+	\[[!meta author="Joey Hess" sort="Hess, Joey"]]
+
 * authorurl
 
   Specifies an url for the author of a page.
diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn
index ba995a521..fbf598340 100644
--- a/doc/ikiwiki/pagespec/sorting.mdwn
+++ b/doc/ikiwiki/pagespec/sorting.mdwn
@@ -11,9 +11,10 @@ orders can be specified.
   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"]]`
+* `meta(title)` - Order according to the `\[[!meta title="foo" sort="bar"]]`
   or `\[[!meta title="foo"]]` [[ikiwiki/directive]], or the page name if no
-  full title was set.
+  full title was set. `meta(author)`, `meta(date)`, `meta(updated)`, etc.
+  also work.
 """]]
 
 In addition, you can combine several sort orders and/or reverse the order of
-- 
cgit v1.2.3


From 490f95616a8a49f2120655d07c282eefd067e640 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Sat, 3 Apr 2010 14:19:18 +0100
Subject: Rename sort parameter to meta title/author to sortas=bar

Joey pointed out that sort=x usually takes a sort order.
---
 IkiWiki/Plugin/meta.pm            |  8 ++++----
 doc/ikiwiki/directive/meta.mdwn   | 10 +++++-----
 doc/ikiwiki/pagespec/sorting.mdwn |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index c9fdbc934..4992617d0 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -89,8 +89,8 @@ sub preprocess (@) {
 	# Metadata collection that needs to happen during the scan pass.
 	if ($key eq 'title') {
 		$pagestate{$page}{meta}{title}=HTML::Entities::encode_numeric($value);
-		if (exists $params{sort}) {
-			$pagestate{$page}{meta}{titlesort}=$params{sort};
+		if (exists $params{sortas}) {
+			$pagestate{$page}{meta}{titlesort}=$params{sortas};
 		}
 		else {
 			$pagestate{$page}{meta}{titlesort}=$value;
@@ -122,8 +122,8 @@ sub preprocess (@) {
 	}
 	elsif ($key eq 'author') {
 		$pagestate{$page}{meta}{author}=$value;
-		if (exists $params{sort}) {
-			$pagestate{$page}{meta}{authorsort}=$params{sort};
+		if (exists $params{sortas}) {
+			$pagestate{$page}{meta}{authorsort}=$params{sortas};
 		}
 		else {
 			$pagestate{$page}{meta}{authorsort}=$value;
diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn
index c5f74fac5..5a3919dea 100644
--- a/doc/ikiwiki/directive/meta.mdwn
+++ b/doc/ikiwiki/directive/meta.mdwn
@@ -23,12 +23,12 @@ Supported fields:
   be set to a true value in the template; this can be used to format things
   differently in this case.
 
-  An optional `sort` parameter will be used preferentially when
+  An optional `sortas` parameter will be used preferentially when
   [[ikiwiki/pagespec/sorting]] by `meta(title)`:
 
-	\[[!meta title="The Beatles" sort="Beatles, The"]]
+	\[[!meta title="The Beatles" sortas="Beatles, The"]]
 
-	\[[!meta title="David Bowie" sort="Bowie, David"]]
+	\[[!meta title="David Bowie" sortas="Bowie, David"]]
 
 * license
 
@@ -44,10 +44,10 @@ Supported fields:
 
   Specifies the author of a page.
 
-  An optional `sort` parameter will be used preferentially when
+  An optional `sortas` parameter will be used preferentially when
   [[ikiwiki/pagespec/sorting]] by `meta(author)`:
 
-	\[[!meta author="Joey Hess" sort="Hess, Joey"]]
+	\[[!meta author="Joey Hess" sortas="Hess, Joey"]]
 
 * authorurl
 
diff --git a/doc/ikiwiki/pagespec/sorting.mdwn b/doc/ikiwiki/pagespec/sorting.mdwn
index fbf598340..5c6cfcc2b 100644
--- a/doc/ikiwiki/pagespec/sorting.mdwn
+++ b/doc/ikiwiki/pagespec/sorting.mdwn
@@ -11,7 +11,7 @@ orders can be specified.
   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"]]`
+* `meta(title)` - Order according to the `\[[!meta title="foo" sortas="bar"]]`
   or `\[[!meta title="foo"]]` [[ikiwiki/directive]], or the page name if no
   full title was set. `meta(author)`, `meta(date)`, `meta(updated)`, etc.
   also work.
-- 
cgit v1.2.3


From 75afa94c36e199956014e108d7894007964c7348 Mon Sep 17 00:00:00 2001
From: Lars Wirzenius 
Date: Sun, 4 Apr 2010 21:05:07 +1200
Subject: Fix bzr plugin to work with bzr 2.0.

The output of "bzr log" seems to have changed a bit, so we change the
parsing accordingly. This has not been tested with earlier versions of
bzr.

Several problems seemed to occur, all in the bzr_log subroutine:

1. The @infos list would contain an empty hash, which would confuse the
   rest of the program.
2. This was because bzr_log would push an empty anonymous hash to the
   list whenever it thought a new record would start.
3. However, a new record marker (now?) also happens at th end of bzr log
   output.
4. Now we collect the record to a hash that gets pushed to the list only
   if it is not empty.
5. Also, sometimes bzr log outputs "revno: 1234 [merge]", so we catch only
   the revision number.
6. Finally, there may be non-headers at the of the output, so we ignore
   those.
---
 IkiWiki/Plugin/bzr.pm | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index 1ffdc2353..e813331b7 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -73,28 +73,37 @@ sub bzr_log ($) {
 	my @infos = ();
 	my $key = undef;
 
+    my $hash = {};
 	while (<$out>) {
 		my $line = $_;
 		my ($value);
 		if ($line =~ /^message:/) {
 			$key = "message";
-			$infos[$#infos]{$key} = "";
+			$$hash{$key} = "";
 		}
 		elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
 			$key = "files";
-			unless (defined($infos[$#infos]{$key})) { $infos[$#infos]{$key} = ""; }
+			unless (defined($$hash{$key})) { $$hash{$key} = ""; }
 		}
 		elsif (defined($key) and $line =~ /^  (.*)/) {
-			$infos[$#infos]{$key} .= "$1\n";
+			$$hash{$key} .= "$1\n";
 		}
 		elsif ($line eq "------------------------------------------------------------\n") {
+		    if (keys %$hash) {
+    		    push (@infos, $hash);
+		    }
+    		$hash = {};
 			$key = undef;
-			push (@infos, {});
 		}
-		else {
+		elsif ($line =~ /: /) {
 			chomp $line;
-				($key, $value) = split /: +/, $line, 2;
-			$infos[$#infos]{$key} = $value;
+			if ($line =~ /^revno: (\d+)/) {
+			    $key = "revno";
+			    $value = $1;
+			} else {
+    			($key, $value) = split /: +/, $line, 2;
+    		}
+			$$hash{$key} = $value;
 		} 
 	}
 	close $out;
-- 
cgit v1.2.3


From f206035a3a7ed0b37c082e80d6d1482983fa583b Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 4 Apr 2010 12:17:03 -0400
Subject: fix indentation & whitespace

---
 IkiWiki/Plugin/bzr.pm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index e813331b7..6e45c39e4 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -73,7 +73,7 @@ sub bzr_log ($) {
 	my @infos = ();
 	my $key = undef;
 
-    my $hash = {};
+	my $hash = {};
 	while (<$out>) {
 		my $line = $_;
 		my ($value);
@@ -89,10 +89,10 @@ sub bzr_log ($) {
 			$$hash{$key} .= "$1\n";
 		}
 		elsif ($line eq "------------------------------------------------------------\n") {
-		    if (keys %$hash) {
-    		    push (@infos, $hash);
-		    }
-    		$hash = {};
+			if (keys %$hash) {
+				push (@infos, $hash);
+			}
+			$hash = {};
 			$key = undef;
 		}
 		elsif ($line =~ /: /) {
@@ -100,11 +100,12 @@ sub bzr_log ($) {
 			if ($line =~ /^revno: (\d+)/) {
 			    $key = "revno";
 			    $value = $1;
-			} else {
-    			($key, $value) = split /: +/, $line, 2;
-    		}
+			}
+			else {
+				($key, $value) = split /: +/, $line, 2;
+			}
 			$$hash{$key} = $value;
-		} 
+		}
 	}
 	close $out;
 
@@ -222,7 +223,7 @@ sub rcs_recentchanges ($) {
 	foreach my $info (bzr_log($out)) {
 		my @pages = ();
 		my @message = ();
-        
+
 		foreach my $msgline (split(/\n/, $info->{message})) {
 			push @message, { line => $msgline };
 		}
-- 
cgit v1.2.3


From 2a15f9415979e809ef332bdcffa83ff168d5bbef Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 4 Apr 2010 12:20:26 -0400
Subject: rename hash and avoid unnecessary hash ref

Variable renamed to be a bit more self-explanatory.
Probably more idiomatic perl to not use a hash ref when a hash can be used.
---
 IkiWiki/Plugin/bzr.pm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index 6e45c39e4..7eb5cfe93 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -73,26 +73,26 @@ sub bzr_log ($) {
 	my @infos = ();
 	my $key = undef;
 
-	my $hash = {};
+	my %info;
 	while (<$out>) {
 		my $line = $_;
 		my ($value);
 		if ($line =~ /^message:/) {
 			$key = "message";
-			$$hash{$key} = "";
+			$info{$key} = "";
 		}
 		elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
 			$key = "files";
-			unless (defined($$hash{$key})) { $$hash{$key} = ""; }
+			unless (defined($info{$key})) { $info{$key} = ""; }
 		}
 		elsif (defined($key) and $line =~ /^  (.*)/) {
-			$$hash{$key} .= "$1\n";
+			$info{$key} .= "$1\n";
 		}
 		elsif ($line eq "------------------------------------------------------------\n") {
-			if (keys %$hash) {
-				push (@infos, $hash);
+			if (keys %info) {
+				push (@infos, {%info});
 			}
-			$hash = {};
+			%info = ();
 			$key = undef;
 		}
 		elsif ($line =~ /: /) {
@@ -104,7 +104,7 @@ sub bzr_log ($) {
 			else {
 				($key, $value) = split /: +/, $line, 2;
 			}
-			$$hash{$key} = $value;
+			$info{$key} = $value;
 		}
 	}
 	close $out;
-- 
cgit v1.2.3


From c9af069b5947ab7fb4a52fe735ef684072868f31 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 4 Apr 2010 12:23:12 -0400
Subject: more idiomatic perl

---
 IkiWiki/Plugin/bzr.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index 7eb5cfe93..c96f2d695 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -83,15 +83,13 @@ sub bzr_log ($) {
 		}
 		elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
 			$key = "files";
-			unless (defined($info{$key})) { $info{$key} = ""; }
+			$info{$key} = "" unless defined $info{$key};
 		}
 		elsif (defined($key) and $line =~ /^  (.*)/) {
 			$info{$key} .= "$1\n";
 		}
 		elsif ($line eq "------------------------------------------------------------\n") {
-			if (keys %info) {
-				push (@infos, {%info});
-			}
+			push @infos, {%info} if keys %info;
 			%info = ();
 			$key = undef;
 		}
-- 
cgit v1.2.3


From b4a162dec20b6723a76ecda3ce262d9d1f9afbb1 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 4 Apr 2010 17:06:28 -0400
Subject: fix test suite

---
 IkiWiki/Plugin/bzr.pm | 1 +
 1 file changed, 1 insertion(+)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index c96f2d695..0efc26b49 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -106,6 +106,7 @@ sub bzr_log ($) {
 		}
 	}
 	close $out;
+	push @infos, {%info} if keys %info;
 
 	return @infos;
 }
-- 
cgit v1.2.3


From 09d4e9d6bb7a049b0721ffbf7dc6e64bee4404cc Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Mon, 5 Apr 2010 16:34:49 -0400
Subject: comments: Fix missing entity encoding in title.

The meta title data set by comments needs to be encoded the same way that
meta encodes it. (NB The security implications of the missing encoding
are small.)

Note that meta's encoding of title, description, and guid data, and not
other data, is probably a special case that should be removed. Instead,
these values should be encoded when used. I have avoided doing so here
because that would mean forcing a wiki rebuild on upgrade to have the data
consitently encoded.
---
 IkiWiki/Plugin/comments.pm | 4 +++-
 debian/changelog           | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 98786f432..460341710 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -221,7 +221,9 @@ sub preprocess {
 	}
 
 	if (defined $params{subject}) {
-		$pagestate{$page}{meta}{title} = $params{subject};
+		# encode title the same way meta does
+		eval q{use HTML::Entities};
+		$pagestate{$page}{meta}{title} = HTML::Entities::encode_numeric(decode_entities($params{subject}));
 	}
 
 	if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
diff --git a/debian/changelog b/debian/changelog
index b7b614604..be89d0918 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,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.
 
  -- Joey Hess   Sun, 04 Apr 2010 12:17:11 -0400
 
-- 
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 'IkiWiki')

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 'IkiWiki')

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 be1d97c0bd495fe876853d7d7f6eb42041867649 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Tue, 6 Apr 2010 00:58:55 +0100
Subject: Only store titlesort in meta pagestate if it differs from title

---
 IkiWiki/Plugin/meta.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 553f93455..7f19b46a3 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -88,13 +88,18 @@ sub preprocess (@) {
 
 	# Metadata collection that needs to happen during the scan pass.
 	if ($key eq 'title') {
-		$pagestate{$page}{meta}{title}=HTML::Entities::encode_numeric($value);
+		my $encoded = HTML::Entities::encode_numeric($value);
+		$pagestate{$page}{meta}{title} = $encoded;
+
 		if (exists $params{sortas}) {
 			$pagestate{$page}{meta}{titlesort}=$params{sortas};
 		}
-		else {
+		elsif ($encoded ne $value) {
 			$pagestate{$page}{meta}{titlesort}=$value;
 		}
+		else {
+			delete $pagestate{$page}{meta}{titlesort};
+		}
 		return "";
 	}
 	elsif ($key eq 'description') {
-- 
cgit v1.2.3


From a2dc8c9373b36f7cc8da239b823b5839788a743d Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Tue, 6 Apr 2010 00:59:16 +0100
Subject: Only store authorsort in meta pagestate if it differs from author

---
 IkiWiki/Plugin/meta.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 7f19b46a3..34e902bec 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -131,7 +131,7 @@ sub preprocess (@) {
 			$pagestate{$page}{meta}{authorsort}=$params{sortas};
 		}
 		else {
-			$pagestate{$page}{meta}{authorsort}=$value;
+			delete $pagestate{$page}{meta}{authorsort};
 		}
 		# fallthorough
 	}
-- 
cgit v1.2.3


From 5408279b5ffd7038bb0c279d1379c7e0d21d0a96 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Tue, 6 Apr 2010 01:31:38 +0100
Subject: HTML-encode meta title, description, guid on output, but not in the
 pagestate

This makes them consistent with the rest of the meta keys. A wiki rebuild
will be needed on upgrade to this version; until the wiki is rebuilt,
double-escaping will occur in the titles of pages that have not changed.
---
 IkiWiki/Plugin/comments.pm |  4 ++--
 IkiWiki/Plugin/inline.pm   |  3 ++-
 IkiWiki/Plugin/meta.pm     | 15 ++++++++++-----
 3 files changed, 14 insertions(+), 8 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 460341710..0aa043215 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -221,9 +221,9 @@ sub preprocess {
 	}
 
 	if (defined $params{subject}) {
-		# encode title the same way meta does
+		# decode title the same way meta does
 		eval q{use HTML::Entities};
-		$pagestate{$page}{meta}{title} = HTML::Entities::encode_numeric(decode_entities($params{subject}));
+		$pagestate{$page}{meta}{title} = decode_entities($params{subject});
 	}
 
 	if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 44919e58c..644cb588d 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -553,7 +553,8 @@ sub genfeed ($$$$$@) {
 
 		if (exists $pagestate{$p}) {
 			if (exists $pagestate{$p}{meta}{guid}) {
-				$itemtemplate->param(guid => $pagestate{$p}{meta}{guid});
+				eval q{use HTML::Entities};
+				$itemtemplate->param(guid => HTML::Entities::encode_numeric($pagestate{$p}{meta}{guid}));
 			}
 
 			if (exists $pagestate{$p}{meta}{updated}) {
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 5f046cb2a..9906c3f57 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -88,15 +88,15 @@ sub preprocess (@) {
 
 	# Metadata collection that needs to happen during the scan pass.
 	if ($key eq 'title') {
-		$pagestate{$page}{meta}{title}=HTML::Entities::encode_numeric($value);
+		$pagestate{$page}{meta}{title}=$value;
 		return "";
 	}
 	elsif ($key eq 'description') {
-		$pagestate{$page}{meta}{description}=HTML::Entities::encode_numeric($value);
+		$pagestate{$page}{meta}{description}=$value;
 		# fallthrough
 	}
 	elsif ($key eq 'guid') {
-		$pagestate{$page}{meta}{guid}=HTML::Entities::encode_numeric($value);
+		$pagestate{$page}{meta}{guid}=$value;
 		# fallthrough
 	}
 	elsif ($key eq 'license') {
@@ -264,15 +264,20 @@ sub pagetemplate (@) {
 		$template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
 	}
 	if (exists $pagestate{$page}{meta}{title} && $template->query(name => "title")) {
-		$template->param(title => $pagestate{$page}{meta}{title});
+		$template->param(title => HTML::Entities::encode_numeric($pagestate{$page}{meta}{title}));
 		$template->param(title_overridden => 1);
 	}
 
-	foreach my $field (qw{author authorurl description permalink}) {
+	foreach my $field (qw{author authorurl permalink}) {
 		$template->param($field => $pagestate{$page}{meta}{$field})
 			if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
 	}
 
+	foreach my $field (qw{description}) {
+		$template->param($field => HTML::Entities::encode_numeric($pagestate{$page}{meta}{$field}))
+			if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
+	}
+
 	foreach my $field (qw{license copyright}) {
 		if (exists $pagestate{$page}{meta}{$field} && $template->query(name => $field) &&
 		    ($page eq $destpage || ! exists $pagestate{$destpage}{meta}{$field} ||
-- 
cgit v1.2.3


From ffb0802c4a2e48021677a78695d84a356b1b8024 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Tue, 6 Apr 2010 23:15:39 -0400
Subject: don't force a rebuild

Rebuild can be needed sometimes, but not always, so undef.
---
 IkiWiki/Plugin/sortnaturally.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/sortnaturally.pm b/IkiWiki/Plugin/sortnaturally.pm
index 92453749d..62e42767c 100644
--- a/IkiWiki/Plugin/sortnaturally.pm
+++ b/IkiWiki/Plugin/sortnaturally.pm
@@ -13,7 +13,7 @@ sub getsetup {
 	return
 		plugin => {
 			safe => 1,
-			rebuild => 1,
+			rebuild => undef,
 		},
 }
 
-- 
cgit v1.2.3


From 153c0ff13ba01fa42b3e34b410311c490ee084e9 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Tue, 6 Apr 2010 23:29:18 -0400
Subject: minor style etc changes

---
 IkiWiki.pm             | 6 ++----
 IkiWiki/Plugin/meta.pm | 6 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 6d2f4dac3..2cad6a3ef 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2435,10 +2435,8 @@ 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
-{
+# are easily available in this namespace, for cmp functions to use them.
+sub sort_pages {
 	my $f = IkiWiki::sortspec_translate(shift);
 
 	return sort $f @_;
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 34e902bec..892f6b2c9 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -300,8 +300,8 @@ sub pagetemplate (@) {
 }
 
 sub get_sort_key {
-	my $page = $_[0];
-	my $meta = $_[1];
+	my $page = shift;
+	my $meta = shift;
 
 	# e.g. titlesort (also makes sense for author)
 	my $key = $pagestate{$page}{meta}{$meta . "sort"};
@@ -379,7 +379,7 @@ sub match_copyright ($$;@) {
 package IkiWiki::SortSpec;
 
 sub cmp_meta {
-	my $meta = $_[0];
+	my $meta = shift;
 	error(gettext("sort=meta requires a parameter")) unless defined $meta;
 
 	if ($meta eq 'updated' || $meta eq 'date') {
-- 
cgit v1.2.3


From d1a616df2ed79b1602658c5d10d54ee00afc537e Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 9 Apr 2010 18:43:25 -0400
Subject: po: Check that translated underlay directories exist before using
 them for master language.

---
 IkiWiki/Plugin/po.pm | 4 +++-
 debian/changelog     | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 2250a7f9f..00c58fbe5 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -174,7 +174,9 @@ sub checkconfig () {
 		if ($config{po_master_language}{code} ne 'en') {
 			# Add underlay containing translated source files
 			# for the master language.
-			add_underlay("locale/$config{po_master_language}{code}/$underlay");
+print STDERR "added underlay locale/$config{po_master_language}{code}/$underlay\n";
+			add_underlay("locale/$config{po_master_language}{code}/$underlay")
+				if -d "$config{underlaydirbase}/locale/$config{po_master_language}{code}/$underlay";
 		}
 	}
 }
diff --git a/debian/changelog b/debian/changelog
index e14cc91f5..e985a5da8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ ikiwiki (3.20100406) UNRELEASED; urgency=low
 
   [ Joey Hess ]
   * Update dependency for git-core to git transition.
+  * po: Check that translated underlay directories exist before using them
+    for master language.
 
  -- Joey Hess   Sun, 04 Apr 2010 12:17:11 -0400
 
-- 
cgit v1.2.3


From d5eb5401496db1d7374a23f996e6924338d14ae2 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sat, 10 Apr 2010 18:28:15 -0400
Subject: po: Configuring the same language as master and slave confuses
 processing; so filter out such a misconfiguration.

---
 IkiWiki/Plugin/po.pm | 2 +-
 debian/changelog     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 00c58fbe5..759e812e6 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -133,6 +133,7 @@ sub checkconfig () {
 				      $field, 'po'));
 		}
 	}
+	delete $config{po_slave_languages}{$config{po_master_language}{code}};;
 
 	map {
 		islanguagecode($_)
@@ -174,7 +175,6 @@ sub checkconfig () {
 		if ($config{po_master_language}{code} ne 'en') {
 			# Add underlay containing translated source files
 			# for the master language.
-print STDERR "added underlay locale/$config{po_master_language}{code}/$underlay\n";
 			add_underlay("locale/$config{po_master_language}{code}/$underlay")
 				if -d "$config{underlaydirbase}/locale/$config{po_master_language}{code}/$underlay";
 		}
diff --git a/debian/changelog b/debian/changelog
index 113138358..208578527 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,8 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low
   * Update dependency for git-core to git transition.
   * po: Check that translated underlay directories exist before using them
     for master language.
+  * po: Configuring the same language as master and slave confuses processing;
+    so filter out such a misconfiguration.
 
  -- Joey Hess   Sun, 04 Apr 2010 12:17:11 -0400
 
-- 
cgit v1.2.3


From 3131433f64235ad5425eb93d5773580b607876fb Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Thu, 15 Apr 2010 13:40:53 -0400
Subject: calendar: Add archive_pagespec, which is used by ikiwiki-calendar to
 specify which pages to include on the calendar archive pages. (The pagespec
 can still also be specified on the ikiwiki-calendar command line.)

---
 IkiWiki/Plugin/calendar.pm          | 8 ++++++++
 debian/changelog                    | 4 ++++
 doc/ikiwiki-calendar.mdwn           | 8 +++++---
 doc/ikiwiki/directive/calendar.mdwn | 7 +++++--
 ikiwiki-calendar.in                 | 6 +++++-
 5 files changed, 27 insertions(+), 6 deletions(-)

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index ff84bc440..0f0e9518a 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -47,6 +47,14 @@ sub getsetup () {
 			safe => 1,
 			rebuild => 1,
 		},
+		archive_pagespec => {
+			type => "pagespec",
+			example => "posts/* and !*/Discussion",
+			description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command",
+			link => 'ikiwiki/PageSpec',
+			safe => 1,
+			rebuild => 0,
+		},
 }
 
 sub is_leap_year (@) {
diff --git a/debian/changelog b/debian/changelog
index 26b00a07c..7c607b2a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,6 +27,10 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low
     for master language.
   * po: Configuring the same language as master and slave confuses processing;
     so filter out such a misconfiguration.
+  * calendar: Add archive_pagespec, which is used by ikiwiki-calendar to
+    specify which pages to include on the calendar archive pages.
+    (The pagespec can still also be specified on the ikiwiki-calendar command
+    line.)
 
  -- Joey Hess   Sun, 04 Apr 2010 12:17:11 -0400
 
diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn
index 982892fca..c1f4d7267 100644
--- a/doc/ikiwiki-calendar.mdwn
+++ b/doc/ikiwiki-calendar.mdwn
@@ -16,9 +16,11 @@ 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,
+To control which pages are included on the calendars,
+a [[ikiwiki/PageSpec]] can be specified. The default is
+all pages, or the pages specified by the `comments_pagespec`
+setting in the config file. A pagespec can also be specified
+on the command line. To limit it to only posts in a blog,
 use something like "posts/* and !*/Discussion".
 
 It defaults to creating calendar pages for the current
diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn
index b2ac75b11..8a08081ee 100644
--- a/doc/ikiwiki/directive/calendar.mdwn
+++ b/doc/ikiwiki/directive/calendar.mdwn
@@ -40,9 +40,12 @@ An example crontab:
   "month" or "year". The default is a month view calendar.
 * `pages` - Specifies the [[ikiwiki/PageSpec]] of pages to link to from the
   month calendar. Defaults to "*".
-* `archivebase` - Configures the base of the archives hierarchy. The
-  default is "archives". Note that this default can also be overridden
+* `archivebase` - Configures the base of the archives hierarchy. 
+  The default is "archives". Note that this default can also be overridden
   for the whole wiki by setting `archivebase` in ikiwiki's setup file.
+  Calendars link to pages under here, with names like "2010/04" and
+  "2010". These pages can be automatically created using the
+  [[ikiwiki-calendar]] tool. 
 * `year` - The year for which the calendar is requested. Defaults to the
   current year.
 * `month` - The numeric month for which the calendar is requested, in the
diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in
index 9738ea5f7..6b6f693b3 100755
--- a/ikiwiki-calendar.in
+++ b/ikiwiki-calendar.in
@@ -15,7 +15,7 @@ GetOptions(
 	"force" => \$force,
 ) || usage();
 my $setup=shift		|| usage();
-my $pagespec=shift	|| "*";
+my $pagespec=shift;
 my $startyear=shift	|| 1900+(localtime(time))[5];
 my $endyear=shift	|| $startyear;
 
@@ -27,6 +27,10 @@ IkiWiki::checkconfig();
 my $archivebase = 'archives';
 $archivebase = $config{archivebase} if defined $config{archivebase};
 
+if (! defined $pagespec) {
+	$pagespec=$config{archive_pagespec} || "*";
+}
+
 sub writearchive ($$;$) {
 	my $template=template(shift);
 	my $year=shift;
-- 
cgit v1.2.3


From fe733e2a424f50227e4a501c3efbf1ce43e07352 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Thu, 15 Apr 2010 14:29:14 -0400
Subject: enhance pagestats and rework example blog front page

* pagestats: Class parameter can be used to override default class for
  custom styling.
* pagestats: Use style=list to get a list of tags, scaled by use like
  in a tag cloud. This is useful to put in a sidebar.
* Rework example blog front page.
---
 IkiWiki/Plugin/pagestats.pm          | 21 ++++++++++++++++++---
 debian/changelog                     |  5 +++++
 doc/examples/blog/archives.mdwn      |  7 +++++++
 doc/examples/blog/comments.mdwn      |  2 +-
 doc/examples/blog/index.mdwn         | 12 ++++++++----
 doc/ikiwiki/directive/pagestats.mdwn | 11 ++++++++++-
 6 files changed, 49 insertions(+), 9 deletions(-)
 create mode 100644 doc/examples/blog/archives.mdwn

(limited to 'IkiWiki')

diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index 1c0b46830..48715bd3e 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -75,7 +75,7 @@ sub preprocess (@) {
 	}
 
 	if ($style eq 'table') {
-		return "\n".
+		return "
\n". join("\n", map { " + + + + + 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=< - + + + + + 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 dd64c2a9c0d7a1bfe9d3b89957efe8f045091111 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 22:18:56 -0400 Subject: sidebar plugin optimisations The pagetemplate hook may be called multiple times, for example when pages are inlined into a page. Sidebars were being calculated each time that happened, only to be thrown away when the final pagetemplate hook was called. Avoid this unnecessary work. Remove stored sidebar content on use to save some memory. --- IkiWiki/Plugin/sidebar.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 808f0bed2..0350f2b71 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -60,7 +60,7 @@ my $oldcontent; sub sidebar_content ($) { my $page=shift; - return $pagesidebar{$page} if defined $pagesidebar{$page}; + return delete $pagesidebar{$page} if defined $pagesidebar{$page}; return if ! exists $pagesidebar{$page} && defined $config{global_sidebars} && ! $config{global_sidebars}; @@ -97,11 +97,10 @@ sub sidebar_content ($) { sub pagetemplate (@) { my %params=@_; - my $page=$params{page}; my $template=$params{template}; - - if ($template->query(name => "sidebar")) { - my $content=sidebar_content($page); + if ($params{destpage} eq $params{page} && + $template->query(name => "sidebar")) { + my $content=sidebar_content($params{destpage}); if (defined $content && length $content) { $template->param(sidebar => $content); } -- 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 'IkiWiki') 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 'IkiWiki') 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 b13bb0c83c8f23bca97734882997fd3dc29f0553 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 18:43:51 -0400 Subject: implement rcs_getmtime for svn This is a slow implementation; it runs svn log once per file still, rather than running svn log once on the whole srcdir. I did it this way because in my experience, svn log, run on a directory, does not always list every change to files inside that directory. I don't know why, and I use svn as little as possible these days. --- IkiWiki/Plugin/svn.pm | 42 +++++++++++++++++++++++++++++++----------- debian/changelog | 2 +- doc/rcs.mdwn | 2 +- 3 files changed, 33 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index 85c205f09..6e1d4a40f 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -350,9 +350,18 @@ sub rcs_diff ($) { return `svnlook diff $config{svnrepo} -r$rev --no-diff-deleted`; } -sub rcs_getctime ($) { +{ + +my ($lastfile, $lastmtime, $lastctime); + +sub findtimes ($) { my $file=shift; + if ($lastfile eq $file) { + return $lastmtime, $lastctime; + } + $lastfile=$file; + my $svn_log_infoline=qr/^r\d+\s+\|\s+[^\s]+\s+\|\s+(\d+-\d+-\d+\s+\d+:\d+:\d+\s+[-+]?\d+).*/; my $child = open(SVNLOG, "-|"); @@ -360,28 +369,39 @@ sub rcs_getctime ($) { exec("svn", "log", $file) || error("svn log $file failed to run"); } - my $date; + my ($cdate, $mdate); while () { if (/$svn_log_infoline/) { - $date=$1; + $cdate=$1; + $mdate=$1 unless defined $mdate; } } - close SVNLOG || warn "svn log $file exited $?"; + close SVNLOG || error "svn log $file exited $?"; - if (! defined $date) { - warn "failed to parse svn log for $file\n"; - return 0; + if (! defined $cdate) { + error "failed to parse svn log for $file\n"; } eval q{use Date::Parse}; error($@) if $@; - $date=str2time($date); - debug("found ctime ".localtime($date)." for $file"); - return $date; + + $lastctime=str2time($cdate); + $lastmtime=str2time($mdate); + return $lastmtime, $lastctime; +} + +} + +sub rcs_getctime ($) { + my $file=shift; + + return (findtimes($file))[1]; } sub rcs_getmtime ($) { - error "rcs_getmtime is not implemented for svn\n"; # TODO + my $file=shift; + + return (findtimes($file))[0]; } 1 diff --git a/debian/changelog b/debian/changelog index 60a67cbe3..774aedc40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,7 +50,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * Automatically run --gettime the first time ikiwiki is run on a given srcdir. * Add rcs_getmtime to plugin API; currently only implemented - for git. + for git and svn. * 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. diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn index b5bfc2414..450d16800 100644 --- a/doc/rcs.mdwn +++ b/doc/rcs.mdwn @@ -28,7 +28,7 @@ auto.setup |yes |yes |incomplete|yes |incomplete |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 +`rcs_getmtime` |fast |slow |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 """]] -- cgit v1.2.3 From 9265ce85b6905024a45e66b89bd6c9c910c0b07a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 19:23:11 -0400 Subject: squelch warning --- IkiWiki/Plugin/svn.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index 6e1d4a40f..d10b4888d 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -357,7 +357,7 @@ my ($lastfile, $lastmtime, $lastctime); sub findtimes ($) { my $file=shift; - if ($lastfile eq $file) { + if (defined $lastfile && $lastfile eq $file) { return $lastmtime, $lastctime; } $lastfile=$file; -- cgit v1.2.3 From c769a33392c4dedbabfb1fa1fda5c8bb30b84c78 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 12:20:50 -0400 Subject: autoindex: Switch to using %wikistate instead of abusing $pagestate{index}. --- IkiWiki/Plugin/autoindex.pm | 20 ++++++++++++++------ debian/changelog | 2 ++ ...uto-create_tag_pages_according_to_a_template.mdwn | 3 +++ 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 555856b11..c71d73349 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -61,8 +61,16 @@ sub refresh () { } my %deleted; - if (ref $pagestate{index}{autoindex}{deleted}) { - %deleted=%{$pagestate{index}{autoindex}{deleted}}; + if (ref $wikistate{autoindex}{deleted}) { + %deleted=%{$wikistate{autoindex}{deleted}}; + } + elsif (ref $pagestate{index}{autoindex}{deleted}) { + # compatability code + %deleted=%{$pagestate{index}{autoindex}{deleted}}; + delete $pagestate{index}{autoindex}; + } + + if (keys %deleted) { foreach my $dir (keys %deleted) { # remove deleted page state if the deleted page is re-added, # or if all its subpages are deleted @@ -71,7 +79,7 @@ sub refresh () { delete $deleted{$dir}; } } - $pagestate{index}{autoindex}{deleted}=\%deleted; + $wikistate{autoindex}{deleted}=\%deleted; } my @needed; @@ -82,10 +90,10 @@ sub refresh () { # This page must have just been deleted, so # don't re-add it. And remember it was # deleted. - if (! ref $pagestate{index}{autoindex}{deleted}) { - $pagestate{index}{autoindex}{deleted}={}; + if (! ref $wikistate{autoindex}{deleted}) { + $wikistate{autoindex}{deleted}={}; } - ${$pagestate{index}{autoindex}{deleted}}{$dir}=1; + ${$wikistate{autoindex}{deleted}}{$dir}=1; } else { push @needed, $dir; diff --git a/debian/changelog b/debian/changelog index d65ffffd7..4721c5309 100644 --- a/debian/changelog +++ b/debian/changelog @@ -58,6 +58,8 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low an iffy thing. * Use above to fix up timestamps on docwiki, as well as ensure that timestamps on basewiki files shipped in the deb are sane. + * autoindex: Switch to using %wikistate instead of abusing + $pagestate{index}. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 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 8fc97578c..49da3c80c 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 @@ -239,6 +239,9 @@ wrong direction. >>>>>> Aha! Having looked at [[plugins/write]] again, it turns out that what this >>>>>> feature should really use is `%wikistate`, I think? :-) --[[smcv]] +>>>>>>> Ah, indeed, that came after I wrote autoindex. I've fixed autoindex to +>>>>>>> use it. --[[Joey]] + >>>>> Ok, now I know what you mean. --[[David_Riebenbauer]] >>> * `autoindex` forgets that a page was deleted when that page is -- cgit v1.2.3 From 2269a4c74b24378d8e7e2229ca3374a197d08d9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 12:54:22 -0400 Subject: whitespace --- IkiWiki.pm | 24 ++++++++++++------------ IkiWiki/Render.pm | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 2f26a16ce..3812961dc 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -12,20 +12,20 @@ use Storable; 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 %typedlinks %oldtypedlinks - %autofiles %del_hash}; + %pagestate %wikistate %renderedfiles %oldrenderedfiles + %pagesources %destsources %depends %depends_simple %hooks + %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks + %autofiles %del_hash}; 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 ngettext urlto targetpage - add_underlay pagetitle titlepage linkpage newpagefile - inject add_link add_autofile - %config %links %pagestate %wikistate %renderedfiles - %pagesources %destsources %typedlinks); + 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 + inject add_link add_autofile + %config %links %pagestate %wikistate %renderedfiles + %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 @@ -1891,7 +1891,7 @@ sub define_gettext () { return shift; } }; - *ngettext=sub { + *ngettext=sub { $getobj->() if $getobj; if ($gettext_obj) { $gettext_obj->nget(@_); diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 796af6af2..c80030deb 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -43,7 +43,7 @@ sub backlinks ($) { my @links; foreach my $p (backlink_pages($page)) { my $href=urlto($p, $page); - + # Trim common dir prefixes from both pages. my $p_trimmed=$p; my $page_trimmed=$page; -- cgit v1.2.3 From b7d50abc0f3dbe99d2a3664c12ea95d24bfcf04b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 13:35:15 -0400 Subject: refactor autofiles Made add_autofile take a generator function, and just register the autofile, for later possible creation. The testing is moved into Render, which allows cleaning up some stuff. --- IkiWiki.pm | 35 ++++++++++------------------------ IkiWiki/Plugin/tag.pm | 12 ++++++------ IkiWiki/Render.pm | 52 +++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 54 insertions(+), 45 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 3812961dc..c22c75df8 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -15,7 +15,7 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %wikistate %renderedfiles %oldrenderedfiles %pagesources %destsources %depends %depends_simple %hooks %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks - %autofiles %del_hash}; + %autofiles}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage deptype @@ -1956,6 +1956,15 @@ sub add_link ($$;$) { } } +sub add_autofile ($$$) { + my $file=shift; + my $plugin=shift; + my $generator=shift; + + $autofiles{$file}{plugin}=$plugin; + $autofiles{$file}{generator}=$generator; +} + sub sortspec_translate ($$) { my $spec = shift; my $reverse = shift; @@ -2021,30 +2030,6 @@ sub sortspec_translate ($$) { return eval 'sub { '.$code.' }'; } -sub add_autofile ($$) { - my $autofile=shift; - my $plugin=shift; - - if (srcfile($autofile, 1)) { - return 0; - } - - my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir}); - - if ((!defined $file) || - (exists $pagestate{$page}{$plugin}{autofile_deleted})) { - return 0; - } - - if (exists $del_hash{$file}) { - $pagestate{$page}{$plugin}{autofile_deleted}=1; - return 0; - } - - $autofiles{$file}=$plugin; - return 1; -} - sub pagespec_translate ($) { my $spec=shift; diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 9e6f417bf..7a918a4e8 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -70,13 +70,13 @@ sub gentag ($) { my $tagfile = newpagefile(tagpage($tag), $config{default_pageext}); $tagfile=~s/^\///; - return if (! add_autofile($tagfile, "tag")); + add_autofile($tagfile, sub { + debug(sprintf(gettext("creating tag page %s"), $tag)); - debug(sprintf(gettext("creating tag page %s"), $tag)); - - my $template=template("autotag.tmpl"); - $template->param(tag => $tag); - writefile($tagfile, $config{srcdir}, $template->output); + my $template=template("autotag.tmpl"); + $template->param(tag => $tag); + writefile($tagfile, $config{srcdir}, $template->output); + }); } } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index c80030deb..83242a197 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -680,6 +680,37 @@ sub render_backlinks ($) { } } +sub gen_autofile ($$$) { + my $autofile=shift; + my $pages=shift; + my $del=shift; + + if (srcfile($autofile, 1)) { + return 0; + } + + my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir}); + + if ((!defined $file) || + (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile_deleted})) { + return 0; + } + + if ($pages->{$page}) { + return 0; + } + + if (grep { $_ eq $file } @$del) { + $wikistate{$autofiles{$autofile}{generator}}{autofile_deleted}=1; + return 0; + } + + $autofiles{$autofile}{generator}->(); + $pages->{$page}=1; + return 1; +} + + sub refresh () { srcdir_check(); run_hooks(refresh => sub { shift->() }); @@ -689,26 +720,19 @@ sub refresh () { my ($changed, $internal_changed)=find_changed($files); run_hooks(needsbuild => sub { shift->($changed) }); my $oldlink_targets=calculate_old_links($changed, $del); - %del_hash = map { $_ => 1 } @{$del}; foreach my $file (@$changed) { scan($file); } - while (my $autofile = shift @{[keys %autofiles]}) { - my $plugin=$autofiles{$autofile}; - my $page=pagename($autofile); - if ($pages->{$page}) { - debug(sprintf(gettext("%s has multiple possible source pages"), $page)); + foreach my $autofile (keys %autofiles) { + if (gen_autofile($autofile, $pages, $del)) { + push @{$files}, $autofile; + push @{$new}, $autofile if find_new_files([$autofile]); + push @{$changed}, $autofile if find_changed([$autofile]); + + scan($autofile); } - $pages->{$page}=1; - - push @{$files}, $autofile; - push @{$new}, $autofile if find_new_files([$autofile]); - push @{$changed}, $autofile if find_changed([$autofile]); - - scan($autofile); - delete $autofiles{$autofile}; } calculate_links(); -- cgit v1.2.3 From 9ff5174f1164cb2d31ff487a9c84d08559b81d39 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Apr 2010 18:45:23 +0200 Subject: Fix get_ctime implementation in Bazaar plugin, add get_mtime implementation. --- IkiWiki/Plugin/bzr.pm | 28 +++++++++++++++++++--------- t/bazaar.t | 5 ++++- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index f79ca7c8f..3712302ce 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -286,14 +286,8 @@ sub rcs_diff ($) { } } -sub rcs_getctime ($) { - my ($file) = @_; - - # XXX filename passes through the shell here, should try to avoid - # that just in case - my @cmdline = ("bzr", "log", "--limit", '1', "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); - +sub extract_timestamp ($) { + my ($out) = @_; my @log = bzr_log($out); if (length @log < 1) { @@ -307,8 +301,24 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getctime ($) { + my ($file) = @_; + + # XXX filename passes through the shell here, should try to avoid + # that just in case + my @cmdline = ("bzr", "log", "--forward", "--limit", '1', "$config{srcdir}/$file"); + open (my $out, "@cmdline |"); + return extract_timestamp($out); +} + sub rcs_getmtime ($) { - error "rcs_getmtime is not implemented for bzr\n"; # TODO + my ($file) = @_; + + # XXX filename passes through the shell here, should try to avoid + # that just in case + my @cmdline = ("bzr", "log", "--limit", '1', "$config{srcdir}/$file"); + open (my $out, "@cmdline |"); + return extract_timestamp($out); } 1 diff --git a/t/bazaar.t b/t/bazaar.t index 2ca44a65e..0bdd883d5 100755 --- a/t/bazaar.t +++ b/t/bazaar.t @@ -12,7 +12,7 @@ BEGIN { } } } -use Test::More tests => 16; +use Test::More tests => 17; BEGIN { use_ok("IkiWiki"); } @@ -60,6 +60,9 @@ is($changes[1]{pages}[0]{"page"}, "test1"); my $ctime = IkiWiki::rcs_getctime("test2.mdwn"); ok($ctime >= time() - 20); +my $mtime = IkiWiki::rcs_getmtime("test2.mdwn"); +ok($mtime >= time() - 20); + writefile('test3.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test3.mdwn"); IkiWiki::rcs_rename("test3.mdwn", "test4.mdwn"); -- cgit v1.2.3 From 2f9504a10d87f6950325dcea2d8a1f5a5d3eefe4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 13:55:32 -0400 Subject: bzr: changelog and refactor --- IkiWiki/Plugin/bzr.pm | 20 ++++++++------------ debian/changelog | 2 ++ 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 3712302ce..e7c1b8d8e 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -286,8 +286,10 @@ sub rcs_diff ($) { } } -sub extract_timestamp ($) { - my ($out) = @_; +sub extract_timestamp (@) { + # XXX filename passes through the shell here, should try to avoid + # that just in case + open (my $out, "@_ |"); my @log = bzr_log($out); if (length @log < 1) { @@ -297,28 +299,22 @@ sub extract_timestamp ($) { eval q{use Date::Parse}; error($@) if $@; - my $ctime = str2time($log[0]->{"timestamp"}); - return $ctime; + my $time = str2time($log[0]->{"timestamp"}); + return $time; } sub rcs_getctime ($) { my ($file) = @_; - # XXX filename passes through the shell here, should try to avoid - # that just in case my @cmdline = ("bzr", "log", "--forward", "--limit", '1', "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); - return extract_timestamp($out); + return extract_timestamp(@cmdline); } sub rcs_getmtime ($) { my ($file) = @_; - # XXX filename passes through the shell here, should try to avoid - # that just in case my @cmdline = ("bzr", "log", "--limit", '1', "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); - return extract_timestamp($out); + return extract_timestamp(@cmdline); } 1 diff --git a/debian/changelog b/debian/changelog index 01d650290..b7ec99463 100644 --- a/debian/changelog +++ b/debian/changelog @@ -60,6 +60,8 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low timestamps on basewiki files shipped in the deb are sane. * autoindex: Switch to using %wikistate instead of abusing $pagestate{index}. + * bzr: Support rcs_getmtime, and fix rcs_getctime implementation + (Jelmer Vernooij) -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 -- cgit v1.2.3 From adc196a8b53c0b0b4f9ec4cbcea85ba37e421b59 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 15:40:39 -0400 Subject: tag_autocreate fixups Fix style of prompt. Optional to rebuild when it is changed. (Needed to get new all missing tags) --- IkiWiki/Plugin/tag.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 7a918a4e8..1145a9f13 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -37,9 +37,9 @@ sub getsetup () { tag_autocreate => { type => "boolean", example => 0, - description => "Autocreate new tag pages", + description => "autocreate new tag pages?", safe => 1, - rebuild => 1, + rebuild => undef, }, } @@ -66,7 +66,7 @@ sub taglink ($$$;@) { sub gentag ($) { my $tag=shift; - if (defined $config{tag_autocreate} && $config{tag_autocreate}) { + if ($config{tag_autocreate}) { my $tagfile = newpagefile(tagpage($tag), $config{default_pageext}); $tagfile=~s/^\///; -- cgit v1.2.3 From 3651e6263c55a0b6184fe46c856a96740621361f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 15:43:58 -0400 Subject: fix autofile call --- IkiWiki/Plugin/tag.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 1145a9f13..957b012ef 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -70,7 +70,7 @@ sub gentag ($) { my $tagfile = newpagefile(tagpage($tag), $config{default_pageext}); $tagfile=~s/^\///; - add_autofile($tagfile, sub { + add_autofile($tagfile, "tag", sub { debug(sprintf(gettext("creating tag page %s"), $tag)); my $template=template("autotag.tmpl"); -- cgit v1.2.3 From b00d8771cc212349ca886401bc68facdf08e0d3c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 15:48:00 -0400 Subject: call gentag for taglinks too --- IkiWiki/Plugin/tag.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 957b012ef..9f6df5fc4 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -45,7 +45,7 @@ sub getsetup () { sub tagpage ($) { my $tag=shift; - + if ($tag !~ m{^\.?/} && defined $config{tagbase}) { $tag="/".$config{tagbase}."/".$tag; @@ -96,7 +96,6 @@ sub preprocess_tag (@) { # hidden WikiLink add_link($page, tagpage($tag), 'tag'); - # add tagpage if necessary gentag($tag); } @@ -112,12 +111,14 @@ sub preprocess_taglink (@) { if (/(.*)\|(.*)/) { my $tag=linkpage($2); add_link($params{page}, tagpage($tag), 'tag'); + gentag($tag); return taglink($params{page}, $params{destpage}, $tag, linktext => pagetitle($1)); } else { my $tag=linkpage($_); add_link($params{page}, tagpage($tag), 'tag'); + gentag($tag); return taglink($params{page}, $params{destpage}, $tag); } } -- cgit v1.2.3 From 2fc342b048d23d8355631000b7285fb5d26b258a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 16:01:41 -0400 Subject: fix autotag behavior for relative tags A tag like ./foo is searched for relative to the tagging page. However, if multiple pages use such a tag, the only one sure to be in common is in the root, so autocreate it there to avoid scattering redunadant autocreated tags around the tree. (This is probably not ideal.) Also renamed the tagpage and taglink functions for clarity. --- IkiWiki/Plugin/tag.pm | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 9f6df5fc4..d2a3d4dfd 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -43,7 +43,7 @@ sub getsetup () { }, } -sub tagpage ($) { +sub taglink ($) { my $tag=shift; if ($tag !~ m{^\.?/} && @@ -55,20 +55,28 @@ sub tagpage ($) { return $tag; } -sub taglink ($$$;@) { +sub htmllink_tag ($$$;@) { my $page=shift; my $destpage=shift; my $tag=shift; my %opts=@_; - return htmllink($page, $destpage, tagpage($tag), %opts); + return htmllink($page, $destpage, taglink($tag), %opts); } sub gentag ($) { my $tag=shift; + if ($config{tag_autocreate}) { - my $tagfile = newpagefile(tagpage($tag), $config{default_pageext}); - $tagfile=~s/^\///; + my $tagpage=taglink($tag); + if ($tagpage=~/^\.\/(.*)/) { + $tagpage=$1; + } + else { + $tagpage=~s/^\///; + } + + my $tagfile = newpagefile($tagpage, $config{default_pageext}); add_autofile($tagfile, "tag", sub { debug(sprintf(gettext("creating tag page %s"), $tag)); @@ -94,7 +102,7 @@ sub preprocess_tag (@) { $tag=linkpage($tag); # hidden WikiLink - add_link($page, tagpage($tag), 'tag'); + add_link($page, taglink($tag), 'tag'); gentag($tag); } @@ -110,16 +118,16 @@ sub preprocess_taglink (@) { return join(" ", map { if (/(.*)\|(.*)/) { my $tag=linkpage($2); - add_link($params{page}, tagpage($tag), 'tag'); + add_link($params{page}, taglink($tag), 'tag'); gentag($tag); - return taglink($params{page}, $params{destpage}, $tag, + return htmllink_tag($params{page}, $params{destpage}, $tag, linktext => pagetitle($1)); } else { my $tag=linkpage($_); - add_link($params{page}, tagpage($tag), 'tag'); + add_link($params{page}, taglink($tag), 'tag'); gentag($tag); - return taglink($params{page}, $params{destpage}, $tag); + return htmllink_tag($params{page}, $params{destpage}, $tag); } } grep { @@ -137,7 +145,7 @@ sub pagetemplate (@) { $template->param(tags => [ map { - link => taglink($page, $destpage, $_, rel => "tag") + link => htmllink_tag($page, $destpage, $_, rel => "tag") }, sort keys %$tags ]) if defined $tags && %$tags && $template->query(name => "tags"); @@ -153,7 +161,7 @@ sub pagetemplate (@) { package IkiWiki::PageSpec; sub match_tagged ($$;@) { - return match_link($_[0], IkiWiki::Plugin::tag::tagpage($_[1]), linktype => 'tag'); + return match_link($_[0], IkiWiki::Plugin::tag::taglink($_[1]), linktype => 'tag'); } 1 -- cgit v1.2.3 From f78e6798aa5482e534d7254b87a7b58e9fcc0145 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 16:08:37 -0400 Subject: move decode_utf8 closer to reason for it Filenames need to be decoded, as File::Find does not provide them in decoded form, but other callers of verify_src_file will be using utf8. --- IkiWiki/Render.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 83242a197..fff9dcce6 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -282,7 +282,7 @@ sub srcdir_check () { } sub verify_src_file ($$) { - my $file=decode_utf8(shift); + my $file=shift; my $dir=shift; return if -l $file || -d _; @@ -310,7 +310,7 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my ($file, $page) = verify_src_file($_, $config{srcdir}); + my ($file, $page) = verify_src_file(decode_utf8($_), $config{srcdir}); if (defined $file) { push @files, $file; if ($pages{$page}) { @@ -324,7 +324,7 @@ sub find_src_files () { find({ no_chdir => 1, wanted => sub { - my ($file, $page) = verify_src_file($_, $dir); + my ($file, $page) = verify_src_file(decode_utf8($_), $dir); if (defined $file) { # avoid underlaydir override # attacks; see security.mdwn -- cgit v1.2.3 From 831b891abdc68d1b111381d6559cebd5a9b6c78f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 16:14:15 -0400 Subject: move File::Find control back into its code blocks Ok, this is longer, but features less scary action at a distance. --- IkiWiki/Render.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index fff9dcce6..41f179a50 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -291,7 +291,6 @@ sub verify_src_file ($$) { my $page = pagename($file); if (! exists $pagesources{$page} && file_pruned($file)) { - $File::Find::prune=1; return; } @@ -318,6 +317,9 @@ sub find_src_files () { } $pages{$page}=1; } + else { + $File::Find::prune=1; + } }, }, $config{srcdir}); foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) { @@ -336,6 +338,9 @@ sub find_src_files () { } } } + else { + $File::Find::prune=1; + } }, }, $dir); }; -- cgit v1.2.3 From a97964688b73d0a3237c798dce3fb064ff29ff11 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 19:05:40 -0400 Subject: unfinished file_prune revamp Many calls to file_prune were incorrectly calling it with 2 parameters. In cases where the filename being checked is relative to the srcdir, that is not needed. Made absolute filenames be pruned. (This won't work for the 2 parameter call style.) --- IkiWiki.pm | 2 +- IkiWiki/Plugin/attachment.pm | 2 +- IkiWiki/Plugin/comments.pm | 4 ++-- IkiWiki/Plugin/editpage.pm | 4 ++-- IkiWiki/Plugin/rename.pm | 5 ++--- IkiWiki/Receive.pm | 2 +- t/file_pruned.t | 40 +++++++++++++++++++++++++++++++++++++--- 7 files changed, 46 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index b37b1f344..a5f83ac7a 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -355,7 +355,7 @@ sub getsetup () { }, wiki_file_prune_regexps => { type => "internal", - default => [qr/(^|\/)\.\.(\/|$)/, qr/^\./, qr/\/\./, + default => [qr/(^|\/)\.\.(\/|$)/, qr/^\//, qr/^\./, qr/\/\./, qr/\.x?html?$/, qr/\.ikiwiki-new$/, qr/(^|\/).svn\//, qr/.arch-ids\//, qr/{arch}\//, qr/(^|\/)_MTN\//, qr/(^|\/)_darcs\//, diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index ad1dd9bca..8c3ff887a 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -137,7 +137,7 @@ sub formbuilder (@) { $filename=linkpage(IkiWiki::possibly_foolish_untaint( attachment_location($form->field('page')). IkiWiki::basename($filename))); - if (IkiWiki::file_pruned($filename, $config{srcdir})) { + if (IkiWiki::file_pruned($filename)) { error(gettext("bad attachment filename")); } diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 0aa043215..1c219b6c6 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -338,7 +338,7 @@ sub editcomment ($$) { my $page = $form->field('page'); $page = IkiWiki::possibly_foolish_untaint($page); if (! defined $page || ! length $page || - IkiWiki::file_pruned($page, $config{srcdir})) { + IkiWiki::file_pruned($page)) { error(gettext("bad page name")); } @@ -548,7 +548,7 @@ sub commentmoderation ($$) { # pending comment before untainting. my ($f)= $id =~ /$config{wiki_file_regexp}/; if (! defined $f || ! length $f || - IkiWiki::file_pruned($f, $config{srcdir})) { + IkiWiki::file_pruned($f)) { error("illegal file"); } diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 44fe5514a..ee1de8eaa 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -94,7 +94,7 @@ sub cgi_editpage ($$) { $page=possibly_foolish_untaint($page); my $absolute=($page =~ s#^/+##); if (! defined $page || ! length $page || - file_pruned($page, $config{srcdir})) { + file_pruned($page)) { error(gettext("bad page name")); } @@ -220,7 +220,7 @@ sub cgi_editpage ($$) { my $best_loc; if (! defined $from || ! length $from || $from ne $form->field('from') || - file_pruned($from, $config{srcdir}) || + file_pruned($from) || $from=~/^\// || $absolute || $form->submitted) { diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 1a9da6363..69e615ead 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -63,9 +63,8 @@ sub check_canrename ($$$$$$) { error(gettext("no change to the file name was specified")); } - # Must be a legal filename, and not absolute. - if (IkiWiki::file_pruned($destfile, $config{srcdir}) || - $destfile=~/^\//) { + # Must be a legal filename. + if (IkiWiki::file_pruned($destfile)) { error(sprintf(gettext("illegal name"))); } diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index cd94d0938..ae1bd8bef 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -82,7 +82,7 @@ sub test () { my ($file)=$change->{file}=~/$config{wiki_file_regexp}/; $file=IkiWiki::possibly_foolish_untaint($file); if (! defined $file || ! length $file || - IkiWiki::file_pruned($file, $config{srcdir})) { + IkiWiki::file_pruned($file)) { error(gettext("bad file name %s"), $file); } diff --git a/t/file_pruned.t b/t/file_pruned.t index f9c1c257e..4335ed917 100755 --- a/t/file_pruned.t +++ b/t/file_pruned.t @@ -1,41 +1,75 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 27; +use Test::More tests => 54; BEGIN { use_ok("IkiWiki"); } %config=IkiWiki::defaultconfig(); ok(IkiWiki::file_pruned("src/.htaccess", "src")); +ok(IkiWiki::file_pruned(".htaccess")); ok(IkiWiki::file_pruned("src/.ikiwiki/", "src")); +ok(IkiWiki::file_pruned(".ikiwiki/")); ok(IkiWiki::file_pruned("src/.ikiwiki/index", "src")); +ok(IkiWiki::file_pruned(".ikiwiki/index")); ok(IkiWiki::file_pruned("src/CVS/foo", "src")); +ok(IkiWiki::file_pruned("CVS/foo")); ok(IkiWiki::file_pruned("src/subdir/CVS/foo", "src")); +ok(IkiWiki::file_pruned("subdir/CVS/foo")); ok(IkiWiki::file_pruned("src/.svn", "src")); +ok(IkiWiki::file_pruned(".svn")); ok(IkiWiki::file_pruned("src/subdir/.svn", "src")); +ok(IkiWiki::file_pruned("subdir/.svn")); ok(IkiWiki::file_pruned("src/subdir/.svn/foo", "src")); +ok(IkiWiki::file_pruned("subdir/.svn/foo")); ok(IkiWiki::file_pruned("src/.git", "src")); +ok(IkiWiki::file_pruned(".git")); ok(IkiWiki::file_pruned("src/subdir/.git", "src")); +ok(IkiWiki::file_pruned("subdir/.git")); ok(IkiWiki::file_pruned("src/subdir/.git/foo", "src")); +ok(IkiWiki::file_pruned("subdir/.git/foo")); ok(! IkiWiki::file_pruned("src/svn/fo", "src")); +ok(! IkiWiki::file_pruned("svn/fo")); ok(! IkiWiki::file_pruned("src/git", "src")); +ok(! IkiWiki::file_pruned("git")); ok(! IkiWiki::file_pruned("src/index.mdwn", "src")); +ok(! IkiWiki::file_pruned("index.mdwn")); ok(! IkiWiki::file_pruned("src/index.", "src")); +ok(! IkiWiki::file_pruned("index.")); # these are ok because while the filename starts with ".", the canonpathed # version does not ok(! IkiWiki::file_pruned("src/.", "src")); ok(! IkiWiki::file_pruned("src/./", "src")); +# OTOH, without a srcdir, no canonpath, so they're not allowed. +ok(IkiWiki::file_pruned(".")); +ok(IkiWiki::file_pruned("./")); + +# Without a srcdir, absolute filenames are not allowed. +ok(IkiWiki::file_pruned("/etc/passwd")); +ok(IkiWiki::file_pruned("//etc/passwd")); +ok(IkiWiki::file_pruned("/")); +ok(IkiWiki::file_pruned("//")); +ok(IkiWiki::file_pruned("///")); + ok(IkiWiki::file_pruned("src/..", "src")); +ok(IkiWiki::file_pruned("..")); ok(IkiWiki::file_pruned("src/../", "src")); +ok(IkiWiki::file_pruned("../")); ok(IkiWiki::file_pruned("src/../", "src")); +ok(IkiWiki::file_pruned("../")); +# This is perhaps counterintuitive. ok(! IkiWiki::file_pruned("src", "src")); + +# Dots, etc, in the srcdir are ok. ok(! IkiWiki::file_pruned("/.foo/src", "/.foo/src")); ok(IkiWiki::file_pruned("/.foo/src/.foo/src", "/.foo/src")); ok(! IkiWiki::file_pruned("/.foo/src/index.mdwn", "/.foo/src/index.mdwn")); -ok(IkiWiki::file_pruned("x/y/foo.dpkg-tmp", "src")); -ok(IkiWiki::file_pruned("x/y/foo.ikiwiki-new", "src")); +ok(IkiWiki::file_pruned("src/y/foo.dpkg-tmp", "src")); +ok(IkiWiki::file_pruned("y/foo.dpkg-tmp")); +ok(IkiWiki::file_pruned("src/y/foo.ikiwiki-new", "src")); +ok(IkiWiki::file_pruned("y/foo.ikiwiki-new")); -- cgit v1.2.3 From 2111bf0408620a307c8c0373489ef34ca6626fd2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Apr 2010 22:14:22 -0400 Subject: move message into if block --- IkiWiki/Render.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index a6b0f0617..1114e05c8 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -366,13 +366,13 @@ sub find_new_files ($) { push @internal_new, $file; } 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") { + if (! $times_noted) { + debug(sprintf(gettext("querying %s for file creation and modification times.."), $config{rcs})); + $times_noted=1; + } + eval { my $ctime=rcs_getctime("$config{srcdir}/$file"); if ($ctime > 0) { -- cgit v1.2.3 From de6167a3b03389c0ec8223e7ee101707b6c73953 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Apr 2010 23:45:42 -0400 Subject: change wording This is more accurate when a file that is not a page is what is removed. --- IkiWiki/Render.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 1114e05c8..172b08b1e 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -431,7 +431,7 @@ sub remove_del (@) { foreach my $file (@_) { my $page=pagename($file); if (! isinternal($page)) { - debug(sprintf(gettext("removing old page %s"), $page)); + debug(sprintf(gettext("removing obsolete %s"), $page)); } foreach my $old (@{$oldrenderedfiles{$page}}) { -- cgit v1.2.3 From 1239fa55d5d5b9ca81dbde0874f4ff8d1980429d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 00:07:41 -0400 Subject: no need to return content from postscan hook --- IkiWiki/Plugin/search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index c0e8703d8..a1e7026ca 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -70,7 +70,7 @@ sub index (@) { # A unique pageterm is used to identify the document for a page. my $pageterm=pageterm($params{page}); - return $params{content} unless defined $pageterm; + return unless defined $pageterm; my $db=xapiandb(); my $doc=Search::Xapian::Document->new(); -- cgit v1.2.3 From d1a1f3ad21e9e58d1232fc3d997028a463ccad4a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 01:54:42 -0400 Subject: fix minor bug if a page's name is "0" --- IkiWiki/Render.pm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 172b08b1e..bbf8f915e 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -634,34 +634,35 @@ sub render_dependent ($$$$$$$) { if ($type == $IkiWiki::DEPEND_LINKS) { next unless $linkchangers->{lc($page)}; } - return $page; + $reason=$page; + return 1; } } return undef; }; if ($depends{$p}{$dep} & $IkiWiki::DEPEND_CONTENT) { - last if $reason = - $in->(\@changed, $IkiWiki::DEPEND_CONTENT); - last if $internal_dep && ($reason = + last if $in->(\@changed, $IkiWiki::DEPEND_CONTENT); + last if $internal_dep && ( $in->($internal_new, $IkiWiki::DEPEND_CONTENT) || $in->($internal_del, $IkiWiki::DEPEND_CONTENT) || - $in->($internal_changed, $IkiWiki::DEPEND_CONTENT)); + $in->($internal_changed, $IkiWiki::DEPEND_CONTENT) + ); } if ($depends{$p}{$dep} & $IkiWiki::DEPEND_PRESENCE) { - last if $reason = - $in->(\@exists_changed, $IkiWiki::DEPEND_PRESENCE); - last if $internal_dep && ($reason = + last if $in->(\@exists_changed, $IkiWiki::DEPEND_PRESENCE); + last if $internal_dep && ( $in->($internal_new, $IkiWiki::DEPEND_PRESENCE) || - $in->($internal_del, $IkiWiki::DEPEND_PRESENCE)); + $in->($internal_del, $IkiWiki::DEPEND_PRESENCE) + ); } if ($depends{$p}{$dep} & $IkiWiki::DEPEND_LINKS) { - last if $reason = - $in->(\@changed, $IkiWiki::DEPEND_LINKS); - last if $internal_dep && ($reason = + last if $in->(\@changed, $IkiWiki::DEPEND_LINKS); + last if $internal_dep && ( $in->($internal_new, $IkiWiki::DEPEND_LINKS) || $in->($internal_del, $IkiWiki::DEPEND_LINKS) || - $in->($internal_changed, $IkiWiki::DEPEND_LINKS)); + $in->($internal_changed, $IkiWiki::DEPEND_LINKS) + ); } } } -- cgit v1.2.3 From 7a92c0aa4aea1bffc9090d982c4b55af9e0b0c02 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 13:49:46 -0400 Subject: clarify why absolute is tested & stripped here file_prune also fails on absolute filenames now --- IkiWiki/Plugin/editpage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index ee1de8eaa..dff777138 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -92,7 +92,7 @@ sub cgi_editpage ($$) { # wiki_file_regexp. my ($page)=$form->field('page')=~/$config{wiki_file_regexp}/; $page=possibly_foolish_untaint($page); - my $absolute=($page =~ s#^/+##); + my $absolute=($page =~ s#^/+##); # absolute name used for force location if (! defined $page || ! length $page || file_pruned($page)) { error(gettext("bad page name")); -- cgit v1.2.3 From 5d3f7877299942cbec4fde6054761635d90a089a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 13:54:24 -0400 Subject: use one parameter form of file_pruned here too In File::Find, $_ is relative to the current directory, so that is ok. Also, the directory name doesn't need to be stripped from $_. --- IkiWiki/Plugin/comments.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 1c219b6c6..32e4d0937 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -645,7 +645,7 @@ sub comments_pending () { no_chdir => 1, wanted => sub { $_=decode_utf8($_); - if (IkiWiki::file_pruned($_, $dir)) { + if (IkiWiki::file_pruned($_)) { $File::Find::prune=1; } elsif (! -l $_ && ! -d _) { @@ -653,7 +653,6 @@ sub comments_pending () { my ($f)=/$config{wiki_file_regexp}/; # untaint if (defined $f && $f =~ /\Q._comment\E$/) { my $ctime=(stat($f))[10]; - $f=~s/^\Q$dir\E\/?//; push @ret, [$f, $ctime]; } } -- cgit v1.2.3 From 230a8b22a471c018c8ec48cd07427c42238a4970 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 13:59:17 -0400 Subject: remove explicit absolute test file_pruned now tests for that --- IkiWiki/Plugin/editpage.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index dff777138..2130a8402 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -221,7 +221,6 @@ sub cgi_editpage ($$) { if (! defined $from || ! length $from || $from ne $form->field('from') || file_pruned($from) || - $from=~/^\// || $absolute || $form->submitted) { @page_locs=$best_loc=$page; -- cgit v1.2.3 From 6d063a6698ad72476d9243956b0f13ec33a09dbd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 14:06:00 -0400 Subject: switch to 1 parameter version of file_pruned Another bit of code that didn't realize that File::Find sets $_ to the relative filename. --- IkiWiki/Plugin/autoindex.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index c71d73349..1d0612e84 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -40,14 +40,12 @@ sub refresh () { no_chdir => 1, wanted => sub { $_=decode_utf8($_); - if (IkiWiki::file_pruned($_, $dir)) { + if (IkiWiki::file_pruned($_)) { $File::Find::prune=1; } elsif (! -l $_) { my ($f)=/$config{wiki_file_regexp}/; # untaint return unless defined $f; - $f=~s/^\Q$dir\E\/?//; - return unless length $f; return if $f =~ /\._([^.]+)$/; # skip internal page if (! -d _) { $pages{pagename($f)}=1; -- cgit v1.2.3 From 1f56dead00ee1188d9ed9650b9b2483b69c4d525 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 14:13:46 -0400 Subject: oops, fix for no_chdir mode $_ will be absolute then --- IkiWiki/Plugin/autoindex.pm | 6 ++++-- IkiWiki/Plugin/comments.pm | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 1d0612e84..23a17d4e9 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -39,12 +39,14 @@ sub refresh () { find({ no_chdir => 1, wanted => sub { - $_=decode_utf8($_); + my $file=decode_utf8($_); + $file=~s/^\Q$dir\E\/?//; + return unless length $file; if (IkiWiki::file_pruned($_)) { $File::Find::prune=1; } elsif (! -l $_) { - my ($f)=/$config{wiki_file_regexp}/; # untaint + my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint return unless defined $f; return if $f =~ /\._([^.]+)$/; # skip internal page if (! -d _) { diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 32e4d0937..03ca19c98 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -644,13 +644,14 @@ sub comments_pending () { find({ no_chdir => 1, wanted => sub { - $_=decode_utf8($_); + my $file=decode_utf8($_); + $file=~s/^\Q$dir\E\/?//; + return unless length $file; if (IkiWiki::file_pruned($_)) { $File::Find::prune=1; } elsif (! -l $_ && ! -d _) { - $File::Find::prune=0; - my ($f)=/$config{wiki_file_regexp}/; # untaint + my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint if (defined $f && $f =~ /\Q._comment\E$/) { my $ctime=(stat($f))[10]; push @ret, [$f, $ctime]; -- cgit v1.2.3 From 59bb1f1db37d8b8170e5dd8e5a857df7742bffb9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 14:23:48 -0400 Subject: fix stat to use unmunged filename --- IkiWiki/Plugin/comments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 03ca19c98..ccc9e1068 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -653,7 +653,7 @@ sub comments_pending () { elsif (! -l $_ && ! -d _) { my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint if (defined $f && $f =~ /\Q._comment\E$/) { - my $ctime=(stat($f))[10]; + my $ctime=(stat($_))[10]; push @ret, [$f, $ctime]; } } -- cgit v1.2.3 From 81eae1a531ab6e538985a8531b39ef3c5f865bdc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 14:25:17 -0400 Subject: typo --- IkiWiki/Plugin/editpage.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 2130a8402..26e38abc1 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -92,7 +92,7 @@ sub cgi_editpage ($$) { # wiki_file_regexp. my ($page)=$form->field('page')=~/$config{wiki_file_regexp}/; $page=possibly_foolish_untaint($page); - my $absolute=($page =~ s#^/+##); # absolute name used for force location + my $absolute=($page =~ s#^/+##); # absolute name used to force location if (! defined $page || ! length $page || file_pruned($page)) { error(gettext("bad page name")); -- cgit v1.2.3 From 93cf1db7b9655a64aec6ab17b7192e5e7429f12e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 17:21:50 -0400 Subject: fix uninitialized value warning $cgi->params('do') may not be defined. The CSRF code may delete all cgi params. This uninitalized value was introduced when do=register support was added recently. --- IkiWiki/Plugin/passwordauth.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 4848b47bb..baddca093 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -105,11 +105,13 @@ sub formbuilder_setup (@) { my $session=$params{session}; my $cgi=$params{cgi}; - if ($form->title eq "signin" || $form->title eq "register" || $cgi->param("do") eq "register") { + my $do_register=defined $cgi->param("do") && $cgi->param("do") eq "register"; + + if ($form->title eq "signin" || $form->title eq "register" || $do_register) { $form->field(name => "name", required => 0); $form->field(name => "password", type => "password", required => 0); - if ($form->submitted eq "Register" || $form->submitted eq "Create Account" || $cgi->param("do") eq "register") { + if ($form->submitted eq "Register" || $form->submitted eq "Create Account" || $do_register) { $form->field(name => "confirm_password", type => "password"); $form->field(name => "account_creation_password", type => "password") if (defined $config{account_creation_password} && @@ -247,8 +249,10 @@ sub formbuilder (@) { my $cgi=$params{cgi}; my $buttons=$params{buttons}; + my $do_register=defined $cgi->param("do") && $cgi->param("do") eq "register"; + if ($form->title eq "signin" || $form->title eq "register") { - if (($form->submitted && $form->validate) || $cgi->param("do") eq "register") { + if (($form->submitted && $form->validate) || $do_register) { if ($form->submitted eq 'Login') { $session->param("name", $form->field("name")); IkiWiki::cgi_postsignin($cgi, $session); @@ -311,7 +315,7 @@ sub formbuilder (@) { $form->field(name => "name", required => 0); push @$buttons, "Reset Password"; } - elsif ($form->submitted eq "Register" || $cgi->param("do") eq "register") { + elsif ($form->submitted eq "Register" || $do_register) { @$buttons="Create Account"; } } -- cgit v1.2.3 From bfca8345ea7d49df6a4f6521f1db416d28671f35 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 17:42:36 -0400 Subject: bugfix Avoid file_pruned triggering on absolute paths causing the whole comments_pending directory being pruned. Simplify code. --- IkiWiki/Plugin/comments.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ccc9e1068..58bd4b851 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -646,16 +646,12 @@ sub comments_pending () { wanted => sub { my $file=decode_utf8($_); $file=~s/^\Q$dir\E\/?//; - return unless length $file; - if (IkiWiki::file_pruned($_)) { - $File::Find::prune=1; - } - elsif (! -l $_ && ! -d _) { - my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint - if (defined $f && $f =~ /\Q._comment\E$/) { - my $ctime=(stat($_))[10]; - push @ret, [$f, $ctime]; - } + return if ! length $file || IkiWiki::file_pruned($file) + || -l $_ || -d _ || $file !~ /\Q._comment\E$/; + my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint + if (defined $f) { + my $ctime=(stat($_))[10]; + push @ret, [$f, $ctime]; } } }, $dir); -- cgit v1.2.3 From d578f3ff78190f816c74f6935e1e0024b25dc090 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 17:49:00 -0400 Subject: darcs: ensure whole darcs query manifest output is consumed By a stroke of luck, after a long & full day, I happened to remember that in the morning, I had seen someone on irc mention that darcs query manifest doesn't like it if its full output is not consumed. So contrary to the usual case where bug reports sent via irc are like messages written in sand before the new tide, this one was seen and fixed. (But use http://ikiwiki.info/bugs/ next time!) --- IkiWiki/Plugin/darcs.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index c1d6661d3..f17fadcb1 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -63,7 +63,7 @@ sub file_in_vc ($$) { } my $found=0; while () { - $found = 1, last if /^(\.\/)?$file$/; + $found = 1 if /^(\.\/)?$file$/; } close(DARCS_MANIFEST) or error("'darcs query manifest' exited " . $?); -- cgit v1.2.3 From 511f7f9cb94ebdd8ea33973a0ca74d2f8249aa3f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 18:16:40 -0400 Subject: bugfix So this is the one place that does need to canonpath and compare, as two argument file_pruned used to. --- IkiWiki/Plugin/autoindex.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 23a17d4e9..0dd76259e 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -36,13 +36,17 @@ sub refresh () { my (%pages, %dirs); foreach my $dir ($config{srcdir}, @{$config{underlaydirs}}, $config{underlaydir}) { + require File::Spec; + $dir=File::Spec->canonpath($dir); + find({ no_chdir => 1, wanted => sub { - my $file=decode_utf8($_); + my $file=File::Spec->canonpath(decode_utf8($_)); + return if $file eq $dir; $file=~s/^\Q$dir\E\/?//; return unless length $file; - if (IkiWiki::file_pruned($_)) { + if (IkiWiki::file_pruned($file)) { $File::Find::prune=1; } elsif (! -l $_) { -- cgit v1.2.3 From 034b4e826627dddf47ff27278897804e39741e57 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 15:05:59 -0400 Subject: remove verify_src_file Splitting out this function bothered me. It is conceptially similar to file_pruned, and yet also very specific to exactly the security needs of find_src_files. I liked that it got rid of duplicate code in the latter function. So instead, put a helper sub in that, which I think allows refactoring things more cleanly, and with less boilerplate. As to the needs of gen_autofile, I'm not convinced this needs to handle the same set of problems that verify_src_file did. So I sat down and wrote a custom validator for autofiles, which turned out to seem to just need three things: Make sure the candidate filename is not something that would be pruned; untaint the candidate filename; and make sure that srcdir doesn't already have something with its name. (Plus, of course, all the other checks that were already in gen_autofile.) (In passing, also fixed a bunch of bugs I had introduced in this branch.) --- IkiWiki/Render.pm | 115 ++++++++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 60 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 03b2910fd..14f6f9d5f 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -281,68 +281,59 @@ sub srcdir_check () { } -sub verify_src_file ($$) { - my $file=shift; - my $dir=shift; - - return if -l $file || -d _; - $file=~s/^\Q$dir\E\/?//; - return if ! length $file; - my $page = pagename($file); - if (! exists $pagesources{$page} && - file_pruned($file)) { - return; - } - - my ($file_untainted) = $file =~ /$config{wiki_file_regexp}/; # untaint - if (! defined $file_untainted) { - warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); - } - return ($file_untainted, $page); -} - sub find_src_files () { my @files; my %pages; eval q{use File::Find}; error($@) if $@; - find({ - no_chdir => 1, - wanted => sub { - my ($file, $page) = verify_src_file(decode_utf8($_), $config{srcdir}); - if (defined $file) { - push @files, $file; - if ($pages{$page}) { - debug(sprintf(gettext("%s has multiple possible source pages"), $page)); + + my ($page, $dir, $underlay); + my $helper=sub { + my $file=decode_utf8($_); + + return if -l $file || -d _; + $file=~s/^\Q$dir\E\/?//; + return if ! length $file; + $page = pagename($file); + if (! exists $pagesources{$page} && + file_pruned($file)) { + $File::Find::prune=1; + return; + } + + my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint + if (! defined $f) { + warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); + } + + if ($underlay) { + # avoid underlaydir override attacks; see security.mdwn + if (! -l "$config{srcdir}/$f" && ! -e _) { + if (! $pages{$page}) { + push @files, $f; + $pages{$page}=1; } - $pages{$page}=1; } - else { - $File::Find::prune=1; + } + else { + push @files, $f; + if ($pages{$page}) { + debug(sprintf(gettext("%s has multiple possible source pages"), $page)); } - }, - }, $config{srcdir}); - foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) { + $pages{$page}=1; + } + }; + + find({ + no_chdir => 1, + wanted => $helper, + }, $dir=$config{srcdir}); + $underlay=1; + foreach (@{$config{underlaydirs}}, $config{underlaydir}) { find({ no_chdir => 1, - wanted => sub { - my ($file, $page) = verify_src_file(decode_utf8($_), $dir); - if (defined $file) { - # avoid underlaydir override - # attacks; see security.mdwn - if (! -l "$config{srcdir}/$file" && - ! -e _) { - if (! $pages{$page}) { - push @files, $file; - $pages{$page}=1; - } - } - } - else { - $File::Find::prune=1; - } - }, - }, $dir); + wanted => $helper, + }, $dir=$_); }; return \@files, \%pages; } @@ -691,24 +682,28 @@ sub gen_autofile ($$$) { my $pages=shift; my $del=shift; - if (srcfile($autofile, 1)) { - return 0; + if (srcfile($autofile, 1) || file_pruned($autofile)) { + return; } - - my ($file, $page) = verify_src_file("$config{srcdir}/$autofile", $config{srcdir}); + my $file="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint + if (! defined $file || -l $file || -d _ || -e _) { + return; + } + if ((!defined $file) || (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile_deleted})) { - return 0; + return; } + my $page = pagename($file); if ($pages->{$page}) { - return 0; + return; } if (grep { $_ eq $file } @$del) { - $wikistate{$autofiles{$autofile}{generator}}{autofile_deleted}=1; - return 0; + $wikistate{$autofiles{$autofile}{plugin}}{autofile_deleted}=1; + return; } $autofiles{$autofile}{generator}->(); -- cgit v1.2.3 From 2a0e3787a056b160843eca263c82d591c7161988 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 15:54:18 -0400 Subject: bugfixes --- IkiWiki/Render.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 14f6f9d5f..09c9121f3 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -681,18 +681,18 @@ sub gen_autofile ($$$) { my $autofile=shift; my $pages=shift; my $del=shift; - + if (srcfile($autofile, 1) || file_pruned($autofile)) { return; } - my $file="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint + my ($file)="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint if (! defined $file || -l $file || -d _ || -e _) { return; } if ((!defined $file) || - (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile_deleted})) { + (exists $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile})) { return; } @@ -701,8 +701,8 @@ sub gen_autofile ($$$) { return; } - if (grep { $_ eq $file } @$del) { - $wikistate{$autofiles{$autofile}{plugin}}{autofile_deleted}=1; + if (grep { $_ eq $autofile } @$del) { + $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile}=1; return; } -- cgit v1.2.3 From a71b92ed5c5572a1384367f8a90e1fc489b3c660 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 15:59:39 -0400 Subject: remember autofiles always This fixes the problem that it did not remember if an autofile is deleted, unless a plugin happened to register the autofile at the same time. With the new code, we just never recreate an autofile more than once. Only downside is that the list of autofiles is never pruned either. And I don't really see a way to prune it. --- IkiWiki/Render.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 09c9121f3..b3afabf32 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -692,7 +692,7 @@ sub gen_autofile ($$$) { } if ((!defined $file) || - (exists $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile})) { + (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile})) { return; } @@ -702,11 +702,11 @@ sub gen_autofile ($$$) { } if (grep { $_ eq $autofile } @$del) { - $wikistate{$autofiles{$autofile}{plugin}}{deleted_autofile}{$autofile}=1; return; } $autofiles{$autofile}{generator}->(); + $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1; $pages->{$page}=1; return 1; } -- cgit v1.2.3 From fd6fb4c5071d9317b4388a0db6b97037cc010477 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 16:13:37 -0400 Subject: commit autocreated tag pages --- IkiWiki/Plugin/tag.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index d2a3d4dfd..c98dd80b2 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -79,11 +79,18 @@ sub gentag ($) { my $tagfile = newpagefile($tagpage, $config{default_pageext}); add_autofile($tagfile, "tag", sub { - debug(sprintf(gettext("creating tag page %s"), $tag)); + my $message=sprintf(gettext("creating tag page %s"), $tag); + debug($message); my $template=template("autotag.tmpl"); $template->param(tag => $tag); writefile($tagfile, $config{srcdir}, $template->output); + if ($config{rcs}) { + IkiWiki::disable_commit_hook(); + IkiWiki::rcs_add($tagfile); + IkiWiki::rcs_commit_staged($message, undef, undef); + IkiWiki::enable_commit_hook(); + } }); } } -- cgit v1.2.3 From 167964b68661de57983993efd7261a75da661665 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 16:41:36 -0400 Subject: remember autofiles that were tried and failed to be added This way, if an autofile is registered for a file that already exists, it is remembered that it was tried, and it doesn't get recreated when removed. --- IkiWiki/Render.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index b3afabf32..c3e07baf6 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -682,20 +682,29 @@ sub gen_autofile ($$$) { my $pages=shift; my $del=shift; - if (srcfile($autofile, 1) || file_pruned($autofile)) { + if (file_pruned($autofile)) { return; } - + my ($file)="$config{srcdir}/$autofile" =~ /$config{wiki_file_regexp}/; # untaint - if (! defined $file || -l $file || -d _ || -e _) { + if (! defined $file) { + return; + } + + # Remember autofiles that were tried, and never try them again later. + if (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}) { return; } + $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1; - if ((!defined $file) || - (exists $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile})) { + if (srcfile($autofile, 1) || file_pruned($autofile)) { return; } + if (-l $file || -d _ || -e _) { + return; + } + my $page = pagename($file); if ($pages->{$page}) { return; @@ -706,7 +715,6 @@ sub gen_autofile ($$$) { } $autofiles{$autofile}{generator}->(); - $wikistate{$autofiles{$autofile}{plugin}}{autofile}{$autofile}=1; $pages->{$page}=1; return 1; } -- cgit v1.2.3 From 8cde2365e43f1c96432dcedb378be55d2308dd08 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 19:09:59 -0400 Subject: add separate template variable for tag page and sanitize displayed tag name --- IkiWiki/Plugin/tag.pm | 3 ++- templates/autotag.tmpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index c98dd80b2..6a6517671 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -83,7 +83,8 @@ sub gentag ($) { debug($message); my $template=template("autotag.tmpl"); - $template->param(tag => $tag); + $template->param(tag => IkiWiki::basename($tag)); + $template->param(tagpage => $tagpage); writefile($tagfile, $config{srcdir}, $template->output); if ($config{rcs}) { IkiWiki::disable_commit_hook(); diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl index a8824171b..7b0d4c90f 100644 --- a/templates/autotag.tmpl +++ b/templates/autotag.tmpl @@ -1,3 +1,3 @@ -## Pages tagged ## +## Pages tagged ## [[!inline pages="tagged()" actions="no" archive="yes"]] -- cgit v1.2.3 From 1a09cddd39d4e15c442973dc256bf91b3c27997c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 19:42:00 -0400 Subject: fix false positive in link_types_changed loadindex does not bother populating oldtypedlinks if there is no link type. However, the code in link_types_changed assumed that if oldtypedlinks is not defined, and typedlinks is, they must differ. --- IkiWiki/Render.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index bbf8f915e..0e5336f22 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -526,7 +526,7 @@ sub link_types_changed ($$) { my $old = shift; return 0 if !defined $new && !defined $old; - return 1 if !defined $new || !defined $old; + return 1 if (!defined $new && %$old) || (!defined $old && %$new); while (my ($type, $links) = each %$new) { foreach my $link (keys %$links) { -- cgit v1.2.3 From 77779dc4a09a9b686935e8e615cf2502f7125bb4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 19:46:27 -0400 Subject: pass pagespec parameters along from match_tagged --- IkiWiki/Plugin/tag.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 7a85874f6..62e0cc3b8 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -125,7 +125,9 @@ sub pagetemplate (@) { package IkiWiki::PageSpec; sub match_tagged ($$;@) { - return match_link($_[0], IkiWiki::Plugin::tag::tagpage($_[1]), linktype => 'tag'); + my $page=shift; + my $glob=shift; + return match_link($page, IkiWiki::Plugin::tag::tagpage($glob), linktype => 'tag', @_); } 1 -- cgit v1.2.3 From 0e2b5ebe314c617ae4139b5daad314e01208d37b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 19:49:11 -0400 Subject: clarify --- IkiWiki/Plugin/tag.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 72ae682f3..dd7583ab2 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -170,8 +170,8 @@ package IkiWiki::PageSpec; sub match_tagged ($$;@) { my $page=shift; - my $glob=shift; - return match_link($page, IkiWiki::Plugin::tag::taglink($glob), linktype => 'tag', @_); + my $glob=IkiWiki::Plugin::tag::taglink(shift); + return match_link($page, $glob, linktype => 'tag', @_); } 1 -- cgit v1.2.3 From 752ccf8b48bab173839b5c7892e9868ee71846f0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 20:08:23 -0400 Subject: fixes --- IkiWiki/Plugin/tag.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index dd7583ab2..a7f37a512 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -79,12 +79,12 @@ sub gentag ($) { my $tagfile = newpagefile($tagpage, $config{default_pageext}); add_autofile($tagfile, "tag", sub { - my $message=sprintf(gettext("creating tag page %s"), $tag); + my $message=sprintf(gettext("creating tag page %s"), $tagpage); debug($message); my $template=template("autotag.tmpl"); - $template->param(tag => IkiWiki::basename($tag)); - $template->param(tagpage => $tagpage); + $template->param(tagname => IkiWiki::basename($tag)); + $template->param(tag => $tag); writefile($tagfile, $config{srcdir}, $template->output); if ($config{rcs}) { IkiWiki::disable_commit_hook(); -- cgit v1.2.3 From 129cd00bdb03e32df8645b12138cb4c79952775e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 20:15:11 -0400 Subject: remove broken ./tag support The commit that added the (working) support for using /tag to override tagbase also tried to make ./tag work. Problem is, tags are links, and ./foo is not a valid link (though I think there's a wishlist about it). So, using ./tag really resulted in tag creation links that led to a "bad page name" error. And even if the tag were created in the right place, the link didn't go to it. --- IkiWiki/Plugin/tag.pm | 2 +- doc/ikiwiki/directive/tag.mdwn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 62e0cc3b8..8ec08e936 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -39,7 +39,7 @@ sub getsetup () { sub tagpage ($) { my $tag=shift; - if ($tag !~ m{^\.?/} && + if ($tag !~ m{^/} && defined $config{tagbase}) { $tag="/".$config{tagbase}."/".$tag; $tag=~y#/#/#s; # squash dups diff --git a/doc/ikiwiki/directive/tag.mdwn b/doc/ikiwiki/directive/tag.mdwn index 64736f8cd..807a96f25 100644 --- a/doc/ikiwiki/directive/tag.mdwn +++ b/doc/ikiwiki/directive/tag.mdwn @@ -28,7 +28,7 @@ into the `link()` [[ikiwiki/PageSpec]] you use: e.g., if your tagbase is If you want to override the tagbase for a particular tag, you can use something like this: - \[[!tag ./foo]] + \[[!tag /foo]] \[[!taglink /foo]] [[!meta robots="noindex, follow"]] -- 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 'IkiWiki') 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 bc6d6026093ae6f2bfd72a2c06887358a0e59b6b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Apr 2010 00:10:13 -0400 Subject: add influence info for failed metadata matches This is needed so that when a negated pagespec like "!author(foo)" stops matching, due to the page being changed, ikiwiki knows that the match was influenced by the page content. --- IkiWiki/Plugin/meta.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 128a6342c..159008614 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -346,11 +346,11 @@ sub match { 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", "" => 1); + return IkiWiki::FailReason->new("$re does not match $field of $page", $page => $IkiWiki::DEPEND_CONTENT, "" => 1); } } else { - return IkiWiki::FailReason->new("$page does not have a $field", "" => 1); + return IkiWiki::FailReason->new("$page does not have a $field", $page => $IkiWiki::DEPEND_CONTENT); } } -- 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 'IkiWiki') 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 'IkiWiki') 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 011d88052d6dacb6a9d84b1489d37eefeb992da1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 14:00:53 -0400 Subject: fix logic --- IkiWiki/Plugin/inline.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 043649742..2d47cb4be 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -333,8 +333,8 @@ sub preprocess_inline (@) { $template=template_depends($params{template}.".tmpl", $params{page}, blind_cache => 1); }; - if (! $@ || ! $template) { - error sprintf(gettext("nonexistant template %s"), $params{template}); + if ($@ || ! $template) { + error sprintf(gettext("nonexistant template %s.tmpl"), $params{template}); } } my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content')); -- cgit v1.2.3 From d4d7d5ddaf9264d7bc46b83ff87eb919b876568c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 14:45:02 -0400 Subject: use same error string as template.pm does --- IkiWiki/Plugin/inline.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 2d47cb4be..5d99c9da2 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -334,7 +334,7 @@ sub preprocess_inline (@) { blind_cache => 1); }; if ($@ || ! $template) { - error sprintf(gettext("nonexistant template %s.tmpl"), $params{template}); + error sprintf(gettext("template %s not found"), $params{template}.".tmpl"); } } my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content')); -- cgit v1.2.3 From 753bfb17a0b593137341fe61c1a7db5dccd00efa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 14:45:48 -0400 Subject: switch to using template_depends It now handles all the details of finding a page template that this used to need to implement. --- IkiWiki/Plugin/template.pm | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index 98a13b5fa..fc8292010 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -5,7 +5,6 @@ package IkiWiki::Plugin::template; use warnings; use strict; use IkiWiki 3.00; -use HTML::Template; use Encode; sub import { @@ -34,36 +33,20 @@ sub preprocess (@) { error gettext("missing id parameter") } - my $template_page="templates/$params{id}"; - add_depends($params{page}, $template_page); - - my $template_file; - if (exists $pagesources{$template_page}) { - $template_file=srcfile($pagesources{$template_page}); - } - else { - $template_file=IkiWiki::template_file("$params{id}.tmpl") - } - return sprintf(gettext("template %s not found"), - htmllink($params{page}, $params{destpage}, "/".$template_page)) - unless defined $template_file; - + # The bare id is used, so a page templates/$id will be used as + # the template. my $template; eval { - $template=HTML::Template->new( - filter => sub { - my $text_ref = shift; - $$text_ref=&Encode::decode_utf8($$text_ref); - chomp $$text_ref; - }, - filename => $template_file, - die_on_bad_params => 0, - no_includes => 1, - blind_cache => 1, - ); + $template=template_depends($params{id}, $params{page}, + blind_cache => 1); }; if ($@) { - error gettext("failed to process:")." $@" + error gettext("failed to process:")." $@"; + } + if (! $template) { + error sprintf(gettext("%s not found"), + htmllink($params{page}, $params{destpage}, + "/templates/$params{id}")) } $params{basename}=IkiWiki::basename($params{page}); -- cgit v1.2.3 From ee8d237f98b2c82b441dc7c26f6ce8545362cb73 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 14:50:00 -0400 Subject: improved error message --- IkiWiki/Plugin/inline.pm | 7 ++++++- IkiWiki/Plugin/template.pm | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 5d99c9da2..95fe90312 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -329,11 +329,16 @@ sub preprocess_inline (@) { if (! $feedonly) { my $template; if (! $raw) { + # cannot use wiki pages as templates; template not sanitized due to + # format hook hack eval { $template=template_depends($params{template}.".tmpl", $params{page}, blind_cache => 1); }; - if ($@ || ! $template) { + if ($@) { + error gettext("failed to process template:")." $@"; + } + if (! $template) { error sprintf(gettext("template %s not found"), $params{template}.".tmpl"); } } diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index fc8292010..e5a0c05c3 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -41,7 +41,7 @@ sub preprocess (@) { blind_cache => 1); }; if ($@) { - error gettext("failed to process:")." $@"; + error gettext("failed to process template:")." $@"; } if (! $template) { error sprintf(gettext("%s not found"), -- cgit v1.2.3 From d1cc7e81c84e57c32b6560f82065caf6535c0692 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 15:11:25 -0400 Subject: use template() rather than rolling it by hand --- IkiWiki/Plugin/edittemplate.pm | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 5f0551d92..d65072010 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -114,28 +114,18 @@ sub filltemplate ($$) { my $template_page=shift; my $page=shift; - my $template_file=$pagesources{$template_page}; - if (! defined $template_file) { - return; - } - my $template; eval { - $template=HTML::Template->new( - filter => sub { - my $text_ref = shift; - $$text_ref=&Encode::decode_utf8($$text_ref); - chomp $$text_ref; - }, - filename => srcfile($template_file), - die_on_bad_params => 0, - no_includes => 1, - ); + # force page name absolute so it doesn't look in templates/ + $template=template("/".$template_page); }; if ($@) { # Indicate that the earlier preprocessor directive set # up a template that doesn't work. - return "[[!pagetemplate ".gettext("failed to process")." $@]]"; + return "[[!pagetemplate ".gettext("failed to process template:")." $@]]"; + } + if (! defined $template) { + return; } $template->param(name => $page); -- cgit v1.2.3 From 0e68f76a9ab76bc6d0f0d45617517220afc146ff Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 15:23:34 -0400 Subject: update --- IkiWiki/Plugin/template.pm | 2 +- template-transition-notes | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index e5a0c05c3..d2b2fef55 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -33,7 +33,7 @@ sub preprocess (@) { error gettext("missing id parameter") } - # The bare id is used, so a page templates/$id will be used as + # The bare id is used, so a page templates/$id can be used as # the template. my $template; eval { diff --git a/template-transition-notes b/template-transition-notes index ccff3e78f..a319616f4 100644 --- a/template-transition-notes +++ b/template-transition-notes @@ -1,6 +1,4 @@ * add_templates option removed from underlay plugin (can use add_underlays instead) * 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 6486452e4c94f5699d98d13e25a361435ed3ddeb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 16:41:07 -0400 Subject: special case for page.tmpl dependency handling Rather than wasting resources recording that every page depends on page.tmpl, add a special case. The special case curretly rebuilds non-page files too when page.tmpl changes, but that's minor. --- IkiWiki/Render.pm | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7cf19645e..8ae0cbd4f 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -74,9 +74,16 @@ sub genpage ($$) { $templatefile=$file; } }); - my $template=template_depends( - defined $templatefile ? $templatefile : 'page.tmpl', $page, - blind_cache => 1); + my $template; + if (defined $templatefile) { + $template=template_depends($templatefile, $page, + blind_cache => 1); + } + else { + # no explicit depends as special case + $template=template('page.tmpl', + blind_cache => 1); + } my $actions=0; if (length $config{cgiurl}) { @@ -763,8 +770,14 @@ sub refresh () { foreach my $file (@$new, @$del) { render_linkers($file); } - - if (@$changed || @$internal_changed || + + if ($rendered{"templates/page.tmpl"}) { + foreach my $f (@$files) { + next if $f eq "templates/page.tmpl"; + render($f, sprintf(gettext("building %s, which depends on %s"), $f, "templates/page.tmpl")); + } + } + elsif (@$changed || @$internal_changed || @$del || @$internal_del || @$internal_new) { 1 while render_dependent($files, $new, $internal_new, $del, $internal_del, $internal_changed, -- cgit v1.2.3 From e90d67d3c9a93862657563e17e24054087f205d1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 00:54:59 -0400 Subject: Moved javascript files under the ikiwiki/ directory, to avoid cluttering the top of the web root. This is another things that requires a wiki rebuild on upgrade to this version. --- IkiWiki/Plugin/relativedate.pm | 4 +- IkiWiki/Plugin/toggle.pm | 4 +- debian/changelog | 5 +- debian/postinst | 2 +- underlays/javascript/ikiwiki.js | 54 -------------------- underlays/javascript/ikiwiki/ikiwiki.js | 54 ++++++++++++++++++++ underlays/javascript/ikiwiki/relativedate.js | 76 ++++++++++++++++++++++++++++ underlays/javascript/ikiwiki/toggle.js | 29 +++++++++++ underlays/javascript/relativedate.js | 76 ---------------------------- underlays/javascript/toggle.js | 29 ----------- 10 files changed, 168 insertions(+), 165 deletions(-) delete mode 100644 underlays/javascript/ikiwiki.js create mode 100644 underlays/javascript/ikiwiki/ikiwiki.js create mode 100644 underlays/javascript/ikiwiki/relativedate.js create mode 100644 underlays/javascript/ikiwiki/toggle.js delete mode 100644 underlays/javascript/relativedate.js delete mode 100644 underlays/javascript/toggle.js (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 7f006af83..7e615f7f1 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -37,9 +37,9 @@ sub include_javascript ($;$) { my $page=shift; my $absolute=shift; - return ''."\n". - ''; } diff --git a/IkiWiki/Plugin/toggle.pm b/IkiWiki/Plugin/toggle.pm index f9c899540..3319421d9 100644 --- a/IkiWiki/Plugin/toggle.pm +++ b/IkiWiki/Plugin/toggle.pm @@ -81,9 +81,9 @@ sub include_javascript ($;$) { my $page=shift; my $absolute=shift; - return ''."\n". - ''; } diff --git a/debian/changelog b/debian/changelog index 0ab04f522..f9d012e42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100422) UNRELEASED; urgency=low +ikiwiki (3.20100424) UNRELEASED; urgency=low [ Joey Hess ] * tag: Automatic creation of tag pages can now be enabled using @@ -66,6 +66,9 @@ ikiwiki (3.20100422) UNRELEASED; urgency=low (Jelmer Vernooij) * Quite a lot of new optimisations, and one major fix to a recent performance regression. + * Moved javascript files under the ikiwiki/ directory, to avoid cluttering + the top of the web root. This is another things that requires a wiki + rebuild on upgrade to this version. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/debian/postinst b/debian/postinst index 810b7cfe0..76ad115ac 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e # Change this when some incompatible change is made that requires # rebuilding all wikis. -firstcompat=3.20100422 +firstcompat=3.20100424 if [ "$1" = configure ] && \ dpkg --compare-versions "$2" lt "$firstcompat"; then diff --git a/underlays/javascript/ikiwiki.js b/underlays/javascript/ikiwiki.js deleted file mode 100644 index aebc5cf7e..000000000 --- a/underlays/javascript/ikiwiki.js +++ /dev/null @@ -1,54 +0,0 @@ -// ikiwiki's javascript utility function library - -var hooks; - -// Run onload as soon as the DOM is ready, if possible. -// gecko, opera 9 -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", run_hooks_onload, false); -} -// other browsers -window.onload = run_hooks_onload; - -var onload_done = 0; - -function run_hooks_onload() { - // avoid firing twice - if (onload_done) - return; - onload_done = true; - - run_hooks("onload"); -} - -function run_hooks(name) { - if (typeof(hooks) != "undefined") { - for (var i = 0; i < hooks.length; i++) { - if (hooks[i].name == name) { - hooks[i].call(); - } - } - } -} - -function hook(name, call) { - if (typeof(hooks) == "undefined") - hooks = new Array; - hooks.push({name: name, call: call}); -} - -function getElementsByClass(cls, node, tag) { - if (document.getElementsByClass) - return document.getElementsByClass(cls, node, tag); - if (! node) node = document; - if (! tag) tag = '*'; - var ret = new Array(); - var pattern = new RegExp("(^|\\s)"+cls+"(\\s|$)"); - var els = node.getElementsByTagName(tag); - for (i = 0; i < els.length; i++) { - if ( pattern.test(els[i].className) ) { - ret.push(els[i]); - } - } - return ret; -} diff --git a/underlays/javascript/ikiwiki/ikiwiki.js b/underlays/javascript/ikiwiki/ikiwiki.js new file mode 100644 index 000000000..aebc5cf7e --- /dev/null +++ b/underlays/javascript/ikiwiki/ikiwiki.js @@ -0,0 +1,54 @@ +// ikiwiki's javascript utility function library + +var hooks; + +// Run onload as soon as the DOM is ready, if possible. +// gecko, opera 9 +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", run_hooks_onload, false); +} +// other browsers +window.onload = run_hooks_onload; + +var onload_done = 0; + +function run_hooks_onload() { + // avoid firing twice + if (onload_done) + return; + onload_done = true; + + run_hooks("onload"); +} + +function run_hooks(name) { + if (typeof(hooks) != "undefined") { + for (var i = 0; i < hooks.length; i++) { + if (hooks[i].name == name) { + hooks[i].call(); + } + } + } +} + +function hook(name, call) { + if (typeof(hooks) == "undefined") + hooks = new Array; + hooks.push({name: name, call: call}); +} + +function getElementsByClass(cls, node, tag) { + if (document.getElementsByClass) + return document.getElementsByClass(cls, node, tag); + if (! node) node = document; + if (! tag) tag = '*'; + var ret = new Array(); + var pattern = new RegExp("(^|\\s)"+cls+"(\\s|$)"); + var els = node.getElementsByTagName(tag); + for (i = 0; i < els.length; i++) { + if ( pattern.test(els[i].className) ) { + ret.push(els[i]); + } + } + return ret; +} diff --git a/underlays/javascript/ikiwiki/relativedate.js b/underlays/javascript/ikiwiki/relativedate.js new file mode 100644 index 000000000..5142332f1 --- /dev/null +++ b/underlays/javascript/ikiwiki/relativedate.js @@ -0,0 +1,76 @@ +// Causes html elements in the 'relativedate' class to be displayed +// as relative dates. The date is parsed from the title attribute, or from +// the element content. + +var dateElements; + +hook("onload", getDates); + +function getDates() { + dateElements = getElementsByClass('relativedate'); + for (var i = 0; i < dateElements.length; i++) { + var elt = dateElements[i]; + var title = elt.attributes.title; + var d = new Date(title ? title.value : elt.innerHTML); + if (! isNaN(d)) { + dateElements[i].date=d; + elt.title=elt.innerHTML; + } + } + + showDates(); +} + +function showDates() { + for (var i = 0; i < dateElements.length; i++) { + var elt = dateElements[i]; + var d = elt.date; + if (! isNaN(d)) { + elt.innerHTML=relativeDate(d); + } + } + setTimeout(showDates,30000); // keep updating every 30s +} + +var timeUnits = new Array; +timeUnits['minute'] = 60; +timeUnits['hour'] = timeUnits['minute'] * 60; +timeUnits['day'] = timeUnits['hour'] * 24; +timeUnits['month'] = timeUnits['day'] * 30; +timeUnits['year'] = timeUnits['day'] * 364; +var timeUnitOrder = ['year', 'month', 'day', 'hour', 'minute']; + +function relativeDate(date) { + var now = new Date(); + var offset = date.getTime() - now.getTime(); + var seconds = Math.round(Math.abs(offset) / 1000); + + // hack to avoid reading just in the future if there is a minor + // amount of clock slip + if (offset >= 0 && seconds < 30 * timeUnits['minute']) { + return "just now"; + } + + var ret = ""; + var shown = 0; + for (i = 0; i < timeUnitOrder.length; i++) { + var unit = timeUnitOrder[i]; + if (seconds >= timeUnits[unit]) { + var num = Math.floor(seconds / timeUnits[unit]); + seconds -= num * timeUnits[unit]; + if (ret) + ret += "and "; + ret += num + " " + unit + (num > 1 ? "s" : "") + " "; + + if (++shown == 2) + break; + } + else if (shown) + break; + } + + if (! ret) + ret = "less than a minute " + + return ret + (offset < 0 ? "ago" : "from now"); +} diff --git a/underlays/javascript/ikiwiki/toggle.js b/underlays/javascript/ikiwiki/toggle.js new file mode 100644 index 000000000..d190b737a --- /dev/null +++ b/underlays/javascript/ikiwiki/toggle.js @@ -0,0 +1,29 @@ +// Uses CSS to hide toggleables, to avoid any flashing on page load. The +// CSS is only emitted after it tests that it's going to be able +// to show the toggleables. +if (document.getElementById && document.getElementsByTagName && document.createTextNode) { + document.write(''); + hook("onload", inittoggle); +} + +function inittoggle() { + var as = getElementsByClass('toggle'); + for (var i = 0; i < as.length; i++) { + var id = as[i].href.match(/#(\w.+)/)[1]; + if (document.getElementById(id).className == "toggleable") + document.getElementById(id).style.display="none"; + as[i].onclick = function() { + toggle(this); + return false; + } + } +} + +function toggle(s) { + var id = s.href.match(/#(\w.+)/)[1]; + style = document.getElementById(id).style; + if (style.display == "none") + style.display = "block"; + else + style.display = "none"; +} diff --git a/underlays/javascript/relativedate.js b/underlays/javascript/relativedate.js deleted file mode 100644 index 5142332f1..000000000 --- a/underlays/javascript/relativedate.js +++ /dev/null @@ -1,76 +0,0 @@ -// Causes html elements in the 'relativedate' class to be displayed -// as relative dates. The date is parsed from the title attribute, or from -// the element content. - -var dateElements; - -hook("onload", getDates); - -function getDates() { - dateElements = getElementsByClass('relativedate'); - for (var i = 0; i < dateElements.length; i++) { - var elt = dateElements[i]; - var title = elt.attributes.title; - var d = new Date(title ? title.value : elt.innerHTML); - if (! isNaN(d)) { - dateElements[i].date=d; - elt.title=elt.innerHTML; - } - } - - showDates(); -} - -function showDates() { - for (var i = 0; i < dateElements.length; i++) { - var elt = dateElements[i]; - var d = elt.date; - if (! isNaN(d)) { - elt.innerHTML=relativeDate(d); - } - } - setTimeout(showDates,30000); // keep updating every 30s -} - -var timeUnits = new Array; -timeUnits['minute'] = 60; -timeUnits['hour'] = timeUnits['minute'] * 60; -timeUnits['day'] = timeUnits['hour'] * 24; -timeUnits['month'] = timeUnits['day'] * 30; -timeUnits['year'] = timeUnits['day'] * 364; -var timeUnitOrder = ['year', 'month', 'day', 'hour', 'minute']; - -function relativeDate(date) { - var now = new Date(); - var offset = date.getTime() - now.getTime(); - var seconds = Math.round(Math.abs(offset) / 1000); - - // hack to avoid reading just in the future if there is a minor - // amount of clock slip - if (offset >= 0 && seconds < 30 * timeUnits['minute']) { - return "just now"; - } - - var ret = ""; - var shown = 0; - for (i = 0; i < timeUnitOrder.length; i++) { - var unit = timeUnitOrder[i]; - if (seconds >= timeUnits[unit]) { - var num = Math.floor(seconds / timeUnits[unit]); - seconds -= num * timeUnits[unit]; - if (ret) - ret += "and "; - ret += num + " " + unit + (num > 1 ? "s" : "") + " "; - - if (++shown == 2) - break; - } - else if (shown) - break; - } - - if (! ret) - ret = "less than a minute " - - return ret + (offset < 0 ? "ago" : "from now"); -} diff --git a/underlays/javascript/toggle.js b/underlays/javascript/toggle.js deleted file mode 100644 index d190b737a..000000000 --- a/underlays/javascript/toggle.js +++ /dev/null @@ -1,29 +0,0 @@ -// Uses CSS to hide toggleables, to avoid any flashing on page load. The -// CSS is only emitted after it tests that it's going to be able -// to show the toggleables. -if (document.getElementById && document.getElementsByTagName && document.createTextNode) { - document.write(''); - hook("onload", inittoggle); -} - -function inittoggle() { - var as = getElementsByClass('toggle'); - for (var i = 0; i < as.length; i++) { - var id = as[i].href.match(/#(\w.+)/)[1]; - if (document.getElementById(id).className == "toggleable") - document.getElementById(id).style.display="none"; - as[i].onclick = function() { - toggle(this); - return false; - } - } -} - -function toggle(s) { - var id = s.href.match(/#(\w.+)/)[1]; - style = document.getElementById(id).style; - if (style.display == "none") - style.display = "block"; - else - style.display = "none"; -} -- cgit v1.2.3 From df012e54c7bf5a8e8fb2cb3c2f8cbf8dc30686f9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 01:13:58 -0400 Subject: chomp template values Before the template reorg, this was done by a template filter. --- IkiWiki/Plugin/template.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index d2b2fef55..52c482c38 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -56,12 +56,14 @@ sub preprocess (@) { IkiWiki::filter($params{page}, $params{destpagea}, $params{$param}), $scan); if ($template->query(name => $param)) { - $template->param($param => - IkiWiki::htmlize($params{page}, $params{destpage}, + my $htmlvalue=IkiWiki::htmlize($params{page}, $params{destpage}, pagetype($pagesources{$params{page}}), - $value)); + $value); + chomp $htmlvalue; + $template->param($param => $htmlvalue); } if ($template->query(name => "raw_$param")) { + chomp $value; $template->param("raw_$param" => $value); } } -- 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 'IkiWiki') 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 cce3042457facddfe5100327dbe98445d9d12b7c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 16:44:45 -0400 Subject: po: fix some uninitalized value warnings when used by websetup --- IkiWiki/Plugin/po.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 759e812e6..7c979ebca 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -567,7 +567,7 @@ sub mybestlink ($$) { my $link=shift; return $origsubs{'bestlink'}->($page, $link) - if $config{po_link_to} eq "default"; + if defined $config{po_link_to} && $config{po_link_to} eq "default"; my $res=$origsubs{'bestlink'}->(masterpage($page), $link); my @caller = caller(1); @@ -585,7 +585,7 @@ sub mybeautify_urlpath ($) { my $url=shift; my $res=$origsubs{'beautify_urlpath'}->($url); - if ($config{po_link_to} eq "negotiated") { + if (defined $config{po_link_to} && $config{po_link_to} eq "negotiated") { $res =~ s!/\Qindex.$config{po_master_language}{code}.$config{htmlext}\E$!/!; $res =~ s!/\Qindex.$config{htmlext}\E$!/!; map { @@ -729,6 +729,7 @@ sub istranslatablefile ($) { my $type=pagetype($file); return 0 if ! defined $type || $type eq 'po'; return 0 if $file =~ /\.pot$/; + return 0 if ! defined $config{po_translatable_pages}; return 1 if pagespec_match(pagename($file), $config{po_translatable_pages}); return; } -- cgit v1.2.3 From ca9c6cc254d934837406ef9bb0dc5d021983661b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 20:22:20 -0400 Subject: add support for mass dependencies Registered by passing "" as page name to add_depends. --- IkiWiki.pm | 4 ++-- IkiWiki/Plugin/google.pm | 6 +++++- IkiWiki/Plugin/search.pm | 6 +++++- IkiWiki/Render.pm | 19 +++++++++---------- 4 files changed, 21 insertions(+), 14 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index c2cadd35f..0ac49ade9 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -13,8 +13,8 @@ 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 %typedlinks %oldtypedlinks + %pagesources %destsources %depends %depends_simple @mass_depends + %hooks %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks %autofiles}; use Exporter q{import}; diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 68cb16513..529a2c801 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -25,6 +25,10 @@ sub checkconfig () { if (! length $config{url}) { error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google')); } + + # This is a mass dependency, so if the search form template + # changes, every page is rebuilt. + add_depends("", "googleform.tmpl"); } my $form; @@ -36,7 +40,7 @@ sub pagetemplate (@) { # Add search box to page header. if ($template->query(name => "searchform")) { if (! defined $form) { - my $searchform = template_depends("googleform.tmpl", $page, blind_cache => 1); + my $searchform = template("googleform.tmpl", blind_cache => 1); $searchform->param(url => $config{url}); $form=$searchform->output; } diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 55edf8752..c9a69f443 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -41,6 +41,10 @@ sub checkconfig () { if (! defined $config{omega_cgi}) { $config{omega_cgi}="/usr/lib/cgi-bin/omega/omega"; } + + # This is a mass dependency, so if the search form template + # changes, every page is rebuilt. + add_depends("", "searchform.tmpl"); } my $form; @@ -52,7 +56,7 @@ sub pagetemplate (@) { # Add search box to page header. if ($template->query(name => "searchform")) { if (! defined $form) { - my $searchform = template_depends("searchform.tmpl", $page, blind_cache => 1); + my $searchform = template("searchform.tmpl", blind_cache => 1); $searchform->param(searchaction => $config{cgiurl}); $form=$searchform->output; } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 8ae0cbd4f..50af2bdec 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -591,13 +591,18 @@ sub render_dependent ($$$$$$$) { my %lc_changed = map { lc(pagename($_)) => 1 } @changed; my %lc_exists_changed = map { lc(pagename($_)) => 1 } @exists_changed; + + my $mass_reason; + foreach my $p ("page.tmpl", keys %{$depends_simple{""}}) { + $mass_reason=$p if $rendered{$p}; + } foreach my $f (@$files) { next if $rendered{$f}; my $p=pagename($f); - my $reason = undef; - - if (exists $depends_simple{$p}) { + my $reason = $mass_reason; + + if (exists $depends_simple{$p} && ! defined $reason) { foreach my $d (keys %{$depends_simple{$p}}) { if (($depends_simple{$p}{$d} & $IkiWiki::DEPEND_CONTENT && $lc_changed{$d}) @@ -771,13 +776,7 @@ sub refresh () { render_linkers($file); } - if ($rendered{"templates/page.tmpl"}) { - foreach my $f (@$files) { - next if $f eq "templates/page.tmpl"; - render($f, sprintf(gettext("building %s, which depends on %s"), $f, "templates/page.tmpl")); - } - } - elsif (@$changed || @$internal_changed || + if (@$changed || @$internal_changed || @$del || @$internal_del || @$internal_new) { 1 while render_dependent($files, $new, $internal_new, $del, $internal_del, $internal_changed, -- cgit v1.2.3 From a1575b0c8398f3ebb70b2364b986964fb354e09a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 20:41:35 -0400 Subject: bugfixes --- IkiWiki/Plugin/google.pm | 2 +- IkiWiki/Plugin/search.pm | 2 +- IkiWiki/Render.pm | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 529a2c801..85467fa0b 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -28,7 +28,7 @@ sub checkconfig () { # This is a mass dependency, so if the search form template # changes, every page is rebuilt. - add_depends("", "googleform.tmpl"); + add_depends("", "templates/googleform.tmpl"); } my $form; diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index c9a69f443..be39fdf1e 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -44,7 +44,7 @@ sub checkconfig () { # This is a mass dependency, so if the search form template # changes, every page is rebuilt. - add_depends("", "searchform.tmpl"); + add_depends("", "templates/searchform.tmpl"); } my $form; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 50af2bdec..d0c7e58a3 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -592,15 +592,20 @@ sub render_dependent ($$$$$$$) { my %lc_changed = map { lc(pagename($_)) => 1 } @changed; my %lc_exists_changed = map { lc(pagename($_)) => 1 } @exists_changed; - my $mass_reason; - foreach my $p ("page.tmpl", keys %{$depends_simple{""}}) { - $mass_reason=$p if $rendered{$p}; + foreach my $p ("templates/page.tmpl", keys %{$depends_simple{""}}) { + if ($rendered{$p}) { + foreach my $f (@$files) { + next if $rendered{$f}; + render($f, sprintf(gettext("building %s, which depends on %s"), $f, $p)); + } + return 0; + } } foreach my $f (@$files) { next if $rendered{$f}; my $p=pagename($f); - my $reason = $mass_reason; + my $reason = undef; if (exists $depends_simple{$p} && ! defined $reason) { foreach my $d (keys %{$depends_simple{$p}}) { -- cgit v1.2.3 From e05c9653ef823d1af3c79a89a6231c86be7f8960 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 21:13:53 -0400 Subject: rebuild on template removal --- IkiWiki/Render.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index d0c7e58a3..871e005b2 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -593,7 +593,7 @@ sub render_dependent ($$$$$$$) { my %lc_exists_changed = map { lc(pagename($_)) => 1 } @exists_changed; foreach my $p ("templates/page.tmpl", keys %{$depends_simple{""}}) { - if ($rendered{$p}) { + if ($rendered{$p} || grep { $_ eq $p } @$del) { foreach my $f (@$files) { next if $rendered{$f}; render($f, sprintf(gettext("building %s, which depends on %s"), $f, $p)); -- cgit v1.2.3 From 7f3047f67c1bb45e25b91362f9ae4bb18734e140 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Apr 2010 13:47:01 -0400 Subject: added match_guid function to meta plugin (cherry picked from commit 8b6fde73669ddf9204acb3d334c3984566f3c59d) Conflicts: IkiWiki/Plugin/meta.pm --- IkiWiki/Plugin/meta.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 159008614..7d68a9b2d 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -376,6 +376,10 @@ sub match_copyright ($$;@) { IkiWiki::Plugin::meta::match("copyright", @_); } +sub match_guid ($$;@) { + IkiWiki::Plugin::meta::match("guid", @_); +} + package IkiWiki::SortSpec; sub cmp_meta { -- cgit v1.2.3 From 97b0c6e455f9edb99d9bd5145a8e82549ed54694 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Apr 2010 17:14:03 -0400 Subject: Fix removal of rendered files in rebuild mode. Needed to handle the move of the .js files into ikiwiki/, but also this is a longstanding bug. Old pagemtime is not remembered in rebuild mode, and changing that would need a lot of changes. So instead, loop on pagectime, which is remembered. Change to remembering old pagesources info in rebuild mode. This seems safe enough. --- IkiWiki.pm | 2 +- IkiWiki/Render.pm | 2 +- debian/changelog | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 63a7f5e2a..944001d9b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1531,8 +1531,8 @@ sub loadindex () { my $d=$pages->{$src}; my $page=pagename($src); $pagectime{$page}=$d->{ctime}; + $pagesources{$page}=$src; if (! $config{rebuild}) { - $pagesources{$page}=$src; $pagemtime{$page}=$d->{mtime}; $renderedfiles{$page}=$d->{dest}; if (exists $d->{links} && ref $d->{links}) { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 871e005b2..b04664e41 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -409,7 +409,7 @@ sub find_del_files ($) { my @del; my @internal_del; - foreach my $page (keys %pagemtime) { + foreach my $page (keys %pagectime) { if (! $pages->{$page}) { if (isinternal($page)) { push @internal_del, $pagesources{$page}; diff --git a/debian/changelog b/debian/changelog index 53febb433..1229b1198 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,6 +74,7 @@ ikiwiki (3.20100424) UNRELEASED; urgency=low * Moved javascript files under the ikiwiki/ directory, to avoid cluttering the top of the web root. This is another things that requires a wiki rebuild on upgrade to this version. + * Fix removal of rendered files in rebuild mode. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 -- cgit v1.2.3 From 194824ce293a64f7dce68d568d1f906d675af858 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Apr 2010 18:32:06 -0400 Subject: loop on pagesources, not ctime --- IkiWiki/Render.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index b04664e41..7e3d78861 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -409,7 +409,7 @@ sub find_del_files ($) { my @del; my @internal_del; - foreach my $page (keys %pagectime) { + foreach my $page (keys %pagesources) { if (! $pages->{$page}) { if (isinternal($page)) { push @internal_del, $pagesources{$page}; -- cgit v1.2.3 From 0e7a3640aec280eb19330285308af6ad7535627f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 27 Apr 2010 12:10:58 -0400 Subject: template: Fix typo. --- IkiWiki/Plugin/template.pm | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index 52c482c38..b8c2f05b2 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -53,7 +53,7 @@ sub preprocess (@) { foreach my $param (keys %params) { my $value=IkiWiki::preprocess($params{page}, $params{destpage}, - IkiWiki::filter($params{page}, $params{destpagea}, + IkiWiki::filter($params{page}, $params{destpage}, $params{$param}), $scan); if ($template->query(name => $param)) { my $htmlvalue=IkiWiki::htmlize($params{page}, $params{destpage}, diff --git a/debian/changelog b/debian/changelog index 411f67bd1..b19840865 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100428) UNRELEASED; urgency=low + + * template: Fix typo. + + -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 + ikiwiki (3.20100427) unstable; urgency=low [ Joey Hess ] -- cgit v1.2.3 From 80f2042464f9d14bcaed999e9769c71618bf5252 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 16:34:47 -0400 Subject: htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup header footer time mark --- IkiWiki/Plugin/htmlscrubber.pm | 9 ++++++--- debian/changelog | 2 ++ doc/bugs/html5_support.mdwn | 10 ++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 9f40c752f..1604d776a 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -72,7 +72,7 @@ sub scrubber { eval q{use HTML::Scrubber}; error($@) if $@; # Lists based on http://feedparser.org/docs/html-sanitization.html - # With html 5 video and audio tags added. + # With html5 tags added. $_scrubber = HTML::Scrubber->new( allow => [qw{ a abbr acronym address area b big blockquote br br/ @@ -82,7 +82,9 @@ sub scrubber { menu ol optgroup option p p/ pre q s samp select small span strike strong sub sup table tbody td textarea tfoot th thead tr tt u ul var - video audio + + video audio section nav article aside hgroup header + footer time mark }], default => [undef, { ( map { $_ => 1 } qw{ @@ -98,8 +100,9 @@ sub scrubber { selected shape size span start summary tabindex target title type valign value vspace width + autoplay loopstart loopend end - playcount controls + playcount controls pubdate } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index a1bd85bfa..9a6cf68e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low (But not in-wiki templates.) * Version dependency on liburi-perl to >= 1.36; previous versions did not support building urls from utf-8 strings. Closes: #579713 + * htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup + header footer time mark -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 5d2a41303..a330d3ae6 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -59,7 +59,13 @@ HTML5](http://www.w3.org/TR/html5-diff/). > tag, but something should still be done to replace it. > > (BTW, it would be helpful if you could re-merge master into your branch -> as it is a bit diverged now.) --[[Joey]] +> as it is a bit diverged now.) +> +> Other ideas: +> +> * Add pubdate attribute to time elements as appropriate. +> * Use aside for the sidebar? Or for the [[templates/note]] template? +> --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements @@ -68,7 +74,7 @@ HTML5](http://www.w3.org/TR/html5-diff/). > Most of these can be supported trivially, since they are just semantic > markup. Make a list of these, and their attributes (and which attributes > can contain urls or other javascript injection mechanisms), and I can add -> them. Others, like `embed`, and `canvas` are *scary*. --[[Joey]] +> them. (Added several now.) Others, like `embed`, and `canvas` are *scary*. --[[Joey]] # HTML5 Validation and t/html.t -- cgit v1.2.3 From 73c8209484ac730c82f7c7b749d08a1b3d895ee0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 17:56:35 -0400 Subject: more html5 * htmlscrubber: Also allow html5 canvas tags. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. --- IkiWiki/Plugin/htmlscrubber.pm | 6 +++--- debian/changelog | 3 +++ doc/bugs/html5_support.mdwn | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 1604d776a..cc00fd5ff 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -83,8 +83,8 @@ sub scrubber { span strike strong sub sup table tbody td textarea tfoot th thead tr tt u ul var - video audio section nav article aside hgroup header - footer time mark + video audio source section nav article aside hgroup + header footer time mark canvas }], default => [undef, { ( map { $_ => 1 } qw{ @@ -101,7 +101,7 @@ sub scrubber { tabindex target title type valign value vspace width - autoplay loopstart loopend end + autoplay preload loopstart loopend end playcount controls pubdate } ), "/" => 1, # emit proper
XHTML diff --git a/debian/changelog b/debian/changelog index 9a6cf68e3..9613d8b6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low did not support building urls from utf-8 strings. Closes: #579713 * htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup header footer time mark + * htmlscrubber: Also allow html5 canvas tags. + * htmlscrubber: Round out html5 video support with the preload + attribute and the source tag. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index a330d3ae6..c05208fbf 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -65,6 +65,7 @@ HTML5](http://www.w3.org/TR/html5-diff/). > > * Add pubdate attribute to time elements as appropriate. > * Use aside for the sidebar? Or for the [[templates/note]] template? +> * Use nav for the actionbar > --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements @@ -74,7 +75,7 @@ HTML5](http://www.w3.org/TR/html5-diff/). > Most of these can be supported trivially, since they are just semantic > markup. Make a list of these, and their attributes (and which attributes > can contain urls or other javascript injection mechanisms), and I can add -> them. (Added several now.) Others, like `embed`, and `canvas` are *scary*. --[[Joey]] +> them. (Added several now.) Others, like `embed` are *scary*. --[[Joey]] # HTML5 Validation and t/html.t -- cgit v1.2.3 From 442bc59a15301941613d62f4b1d846c57557ca8f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 18:14:50 -0400 Subject: htmlscrubber: Allow the placeholder attribute. --- IkiWiki/Plugin/htmlscrubber.pm | 2 +- debian/changelog | 1 + doc/bugs/html5_support.mdwn | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index cc00fd5ff..b3f659f73 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -102,7 +102,7 @@ sub scrubber { value vspace width autoplay preload loopstart loopend end - playcount controls pubdate + playcount controls pubdate placeholder } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index 9613d8b6d..951caab9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low * htmlscrubber: Also allow html5 canvas tags. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. + * htmlscrubber: Allow the placeholder attribute. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index c05208fbf..9c077a2d3 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -66,6 +66,8 @@ HTML5](http://www.w3.org/TR/html5-diff/). > * Add pubdate attribute to time elements as appropriate. > * Use aside for the sidebar? Or for the [[templates/note]] template? > * Use nav for the actionbar +> * Use placeholder in the search box. Allows closing +> [[this_todo|Add_label_to_search_form_input_field]] > --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements -- cgit v1.2.3 From 0a139aba823ece3166d29ff2daee0b5c9507b52f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 18:27:53 -0400 Subject: htmlscrubber: Allow the html5 form attributes: placeholder autofocus, min, max, step. --- IkiWiki/Plugin/htmlscrubber.pm | 5 +++-- debian/changelog | 3 ++- doc/todo/Add_label_to_search_form_input_field.mdwn | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index b3f659f73..479e10e74 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -101,8 +101,9 @@ sub scrubber { tabindex target title type valign value vspace width - autoplay preload loopstart loopend end - playcount controls pubdate placeholder + autofocus autoplay preload loopstart + loopend end playcount controls pubdate + placeholder min max step } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index 951caab9e..12ef08a91 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,8 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low * htmlscrubber: Also allow html5 canvas tags. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. - * htmlscrubber: Allow the placeholder attribute. + * htmlscrubber: Allow the html5 form attributes: placeholder autofocus, + min, max, step. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/todo/Add_label_to_search_form_input_field.mdwn b/doc/todo/Add_label_to_search_form_input_field.mdwn index 51b34927d..281ab48e2 100644 --- a/doc/todo/Add_label_to_search_form_input_field.mdwn +++ b/doc/todo/Add_label_to_search_form_input_field.mdwn @@ -51,4 +51,4 @@ The patch below adds a label for the field to improve usability: > element. already works in eg, chromium. However, ikiwiki does not use > html5 yet. --[[Joey]] -[[!tag wishlist html5]] +[[!tag wishlist bugs/html5_support]] -- cgit v1.2.3 From 80f9a2a0879f74e86b2720ca7d1c88ee165100ea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 18:31:33 -0400 Subject: add figure and figcaption --- IkiWiki/Plugin/htmlscrubber.pm | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 479e10e74..0090b67b9 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -84,7 +84,7 @@ sub scrubber { tfoot th thead tr tt u ul var video audio source section nav article aside hgroup - header footer time mark canvas + header footer figure figcaption time mark canvas }], default => [undef, { ( map { $_ => 1 } qw{ diff --git a/debian/changelog b/debian/changelog index 12ef08a91..108764c39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low * Version dependency on liburi-perl to >= 1.36; previous versions did not support building urls from utf-8 strings. Closes: #579713 * htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup - header footer time mark + header footer figure figcaption time mark * htmlscrubber: Also allow html5 canvas tags. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. -- cgit v1.2.3 From 78cee5140ac37f93cd2e87d8a03d71420303eb13 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 18:44:37 -0400 Subject: add rest of html5 form attributes It's easy to imagine pattern being used to freeze or crash browsers, if they implement it stupidly. Let's hope not.. --- IkiWiki/Plugin/htmlscrubber.pm | 2 +- debian/changelog | 2 +- doc/bugs/html5_support.mdwn | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 0090b67b9..7517c82c6 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -103,7 +103,7 @@ sub scrubber { autofocus autoplay preload loopstart loopend end playcount controls pubdate - placeholder min max step + placeholder min max step form required } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index 108764c39..cdc79ae78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,7 +11,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. * htmlscrubber: Allow the html5 form attributes: placeholder autofocus, - min, max, step. + min, max, step, required, autocomplete, novalidate, pattern, and form. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 9c077a2d3..7d9dc9f79 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -79,6 +79,10 @@ HTML5](http://www.w3.org/TR/html5-diff/). > can contain urls or other javascript injection mechanisms), and I can add > them. (Added several now.) Others, like `embed` are *scary*. --[[Joey]] +> I have not added the new `ping` attribute, because parsing a +> space-separeated list of urls to avoid javascript injection is annoying, +> and the attribute seems generally dubious. --[[Joey]] + # HTML5 Validation and t/html.t [validator.nu](http://validator.nu/) is the authorative HTML5 validator, -- cgit v1.2.3 From f1e2d0af123352b692e8e4efdb208e370a00d3c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 19:11:03 -0400 Subject: more html5 attributes --- IkiWiki/Plugin/htmlscrubber.pm | 5 +++++ debian/changelog | 4 ++++ doc/bugs/html5_support.mdwn | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 7517c82c6..d52614a4d 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -85,6 +85,7 @@ sub scrubber { video audio source section nav article aside hgroup header footer figure figcaption time mark canvas + datalist }], default => [undef, { ( map { $_ => 1 } qw{ @@ -104,11 +105,15 @@ sub scrubber { autofocus autoplay preload loopstart loopend end playcount controls pubdate placeholder min max step form required + autocomplete novalidate pattern list + formenctype formmethod formnovalidate + formtarget reversed } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, src => $safe_url_regexp, action => $safe_url_regexp, + formaction => $safe_url_regexp, cite => $safe_url_regexp, longdesc => $safe_url_regexp, poster => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index cdc79ae78..e0f506f29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,10 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low attribute and the source tag. * htmlscrubber: Allow the html5 form attributes: placeholder autofocus, min, max, step, required, autocomplete, novalidate, pattern, and form. + (Also the form* override attributes for input and buttons.) + * htmlscrubber: Allow the html5 datalist element, and the form list + attribute. + * htmlscrubber: Allow the html5 reversed and spellcheck attributes. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 7d9dc9f79..1ca45f46d 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -81,7 +81,10 @@ HTML5](http://www.w3.org/TR/html5-diff/). > I have not added the new `ping` attribute, because parsing a > space-separeated list of urls to avoid javascript injection is annoying, -> and the attribute seems generally dubious. --[[Joey]] +> and the attribute seems generally dubious. +> +> Need to understand better the attributes contenteditabl, contextmenu, +> data-*, draggable, hidden, role, aria-*. Have not added those. --[[Joey]] # HTML5 Validation and t/html.t -- cgit v1.2.3 From 790a339db18f1c697052446728641c9e6ef06bdb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 19:28:28 -0400 Subject: htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, ruby, rt, rp, details, summary. --- IkiWiki/Plugin/htmlscrubber.pm | 10 +++++----- debian/changelog | 3 ++- doc/bugs/html5_support.mdwn | 22 ++++++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index d52614a4d..505a6f142 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -85,7 +85,7 @@ sub scrubber { video audio source section nav article aside hgroup header footer figure figcaption time mark canvas - datalist + datalist progress meter ruby rt rp details summary }], default => [undef, { ( map { $_ => 1 } qw{ @@ -104,10 +104,10 @@ sub scrubber { autofocus autoplay preload loopstart loopend end playcount controls pubdate - placeholder min max step form required - autocomplete novalidate pattern list - formenctype formmethod formnovalidate - formtarget reversed + placeholder min max step low high optimum + form required autocomplete novalidate pattern + list formenctype formmethod formnovalidate + formtarget reversed spellcheck open } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index e0f506f29..3d33f3bfc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,8 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low did not support building urls from utf-8 strings. Closes: #579713 * htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup header footer figure figcaption time mark - * htmlscrubber: Also allow html5 canvas tags. + * htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, + ruby, rt, rp, details, summary. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. * htmlscrubber: Allow the html5 form attributes: placeholder autofocus, diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 1ca45f46d..48b63b29a 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -68,23 +68,29 @@ HTML5](http://www.w3.org/TR/html5-diff/). > * Use nav for the actionbar > * Use placeholder in the search box. Allows closing > [[this_todo|Add_label_to_search_form_input_field]] +> * Use details tag instead of the javascript in the toggle plugin. +> (Need to wait on browser support probably.) > --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements * [new elements](http://www.w3.org/TR/html5-diff/#new-elements) -> Most of these can be supported trivially, since they are just semantic -> markup. Make a list of these, and their attributes (and which attributes -> can contain urls or other javascript injection mechanisms), and I can add -> them. (Added several now.) Others, like `embed` are *scary*. --[[Joey]] - +> Many added now. +> +> Things I left out, too hard to understand today: +> Attributes contenteditabl, contextmenu, +> data-*, draggable, hidden, role, aria-*. Tags command, keygen, +> output. +> +> Clearly unsafe: embed. +> +> Apparently cannot be used w/o javascript: menu. +> > I have not added the new `ping` attribute, because parsing a > space-separeated list of urls to avoid javascript injection is annoying, > and the attribute seems generally dubious. -> -> Need to understand better the attributes contenteditabl, contextmenu, -> data-*, draggable, hidden, role, aria-*. Have not added those. --[[Joey]] +> --[[Joey]] # HTML5 Validation and t/html.t -- cgit v1.2.3 From ccafb10007731d04e0ff6aa36978690e6dfa6dec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 19:59:16 -0400 Subject: enable hidden attribute --- IkiWiki/Plugin/htmlscrubber.pm | 2 +- debian/changelog | 17 ++++++++--------- doc/bugs/html5_support.mdwn | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 505a6f142..847518178 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -107,7 +107,7 @@ sub scrubber { placeholder min max step low high optimum form required autocomplete novalidate pattern list formenctype formmethod formnovalidate - formtarget reversed spellcheck open + formtarget reversed spellcheck open hidden } ), "/" => 1, # emit proper
XHTML href => $safe_url_regexp, diff --git a/debian/changelog b/debian/changelog index 3d33f3bfc..8bf6f89b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,18 +5,17 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low (But not in-wiki templates.) * Version dependency on liburi-perl to >= 1.36; previous versions did not support building urls from utf-8 strings. Closes: #579713 - * htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup - header footer figure figcaption time mark + * htmlscrubber: Allow html5 semantic tags: section, nav, article, aside + hgroup, header, footer, figure, figcaption, time, mark * htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, - ruby, rt, rp, details, summary. + ruby, rt, rp, details, summary, datalist. * htmlscrubber: Round out html5 video support with the preload attribute and the source tag. - * htmlscrubber: Allow the html5 form attributes: placeholder autofocus, - min, max, step, required, autocomplete, novalidate, pattern, and form. - (Also the form* override attributes for input and buttons.) - * htmlscrubber: Allow the html5 datalist element, and the form list - attribute. - * htmlscrubber: Allow the html5 reversed and spellcheck attributes. + * htmlscrubber: Allow the html5 form attributes: placeholder, autofocus, + min, max, step, required, autocomplete, novalidate, pattern, list, + and form. (Also the form* override attributes for input and buttons.) + * htmlscrubber: Allow additional misc html5 attributes: reversed, + spellcheck, and hidden. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 48b63b29a..2d27ac803 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -79,9 +79,9 @@ HTML5](http://www.w3.org/TR/html5-diff/). > Many added now. > > Things I left out, too hard to understand today: -> Attributes contenteditabl, contextmenu, -> data-*, draggable, hidden, role, aria-*. Tags command, keygen, -> output. +> Attributes contenteditable, +> data-\*, draggable, role, aria-\*. +> Tags command, keygen, output. > > Clearly unsafe: embed. > -- cgit v1.2.3 From a547d2685866898665fad221939b0b820a42a088 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 20:40:31 -0400 Subject: html5 option * Ikiwiki can be configured to generate html5 instead of the default xhtml 1.0. The html5 output mode is experimental, not yet fully standards compliant, and will be subject to rapid change. --- IkiWiki.pm | 8 ++++++++ IkiWiki/Render.pm | 1 + debian/changelog | 5 ++++- doc/bugs/html5_support.mdwn | 12 +++++++----- doc/roadmap.mdwn | 1 + templates/misc.tmpl | 5 ++++- templates/page.tmpl | 5 ++++- 7 files changed, 29 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ff1a5ae6..1e11d34e2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -234,6 +234,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + html5 => { + type => "boolean", + default => 0, + description => "generate HTML5? (experimental)", + safe => 1, + rebuild => 1, + }, sslcookie => { type => "boolean", default => 0, @@ -1725,6 +1732,7 @@ sub misctemplate ($$;@) { wikiname => $config{wikiname}, pagebody => $pagebody, baseurl => baseurl(), + html5 => $config{html5}, @_, ); run_hooks(pagetemplate => sub { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7e3d78861..5923f5e74 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -138,6 +138,7 @@ sub genpage ($$) { mtime => displaytime($pagemtime{$page}), ctime => displaytime($pagectime{$page}), baseurl => baseurl($page), + html5 => $config{html5}, ); run_hooks(pagetemplate => sub { diff --git a/debian/changelog b/debian/changelog index 8bf6f89b6..fc5a6124b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low - * template: Fix typo. * TMPL_INCLUDE re-enabled for templates read from the templatedir. (But not in-wiki templates.) * Version dependency on liburi-perl to >= 1.36; previous versions did not support building urls from utf-8 strings. Closes: #579713 + * Ikiwiki can be configured to generate html5 instead of the default xhtml + 1.0. The html5 output mode is experimental, not yet fully standards + compliant, and will be subject to rapid change. * htmlscrubber: Allow html5 semantic tags: section, nav, article, aside hgroup, header, footer, figure, figcaption, time, mark * htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, @@ -16,6 +18,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low and form. (Also the form* override attributes for input and buttons.) * htmlscrubber: Allow additional misc html5 attributes: reversed, spellcheck, and hidden. + * template: Fix typo. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 2d27ac803..bf782a3bf 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -20,13 +20,14 @@ HTML5](http://www.w3.org/TR/html5-diff/). > What has been done so far, can be extended. Basically works > in browsers, if you don't care about standards. A good prerequisite > for anything else, anyway. -> 2. Switch to html5 in eg, ikiwiki 4; users have to deal with +> 2. Have both a html5 and a xhtml mode, allow user to select. +> 3. Switch to html5 in eg, ikiwiki 4; users have to deal with > any custom markup on their pages/templates that breaks then. -> 3. Have both a html5 and a xhtml mode, allow user to select. -> -> The third option seems fairly tractable from what I see here and in +> +> The second option seems fairly tractable from what I see here and in > your branch. You made only relatively minor changes to 10 templates. -> It would probably not be too dreadful to put them in ifdefs. +> It would probably not be too dreadful to put them in ifdefs. I've made a +> small start at doing that. > > Some of your changes are obvious, like using the new `time` and > and `article` elements. Others less so, and I'm particularly @@ -70,6 +71,7 @@ HTML5](http://www.w3.org/TR/html5-diff/). > [[this_todo|Add_label_to_search_form_input_field]] > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) +> > --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index c126fd585..4b5f01c45 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -80,6 +80,7 @@ Probably incomplete list: * YADA format setup files per default? * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. +* html5 on by default (some day..) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that diff --git a/templates/misc.tmpl b/templates/misc.tmpl index 535a6f06b..0b7fefa08 100644 --- a/templates/misc.tmpl +++ b/templates/misc.tmpl @@ -1,6 +1,9 @@ - + + + diff --git a/templates/page.tmpl b/templates/page.tmpl index 7e850a56b..661d4a515 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -1,6 +1,9 @@ - + + + -- 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 'IkiWiki') 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 '
". htmllink($params{page}, $params{destpage}, $_, noimageinline => 1). @@ -87,16 +87,31 @@ sub preprocess (@) { else { # In case of misspelling, default to a page cloud - my $res = "
\n"; + my $res; + if ($style eq 'list') { + $res = "
    \n"; + } + else { + $res = "
    \n"; + } foreach my $page (sort keys %counts) { next unless $counts{$page} > 0; my $class = $classes[$counts{$page} * scalar(@classes) / ($max + 1)]; + + $res.="
  • " if $style eq 'list'; $res .= "". htmllink($params{page}, $params{destpage}, $page). "\n"; + $res.="
  • " if $style eq 'list'; + + } + if ($style eq 'list') { + $res = "
\n"; + } + else { + $res .= "
\n"; } - $res .= "\n"; return $res; } diff --git a/debian/changelog b/debian/changelog index 7c607b2a5..c2b0c3c23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,11 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low specify which pages to include on the calendar archive pages. (The pagespec can still also be specified on the ikiwiki-calendar command line.) + * pagestats: Class parameter can be used to override default class for + custom styling. + * pagestats: Use style=list to get a list of tags, scaled by use like + in a tag cloud. This is useful to put in a sidebar. + * Rework example blog front page. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/examples/blog/archives.mdwn b/doc/examples/blog/archives.mdwn new file mode 100644 index 000000000..14686cdfe --- /dev/null +++ b/doc/examples/blog/archives.mdwn @@ -0,0 +1,7 @@ +[[!if test="enabled(calendar)" then=""" +Browse through blog archives by year: +[[!map pages="./archives/* and !./archives/*/* and !*/Discussion"]] +""" +else=""" +Calendar based archives are not enabled. See [[posts]] for a full list of posts. +"""]] diff --git a/doc/examples/blog/comments.mdwn b/doc/examples/blog/comments.mdwn index 4735dea08..0b503ba01 100644 --- a/doc/examples/blog/comments.mdwn +++ b/doc/examples/blog/comments.mdwn @@ -1,3 +1,3 @@ -This page will show all comments made to posts in my [[blog|index]]. +This page will show recent comments made to posts in the [[blog|index]]. [[!inline pages="./posts/*/Discussion or internal(./posts/*/comment_*)"]] diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index 01b714fcd..b273ba1a9 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -1,9 +1,13 @@ -[[!pagestats pages="./tags/*" among="./posts/*"]] +[[!template id=note text=""" -Welcome to my blog. +* [[Tags]]: [[!pagestats style="list" pages="./tags/*" among="./posts/*"]] +* [[Recent_Comments|comments]] +* [[Archives]] -Have a look at the most recent posts below, or browse the tag cloud on the -right. Archives of all [[posts]] and all [[comments]] are also available. +[[!if test="enabled(calendar)" then=""" +[[!calendar pages="./posts/* and !*/Discussion"]] + +"""]] [[!inline pages="./posts/* and !*/Discussion" show="10" actions=yes rootpage="posts"]] diff --git a/doc/ikiwiki/directive/pagestats.mdwn b/doc/ikiwiki/directive/pagestats.mdwn index 68f4d2734..d0e0e7be7 100644 --- a/doc/ikiwiki/directive/pagestats.mdwn +++ b/doc/ikiwiki/directive/pagestats.mdwn @@ -4,10 +4,16 @@ This directive can generate stats about how pages link to each other. It can produce either a tag cloud, or a table counting the number of links to each page. -Here's how to use it to create a [[tag]] cloud: +Here's how to use it to create a [[tag]] cloud, with tags sized based +on frequency of use: \[[!pagestats pages="tags/*"]] +Here's how to create a list of tags, sized by use as they would be in a +cloud. + + \[[!pagestats style="list" pages="tags/*"]] + And here's how to create a table of all the pages on the wiki: \[[!pagestats style="table"]] @@ -28,4 +34,7 @@ links: \[[!pagestats style="table" show="10"]] +The optional `class` parameter can be used to control the class +of the generated tag cloud `div` or page stats `table`. + [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From 691dab03069f452b95f2319f9dcc52a27c9ff7b2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 14:45:03 -0400 Subject: typo --- IkiWiki/Plugin/pagestats.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 48715bd3e..17b26f7ba 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -107,7 +107,7 @@ sub preprocess (@) { } if ($style eq 'list') { - $res = "\n"; + $res .= "\n"; } else { $res .= "\n"; -- cgit v1.2.3 From 1fbc1b518a6764b0bd6d8c580bc3480ec4ada01d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 15:41:56 -0400 Subject: disable feeds in raw mode --- IkiWiki/Plugin/inline.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 644cb588d..3359af314 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -160,7 +160,7 @@ sub preprocess_inline (@) { my $rss=(($config{rss} || $config{allowrss}) && exists $params{rss}) ? yesno($params{rss}) : $config{rss}; my $atom=(($config{atom} || $config{allowatom}) && exists $params{atom}) ? yesno($params{atom}) : $config{atom}; my $quick=exists $params{quick} ? yesno($params{quick}) : 0; - my $feeds=! $nested && (exists $params{feeds} ? yesno($params{feeds}) : !$quick); + my $feeds=! $nested && (exists $params{feeds} ? yesno($params{feeds}) : !$quick && ! $raw); my $emptyfeeds=exists $params{emptyfeeds} ? yesno($params{emptyfeeds}) : 1; my $feedonly=yesno($params{feedonly}); if (! exists $params{show} && ! $archive) { -- 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 'IkiWiki') 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 'IkiWiki') 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 d63e043f0abf642ff4048cc20c6caf03db3e55fb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 17:38:13 -0400 Subject: allow sidebar directive to enable use of sidebar page This way, the example blog always has a sidebar on the index page, but not the overhead of sidebars on all the other pages. And if a user wants to, they can enable global_sidebars to switch to sidebars on every page. --- IkiWiki/Plugin/sidebar.pm | 33 ++++++++++++++++++--------------- doc/examples/blog/index.mdwn | 10 +--------- doc/examples/blog/sidebar.mdwn | 9 +++++++++ doc/ikiwiki/directive/sidebar.mdwn | 8 +++++++- 4 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 doc/examples/blog/sidebar.mdwn (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 1b302dcf9..f706480ca 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -23,7 +23,7 @@ sub getsetup () { global_sidebars => { type => "boolean", examples => 1, - description => "show sidebar page on all pages?" + description => "show sidebar page on all pages?", safe => 1, rebuild => 1, }, @@ -36,20 +36,22 @@ sub preprocess (@) { 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)))); + + if (! defined $content) { + $pagesidebar{$page}=undef; + } + else { + 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 ""; } @@ -60,9 +62,10 @@ my $oldcontent; sub sidebar_content ($) { my $page=shift; - return $pagesidebar{$page} if exists $pagesidebar{$page}; + return $pagesidebar{$page} if defined $pagesidebar{$page}; - return if defined $config{global_sidebars} && !$config{global_sidebars}; + return if ! exists $pagesidebar{$page} && + defined $config{global_sidebars} && ! $config{global_sidebars}; my $sidebar_page=bestlink($page, "sidebar") || return; my $sidebar_file=$pagesources{$sidebar_page} || return; diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index 062c71f2e..a22c40c72 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -1,14 +1,6 @@ [[!inline pages="./posts/* and !*/Discussion" show="10" actions=yes rootpage="posts"]] -[[!sidebar """ -[[Tags]]: [[!pagestats style="list" pages="./tags/*" among="./posts/*"]] - -[[Recent Comments|comments]] - -[[Archives]] - -[[!calendar pages="./posts/* and !*/Discussion"]] -"""]] +[[!sidebar]] This blog is powered by [ikiwiki](http://ikiwiki.info). diff --git a/doc/examples/blog/sidebar.mdwn b/doc/examples/blog/sidebar.mdwn new file mode 100644 index 000000000..f24a8e57a --- /dev/null +++ b/doc/examples/blog/sidebar.mdwn @@ -0,0 +1,9 @@ +[[Tags]]: [[!pagestats style="list" pages="./tags/*" among="./posts/*"]] + +[[Recent Comments|comments]] + +[[Archives]] + +[[!if "enabled(calendar)" then=""" +[[!calendar pages="./posts/* and !*/Discussion"]] +"""]] diff --git a/doc/ikiwiki/directive/sidebar.mdwn b/doc/ikiwiki/directive/sidebar.mdwn index 34f078672..401d7c786 100644 --- a/doc/ikiwiki/directive/sidebar.mdwn +++ b/doc/ikiwiki/directive/sidebar.mdwn @@ -1,8 +1,12 @@ The `sidebar` directive is supplied by the [[!iki plugins/sidebar desc=sidebar]] plugin. -This directive specifies a custom sidebar to display on the page, +This directive can specify a custom sidebar to display on the page, overriding any sidebar that is displayed globally. +If no custom sidebar content is specified, it forces the sidebar page to +be used as the sidebar, even if the `global_sidebars` setting has been +used to disable use of the sidebar page by default. + ## examples \[[!sidebar """ @@ -11,4 +15,6 @@ overriding any sidebar that is displayed globally. \[[!calendar pages="posts/*"]] """]] + \[[!sidebar]] + [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From 4c6f5a48bcfc2462a915387515bfa39b9239a7da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 17:50:43 -0400 Subject: fix sidebar directive parameter handling --- IkiWiki/Plugin/sidebar.pm | 6 ++---- doc/ikiwiki/directive/sidebar.mdwn | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index f706480ca..808f0bed2 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -33,13 +33,11 @@ my %pagesidebar; sub preprocess (@) { my %params=@_; - my $content=shift; - shift; my $page=$params{page}; return "" unless $page eq $params{destpage}; - if (! defined $content) { + if (! defined $params{content}) { $pagesidebar{$page}=undef; } else { @@ -50,7 +48,7 @@ sub preprocess (@) { IkiWiki::htmlize($page, $page, $type, IkiWiki::linkify($page, $page, IkiWiki::preprocess($page, $page, - IkiWiki::filter($page, $page, $content)))); + IkiWiki::filter($page, $page, $params{content})))); } return ""; diff --git a/doc/ikiwiki/directive/sidebar.mdwn b/doc/ikiwiki/directive/sidebar.mdwn index 401d7c786..599695d22 100644 --- a/doc/ikiwiki/directive/sidebar.mdwn +++ b/doc/ikiwiki/directive/sidebar.mdwn @@ -9,7 +9,7 @@ used to disable use of the sidebar page by default. ## examples - \[[!sidebar """ + \[[!sidebar content=""" This is my custom sidebar for this page. \[[!calendar pages="posts/*"]] -- cgit v1.2.3 From 50d08bc2aea1d8d52e07ae1750e73b722bd2db24 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 18:18:48 -0400 Subject: conditional: Fix bug that forced "all" mode off by default. Commit b7351daacd0d4a041a51b43d99b7bf589de54f53 introduced the bug. --- IkiWiki/Plugin/conditional.pm | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index 892b1cff9..8a5796149 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -30,7 +30,7 @@ sub preprocess_if (@) { } my $result=0; - if (! IkiWiki::yesno($params{all}) || + if ((exists $params{all} && ! IkiWiki::yesno($params{all})) || # An optimisation to avoid needless looping over every page # for simple uses of some of the tests. $params{test} =~ /^([\s\!()]*((enabled|sourcepage|destpage|included)\([^)]*\)|(and|or))[\s\!()]*)+$/) { diff --git a/debian/changelog b/debian/changelog index c379253d7..dfb94ae22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -41,6 +41,7 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low shown on a page. * Enable calendar and sidebar in auto-blog.setup. * sidebar: Add global_sidebars setting. + * conditional: Fix bug that forced "all" mode off by default. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 -- 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 'IkiWiki') 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
- $purl - $url - $nurl -
$purl$url$nurl
Months
","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else -while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else -xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/underlays/javascript/ikiwiki/openid-selector/openid-jquery.js b/underlays/javascript/ikiwiki/openid-selector/openid-jquery.js deleted file mode 100644 index f39fff842..000000000 --- a/underlays/javascript/ikiwiki/openid-selector/openid-jquery.js +++ /dev/null @@ -1,240 +0,0 @@ -/* -Simple OpenID Plugin -http://code.google.com/p/openid-selector/ - -This code is licenced under the New BSD License. -*/ - -var providers_large = { - google: { - name: 'Google', - url: 'https://www.google.com/accounts/o8/id' - }, - yahoo: { - name: 'Yahoo', - url: 'http://me.yahoo.com/' - }, - aol: { - name: 'AOL', - label: 'Enter your AOL screenname.', - url: 'http://openid.aol.com/{username}' - }, - verisign: { - name: 'Verisign', - label: 'Your Verisign username', - url: 'http://{username}.pip.verisignlabs.com/' - }, - openid: { - name: 'OpenID', - label: 'Enter your OpenID.', - url: null - } -}; -var providers_small = { - myopenid: { - name: 'MyOpenID', - label: 'Enter your MyOpenID username.', - url: 'http://{username}.myopenid.com/' - }, - livejournal: { - name: 'LiveJournal', - label: 'Enter your Livejournal username.', - url: 'http://{username}.livejournal.com/' - }, - flickr: { - name: 'Flickr', - label: 'Enter your Flickr username.', - url: 'http://flickr.com/{username}/' - }, - technorati: { - name: 'Technorati', - label: 'Enter your Technorati username.', - url: 'http://technorati.com/people/technorati/{username}/' - }, - wordpress: { - name: 'Wordpress', - label: 'Enter your Wordpress.com username.', - url: 'http://{username}.wordpress.com/' - }, - blogger: { - name: 'Blogger', - label: 'Your Blogger account', - url: 'http://{username}.blogspot.com/' - }, - vidoop: { - name: 'Vidoop', - label: 'Your Vidoop username', - url: 'http://{username}.myvidoop.com/' - }, - claimid: { - name: 'ClaimID', - label: 'Your ClaimID username', - url: 'http://claimid.com/{username}' - } -}; -var providers = $.extend({}, providers_large, providers_small); - -var openid = { - - demo: false, - ajaxHandler: null, - cookie_expires: 6*30, // 6 months. - cookie_name: 'openid_provider', - cookie_path: '/', - - img_path: 'images/', - - input_id: null, - provider_url: null, - provider_id: null, - - init: function(input_id) { - - var openid_btns = $('#openid_btns'); - - this.input_id = input_id; - - $('#openid_choice').show(); - $('#openid_input_area').empty(); - - // add box for each provider - for (id in providers_large) { - - openid_btns.append(this.getBoxHTML(providers_large[id], 'large', '.gif')); - } - if (providers_small) { - openid_btns.append('
'); - - for (id in providers_small) { - - openid_btns.append(this.getBoxHTML(providers_small[id], 'small', '.ico')); - } - } - - $('#openid_form').submit(this.submit); - - var box_id = this.readCookie(); - if (box_id) { - this.signin(box_id, true); - } - }, - getBoxHTML: function(provider, box_size, image_ext) { - - var box_id = provider["name"].toLowerCase(); - return ''; - - }, - /* Provider image click */ - signin: function(box_id, onload) { - - var provider = providers[box_id]; - if (! provider) { - return; - } - - this.highlight(box_id); - this.setCookie(box_id); - - this.provider_id = box_id; - this.provider_url = provider['url']; - - // prompt user for input? - if (provider['label']) { - this.useInputBox(provider); - } else { - $('#openid_input_area').empty(); - if (! onload) { - $('#openid_form').submit(); - } - } - }, - /* Sign-in button click */ - submit: function() { - - var url = openid.provider_url; - if (url) { - url = url.replace('{username}', $('#openid_username').val()); - openid.setOpenIdUrl(url); - } - if(openid.ajaxHandler) { - openid.ajaxHandler(openid.provider_id, document.getElementById(openid.input_id).value); - return false; - } - if(openid.demo) { - alert("In client demo mode. Normally would have submitted OpenID:\r\n" + document.getElementById(openid.input_id).value); - return false; - } - return true; - }, - setOpenIdUrl: function (url) { - - var hidden = $('#'+this.input_id); - if (hidden.length > 0) { - hidden.value = url; - } else { - $('#openid_form').append(''); - } - }, - highlight: function (box_id) { - - // remove previous highlight. - var highlight = $('#openid_highlight'); - if (highlight) { - highlight.replaceWith($('#openid_highlight a')[0]); - } - // add new highlight. - $('.'+box_id).wrap('
'); - }, - setCookie: function (value) { - - var date = new Date(); - date.setTime(date.getTime()+(this.cookie_expires*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - - document.cookie = this.cookie_name+"="+value+expires+"; path=" + this.cookie_path; - }, - readCookie: function () { - var nameEQ = this.cookie_name + "="; - var ca = document.cookie.split(';'); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; - }, - useInputBox: function (provider) { - - var input_area = $('#openid_input_area'); - - var html = ''; - var id = 'openid_username'; - var value = ''; - var label = provider['label']; - var style = ''; - - if (label) { - html = '

' + label + '

'; - } - if (provider['name'] == 'OpenID') { - id = this.input_id; - value = 'http://'; - style = 'background:#FFF url('+this.img_path+'openid-inputicon.gif) no-repeat scroll 0 50%; padding-left:18px;'; - } - html += '' + - ''; - - input_area.empty(); - input_area.append(html); - - $('#'+id).focus(); - }, - setDemoMode: function (demoMode) { - this.demo = demoMode; - }, - setAjaxHandler: function (ajaxFunction) { - this.ajaxHandler = ajaxFunction; - } -}; diff --git a/underlays/openid-selector/ikiwiki/openid/jquery.js b/underlays/openid-selector/ikiwiki/openid/jquery.js new file mode 100644 index 000000000..82b98e1d7 --- /dev/null +++ b/underlays/openid-selector/ikiwiki/openid/jquery.js @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js new file mode 100644 index 000000000..f39fff842 --- /dev/null +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -0,0 +1,240 @@ +/* +Simple OpenID Plugin +http://code.google.com/p/openid-selector/ + +This code is licenced under the New BSD License. +*/ + +var providers_large = { + google: { + name: 'Google', + url: 'https://www.google.com/accounts/o8/id' + }, + yahoo: { + name: 'Yahoo', + url: 'http://me.yahoo.com/' + }, + aol: { + name: 'AOL', + label: 'Enter your AOL screenname.', + url: 'http://openid.aol.com/{username}' + }, + verisign: { + name: 'Verisign', + label: 'Your Verisign username', + url: 'http://{username}.pip.verisignlabs.com/' + }, + openid: { + name: 'OpenID', + label: 'Enter your OpenID.', + url: null + } +}; +var providers_small = { + myopenid: { + name: 'MyOpenID', + label: 'Enter your MyOpenID username.', + url: 'http://{username}.myopenid.com/' + }, + livejournal: { + name: 'LiveJournal', + label: 'Enter your Livejournal username.', + url: 'http://{username}.livejournal.com/' + }, + flickr: { + name: 'Flickr', + label: 'Enter your Flickr username.', + url: 'http://flickr.com/{username}/' + }, + technorati: { + name: 'Technorati', + label: 'Enter your Technorati username.', + url: 'http://technorati.com/people/technorati/{username}/' + }, + wordpress: { + name: 'Wordpress', + label: 'Enter your Wordpress.com username.', + url: 'http://{username}.wordpress.com/' + }, + blogger: { + name: 'Blogger', + label: 'Your Blogger account', + url: 'http://{username}.blogspot.com/' + }, + vidoop: { + name: 'Vidoop', + label: 'Your Vidoop username', + url: 'http://{username}.myvidoop.com/' + }, + claimid: { + name: 'ClaimID', + label: 'Your ClaimID username', + url: 'http://claimid.com/{username}' + } +}; +var providers = $.extend({}, providers_large, providers_small); + +var openid = { + + demo: false, + ajaxHandler: null, + cookie_expires: 6*30, // 6 months. + cookie_name: 'openid_provider', + cookie_path: '/', + + img_path: 'images/', + + input_id: null, + provider_url: null, + provider_id: null, + + init: function(input_id) { + + var openid_btns = $('#openid_btns'); + + this.input_id = input_id; + + $('#openid_choice').show(); + $('#openid_input_area').empty(); + + // add box for each provider + for (id in providers_large) { + + openid_btns.append(this.getBoxHTML(providers_large[id], 'large', '.gif')); + } + if (providers_small) { + openid_btns.append('
'); + + for (id in providers_small) { + + openid_btns.append(this.getBoxHTML(providers_small[id], 'small', '.ico')); + } + } + + $('#openid_form').submit(this.submit); + + var box_id = this.readCookie(); + if (box_id) { + this.signin(box_id, true); + } + }, + getBoxHTML: function(provider, box_size, image_ext) { + + var box_id = provider["name"].toLowerCase(); + return ''; + + }, + /* Provider image click */ + signin: function(box_id, onload) { + + var provider = providers[box_id]; + if (! provider) { + return; + } + + this.highlight(box_id); + this.setCookie(box_id); + + this.provider_id = box_id; + this.provider_url = provider['url']; + + // prompt user for input? + if (provider['label']) { + this.useInputBox(provider); + } else { + $('#openid_input_area').empty(); + if (! onload) { + $('#openid_form').submit(); + } + } + }, + /* Sign-in button click */ + submit: function() { + + var url = openid.provider_url; + if (url) { + url = url.replace('{username}', $('#openid_username').val()); + openid.setOpenIdUrl(url); + } + if(openid.ajaxHandler) { + openid.ajaxHandler(openid.provider_id, document.getElementById(openid.input_id).value); + return false; + } + if(openid.demo) { + alert("In client demo mode. Normally would have submitted OpenID:\r\n" + document.getElementById(openid.input_id).value); + return false; + } + return true; + }, + setOpenIdUrl: function (url) { + + var hidden = $('#'+this.input_id); + if (hidden.length > 0) { + hidden.value = url; + } else { + $('#openid_form').append(''); + } + }, + highlight: function (box_id) { + + // remove previous highlight. + var highlight = $('#openid_highlight'); + if (highlight) { + highlight.replaceWith($('#openid_highlight a')[0]); + } + // add new highlight. + $('.'+box_id).wrap('
'); + }, + setCookie: function (value) { + + var date = new Date(); + date.setTime(date.getTime()+(this.cookie_expires*24*60*60*1000)); + var expires = "; expires="+date.toGMTString(); + + document.cookie = this.cookie_name+"="+value+expires+"; path=" + this.cookie_path; + }, + readCookie: function () { + var nameEQ = this.cookie_name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; + }, + useInputBox: function (provider) { + + var input_area = $('#openid_input_area'); + + var html = ''; + var id = 'openid_username'; + var value = ''; + var label = provider['label']; + var style = ''; + + if (label) { + html = '

' + label + '

'; + } + if (provider['name'] == 'OpenID') { + id = this.input_id; + value = 'http://'; + style = 'background:#FFF url('+this.img_path+'openid-inputicon.gif) no-repeat scroll 0 50%; padding-left:18px;'; + } + html += '' + + ''; + + input_area.empty(); + input_area.append(html); + + $('#'+id).focus(); + }, + setDemoMode: function (demoMode) { + this.demo = demoMode; + }, + setAjaxHandler: function (ajaxFunction) { + this.ajaxHandler = ajaxFunction; + } +}; -- cgit v1.2.3 From c1e365abdc8b89acc4d52b2bb3773b16ae722b8b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:20:21 -0400 Subject: remove loginlabel, not used --- IkiWiki/Plugin/openid.pm | 5 ----- 1 file changed, 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index e722c68ba..0454a43fa 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -87,7 +87,6 @@ sub openid_selector { (defined $openid_error ? (openid_error => $openid_error) : ()), (defined $openid_url ? (openid_url => $openid_url) : ()), ($real_cgi_signin ? (nonopenidurl => IkiWiki::cgiurl(do => "signin")) : ()), - loginlabel => loginlabel(), ); IkiWiki::printheader($session); @@ -258,8 +257,4 @@ sub load_openid_module { return 1; } -sub loginlabel { - return gettext("Log in with")." ".htmllink("", "", "ikiwiki/OpenID", noimageinline => 1); -} - 1 -- cgit v1.2.3 From dc0d48459cfc0dc53301b87c2fc98216f4dcca06 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:27:02 -0400 Subject: bugfix --- IkiWiki/Plugin/openid.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 0454a43fa..427d61457 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -68,6 +68,7 @@ sub openid_selector { if (! load_openid_module()) { if ($real_cgi_signin) { $real_cgi_signin->($q, $session); + exit; } error(sprintf(gettext("failed to load openid module: "), @_)); } -- cgit v1.2.3 From 1e75389a856c8ab8e233b81fd3310169cbe8d57e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:28:59 -0400 Subject: bugfix Always load IkiWiki::CGI so its cgi_signin is present, so we replace it. --- IkiWiki/Plugin/openid.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 427d61457..7e4d0844a 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -23,9 +23,9 @@ sub checkconfig () { # # When other auth hooks are registered, give the selector # a reference to the normal signin form. + require IkiWiki::CGI; my $real_cgi_signin; if (keys %{$IkiWiki::hooks{auth}} > 1) { - require IkiWiki::CGI; $real_cgi_signin=\&IkiWiki::cgi_signin; } inject(name => "IkiWiki::cgi_signin", call => sub ($$) { -- cgit v1.2.3 From 8f6cfbfade6018732495addce11f6d5e93e0b723 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:33:27 -0400 Subject: Removed the openidsignup option. --- IkiWiki/Plugin/openid.pm | 15 --------------- debian/changelog | 1 + doc/plugins/openid.mdwn | 12 ------------ 3 files changed, 1 insertion(+), 27 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 7e4d0844a..36002371a 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -9,7 +9,6 @@ use IkiWiki 3.00; sub import { add_underlay("openid-selector"); hook(type => "checkconfig", id => "openid", call => \&checkconfig); - hook(type => "getopt", id => "openid", call => \&getopt); hook(type => "getsetup", id => "openid", call => \&getsetup); hook(type => "auth", id => "openid", call => \&auth); hook(type => "formbuilder_setup", id => "openid", @@ -34,13 +33,6 @@ sub checkconfig () { } } -sub getopt () { - eval q{use Getopt::Long}; - error($@) if $@; - Getopt::Long::Configure('pass_through'); - GetOptions("openidsignup=s" => \$config{openidsignup}); -} - sub getsetup () { return plugin => { @@ -48,13 +40,6 @@ sub getsetup () { rebuild => 0, section => "auth", }, - openidsignup => { - type => "string", - example => "http://myopenid.com/", - description => "an url where users can signup for an OpenID", - safe => 1, - rebuild => 0, - }, } sub openid_selector { diff --git a/debian/changelog b/debian/changelog index 3f20aec1a..595b8a2b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low (http://code.google.com/p/openid-selector/) * openid: Use "openid_identifier" as the form field, as required by OpenID Authentication v2.0 spec. + * Removed the openidsignup option. -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index cd05bb1ad..7da2f8575 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -11,17 +11,5 @@ The [[!cpan LWPx::ParanoidAgent]] perl module is used if available, for added security. Finally, the [[!cpan Crypt::SSLeay]] perl module is needed to support users entering "https" OpenID urls. -This plugin has a configuration option. You can set `--openidsignup` -to the url of a third-party site where users can sign up for an OpenID. If -it's set, the signin page will link to that site. - -This plugin supports the -[myopenid.com affiliate program](http://myopenid.com/affiliate), -which can be used to help users sign up for an OpenID and log into your -site in a single, unified process. When you create the affiliate, specify a -login url like `http://example.com/ikiwiki.cgi?do=continue`. Once the -affiliate is created, set `openidsignup` to point to the affiliate's signup -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]]. -- cgit v1.2.3 From b8dcaf91d02c1d8754032c60f8d713261dafffe4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:48:50 -0400 Subject: scale display form to match openid size --- IkiWiki/Plugin/openid.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 36002371a..d75099ce9 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -92,7 +92,7 @@ sub formbuilder_setup (@) { $form->field(name => "openid_identifier", disabled => 1, label => htmllink("", "", "ikiwiki/OpenID", noimageinline => 1), value => $session->param("name"), - size => 50, force => 1, + size => length($session->param("name")), force => 1, fieldset => "login"); $form->field(name => "email", type => "hidden"); } -- cgit v1.2.3 From 0f778849c6df237f2219de6e1fa237cf2bc9955f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 12:45:21 -0400 Subject: calendar: Allow negative month to be specified. -1 is last month, etc. (And also negaitve years.) --- IkiWiki/Plugin/calendar.pm | 27 +++++++++++++++++++++++---- debian/changelog | 2 ++ doc/ikiwiki/directive/calendar.mdwn | 6 +++--- doc/plugins/calendar/discussion.mdwn | 11 ++++++++++- 4 files changed, 38 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index aeb5f3d29..02f41070e 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -386,8 +386,19 @@ sub preprocess (@) { $params{year} = $thisyear unless defined $params{year}; $params{month} = $thismonth unless defined $params{month}; + my $relativemonth=0; + if ($params{month} < 1) { + $params{month}=$thismonth+$params{month}; + $relativemonth=1; + } + my $relativeyear=0; + if ($params{year} < 1) { + $params{year}=$thisyear+$params{year}; + $relativeyear=1; + } + $params{month} = sprintf("%02d", $params{month}); - + if ($params{type} eq 'month' && $params{year} == $thisyear && $params{month} == $thismonth) { # calendar for current month, updates next midnight @@ -404,8 +415,11 @@ sub preprocess (@) { $pagestate{$params{destpage}}{calendar}{nextchange}= timelocal(0, 0, 0, 1, $params{month}-1, $params{year}); } - elsif ($params{type} eq 'year' && $params{year} == $thisyear) { - # calendar for current year, updates 1st of next month + elsif (($params{type} eq 'year' && $params{year} == $thisyear) || + $relativemonth) { + # Calendar for current year updates 1st of next month. + # Any calendar relative to the current month also updates + # then. if ($thismonth < 12) { $pagestate{$params{destpage}}{calendar}{nextchange}= timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year}); @@ -415,6 +429,12 @@ sub preprocess (@) { timelocal(0, 0, 0, 1, 1-1, $params{year}+1); } } + elsif ($relativeyear) { + # Any calendar relative to the current year updates 1st + # of next year. + $pagestate{$params{destpage}}{calendar}{nextchange}= + timelocal(0, 0, 0, 1, 1-1, $thisyear+1); + } elsif ($params{type} eq 'year' && $params{year} > $thisyear) { # calendar for upcoming year, updates 1st of that year $pagestate{$params{destpage}}{calendar}{nextchange}= @@ -426,7 +446,6 @@ sub preprocess (@) { delete $pagestate{$params{destpage}}{calendar}; } - # Calculate month names for next month, and previous months my $calendar=""; if ($params{type} eq 'month') { $calendar=format_month(%params); diff --git a/debian/changelog b/debian/changelog index f74e9929f..795f02822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,8 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low leave passwordauth enabled and let people who don't have an openid use it. The openid selector form avoids the UI annoyance of having both openid and passwordauth on one form. + * calendar: Allow negative month to be specified. -1 is last month, etc. + (And also negaitve years.) -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn index 198da9d51..e9216e11f 100644 --- a/doc/ikiwiki/directive/calendar.mdwn +++ b/doc/ikiwiki/directive/calendar.mdwn @@ -47,14 +47,14 @@ An example crontab: "2010". These pages can be automatically created using the `ikiwiki-calendar` program. * `year` - The year for which the calendar is requested. Defaults to the - current year. + current year. Can also use -1 to refer to last year, and so on. * `month` - The numeric month for which the calendar is requested, in the range 1..12. Used only for the month view calendar, and defaults to the - current month. + current month. Can also use -1 to refer to last month, and so on. * `week_start_day` - A number, in the range 0..6, which represents the day of the week that the month calendar starts with. 0 is Sunday, 1 is Monday, and so on. Defaults to 0, which is Sunday. -* `months_per_row` - In the annual calendar, number of months to place in +* `months_per_row` - In the year calendar, number of months to place in each row. Defaults to 3. [[!meta robots="noindex, follow"]] diff --git a/doc/plugins/calendar/discussion.mdwn b/doc/plugins/calendar/discussion.mdwn index 9d57b7a1e..bb76a9d8b 100644 --- a/doc/plugins/calendar/discussion.mdwn +++ b/doc/plugins/calendar/discussion.mdwn @@ -1,6 +1,15 @@ It would be nice if the "month" type calendar could collect all of the matching pages on a given date in some inline type way. --[[DavidBremner]] +> I agree, but I have not come up with good html to display them. Seems +> it might need some sort of popup. + Is it possible to get the calendar to link to pages based not on their timestamp (as I understand that it does now, or have I misunderstood this?) and instead on for example their location in a directory hierarchy. That way the calendar could be used as a planning / timeline device which I think would be great. --[[Alexander]] -I would like the ability to specify relative previous months. This way I could have a sidebar with the last three months by specifying no month, then 'month="-1"' and 'month="-2"'. Negative numbers for the month would otherwise be invalid, so this shouldn't produce any conflicts with expected behavior. (Right?) -- [[StevenBlack]] +I would like the ability to specify relative previous months. This way I +could have a sidebar with the last three months by specifying no month, +then 'month="-1"' and 'month="-2"'. Negative numbers for the month would +otherwise be invalid, so this shouldn't produce any conflicts with expected +behavior. (Right?) -- [[StevenBlack]] + +> Great idea! Just implemented that and also relative years. --[[Joey]] -- cgit v1.2.3 From fd817f9ac3c074622fe7076516dca61199b09372 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 12:52:19 -0400 Subject: calendar: nextchange calculation bugfix If a page had multiple calendars, the last one won and set nextchange. That's wrong; the calendar that needs to next update soonest should win. --- IkiWiki/Plugin/calendar.pm | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 02f41070e..d43320cac 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -373,6 +373,16 @@ EOF return $calendar; } +sub setnextchange ($$) { + my $page=shift; + my $timestamp=shift; + + if (! exists $pagestate{$page}{calendar}{nextchange} || + $pagestate{$page}{calendar}{nextchange} > $timestamp) { + $pagestate{$page}{calendar}{nextchange}=$timestamp; + } +} + sub preprocess (@) { my %params=@_; @@ -402,18 +412,18 @@ sub preprocess (@) { if ($params{type} eq 'month' && $params{year} == $thisyear && $params{month} == $thismonth) { # calendar for current month, updates next midnight - $pagestate{$params{destpage}}{calendar}{nextchange}=($time + setnextchange($params{destpage}, ($time + (60 - $now[0]) # seconds + (59 - $now[1]) * 60 # minutes + (23 - $now[2]) * 60 * 60 # hours - ); + )); } elsif ($params{type} eq 'month' && (($params{year} == $thisyear && $params{month} > $thismonth) || $params{year} > $thisyear)) { # calendar for upcoming month, updates 1st of that month - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, $params{month}-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, $params{month}-1, $params{year})); } elsif (($params{type} eq 'year' && $params{year} == $thisyear) || $relativemonth) { @@ -421,24 +431,24 @@ sub preprocess (@) { # Any calendar relative to the current month also updates # then. if ($thismonth < 12) { - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, $thismonth+1-1, $params{year})); } else { - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $params{year}+1); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $params{year}+1)); } } elsif ($relativeyear) { # Any calendar relative to the current year updates 1st # of next year. - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $thisyear+1); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $thisyear+1)); } elsif ($params{type} eq 'year' && $params{year} > $thisyear) { # calendar for upcoming year, updates 1st of that year - $pagestate{$params{destpage}}{calendar}{nextchange}= - timelocal(0, 0, 0, 1, 1-1, $params{year}); + setnextchange($params{destpage}, + timelocal(0, 0, 0, 1, 1-1, $params{year})); } else { # calendar for past month or year, does not need -- cgit v1.2.3 From d0c17a4a46b48d8513c0167271f2f2eb8b9bc081 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 13:51:05 -0400 Subject: calendar: Display year name in title of month calendar. Also, fix relative month calculations. --- IkiWiki/Plugin/calendar.pm | 21 +++++++++++++-------- debian/changelog | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index d43320cac..0bf933dcd 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -132,12 +132,12 @@ sub format_month (@) { $archivebase = $params{archivebase} if defined $params{archivebase}; # Calculate URL's for monthly archives. - my ($url, $purl, $nurl)=("$monthname",'',''); + my ($url, $purl, $nurl)=("$monthname $params{year}",'',''); if (exists $pagesources{"$archivebase/$params{year}/$params{month}"}) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/".$params{month}, noimageinline => 1, - linktext => $monthname, + linktext => "$monthname $params{year}", title => $monthname); } add_depends($params{page}, "$archivebase/$params{year}/$params{month}", @@ -396,15 +396,20 @@ sub preprocess (@) { $params{year} = $thisyear unless defined $params{year}; $params{month} = $thismonth unless defined $params{month}; - my $relativemonth=0; - if ($params{month} < 1) { - $params{month}=$thismonth+$params{month}; - $relativemonth=1; - } my $relativeyear=0; if ($params{year} < 1) { - $params{year}=$thisyear+$params{year}; $relativeyear=1; + $params{year}=$thisyear+$params{year}; + } + my $relativemonth=0; + if ($params{month} < 1) { + $relativemonth=1; + my $monthoff=$params{month}; + $params{month}=($thismonth+$monthoff) % 12; + $params{month}=12 if $params{month}==0; + my $yearoff=POSIX::ceil(($thismonth-$params{month}) / -12) + - int($monthoff / 12); + $params{year}-=$yearoff; } $params{month} = sprintf("%02d", $params{month}); diff --git a/debian/changelog b/debian/changelog index 795f02822..f47793477 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,7 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low and passwordauth on one form. * calendar: Allow negative month to be specified. -1 is last month, etc. (And also negaitve years.) + * calendar: Display year name in title of month calendar. -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 -- cgit v1.2.3 From c3e9215e1fcb604c3ee01119fdf7cf13724c3812 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 15:57:39 -0400 Subject: moved non-openid signin form into same page as openid selector; show/hide as buttons are pressed --- IkiWiki/CGI.pm | 23 ++++++++++++---- IkiWiki/Plugin/openid.pm | 6 +---- templates/openid-selector.tmpl | 31 ++++++++++++---------- .../ikiwiki/openid/openid-jquery.js | 27 ++++++++++++++----- 4 files changed, 57 insertions(+), 30 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 49a505514..b98e9e0a1 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -22,7 +22,7 @@ sub printheader ($) { } } -sub showform ($$$$;@) { +sub prepform { my $form=shift; my $buttons=shift; my $session=shift; @@ -35,6 +35,16 @@ sub showform ($$$$;@) { }); } + return $form; +} + +sub showform ($$$$;@) { + my $form=prepform(@_); + shift; + my $buttons=shift; + my $session=shift; + my $cgi=shift; + printheader($session); print misctemplate($form->title, $form->render(submit => $buttons), @_); } @@ -90,9 +100,10 @@ sub needsignin ($$) { } } -sub cgi_signin ($$) { +sub cgi_signin ($$;$) { my $q=shift; my $session=shift; + my $returnhtml=shift; decode_cgi_utf8($q); eval q{use CGI::FormBuilder}; @@ -112,9 +123,6 @@ sub cgi_signin ($$) { ); my $buttons=["Login"]; - if ($q->param("do") ne "signin" && !$form->submitted) { - $form->text(gettext("You need to log in first.")); - } $form->field(name => "do", type => "hidden", value => "signin", force => 1); @@ -129,6 +137,11 @@ sub cgi_signin ($$) { $form->validate; } + if ($returnhtml) { + $form=prepform($form, $buttons, $session, $q); + return $form->render(submit => $buttons); + } + showform($form, $buttons, $session, $q); } diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index d75099ce9..e10e21f4d 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -62,17 +62,13 @@ sub openid_selector { $openid_error=shift; }); } - elsif ($q->param("do") eq "signin" && $real_cgi_signin) { - $real_cgi_signin->($q, $session); - exit; - } my $template=IkiWiki::template("openid-selector.tmpl"); $template->param( cgiurl => $config{cgiurl}, (defined $openid_error ? (openid_error => $openid_error) : ()), (defined $openid_url ? (openid_url => $openid_url) : ()), - ($real_cgi_signin ? (nonopenidurl => IkiWiki::cgiurl(do => "signin")) : ()), + ($real_cgi_signin ? (nonopenidform => $real_cgi_signin->($q, $session, 1)) : ()), ); IkiWiki::printheader($session); diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl index 7e5ae9a01..b4d0e314f 100644 --- a/templates/openid-selector.tmpl +++ b/templates/openid-selector.tmpl @@ -2,21 +2,18 @@ - + + +
Select your account provider - -
- +
@@ -29,9 +26,15 @@ $(document).ready(function() {
- + +
+ +
+ +
+ +
diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js index 59a59c084..bf14fd3d5 100644 --- a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -82,8 +82,9 @@ var openid = { input_id: null, provider_url: null, provider_id: null, + localsignin_id: null, - init: function(input_id, localloginurl) { + init: function(input_id, localsignin_id) { var openid_btns = $('#openid_btns'); @@ -105,13 +106,14 @@ var openid = { openid_btns.append(this.getBoxHTML(providers_small[id], 'small')); } } - if (localloginurl != "") { + if (localsignin_id != "") { + this.localsignin_id=localsignin_id; openid_btns.append( - '' + + 'class="localsignin openid_small_btn">' + '' + - ' Local Account' + + ' other' + '' ); } @@ -143,7 +145,20 @@ var openid = { }, /* Provider image click */ signin: function(box_id, onload) { - + + if (box_id == 'localsignin') { + this.highlight(box_id); + $('#openid_input_area').empty(); + $('#'+this.localsignin_id).show(); + this.setCookie(box_id); + return; + } + else { + if (this.localsignin_id) { + $('#'+this.localsignin_id).hide(); + } + } + var provider = providers[box_id]; if (! provider) { return; -- cgit v1.2.3 From bc0aa4d40e10238f6b83e285869caab3dfeca395 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 19:45:02 -0400 Subject: Use xhtml friendly pubdate setting. --- IkiWiki.pm | 2 +- IkiWiki/Plugin/relativedate.pm | 2 +- debian/changelog | 1 + ...lement__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index d76b5edb4..33e4e1d1f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) { my $time=formattime($_[0], $_[1]); if ($config{html5}) { return ''; } else { diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index fe8ef0901..179f9238c 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) { if ($config{html5}) { return ''; } else { return ''; diff --git a/debian/changelog b/debian/changelog index 730cae1e2..e6c5e42ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,7 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low * calendar: Allow negative month to be specified. -1 is last month, etc. (And also negative years.) * calendar: Display year in title of month calendar. + * Use xhtml friendly pubdate setting. -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 diff --git a/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn b/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn index 2dd0d945f..1f6bdb333 100644 --- a/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn +++ b/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn @@ -6,6 +6,9 @@ XML error: The pubdate REQUIRES a date, so e.g. `pubdate="2009-03-24T18:02:14Z"` +> No, `pubdate="pubdate"`. It's a boolean attribute. applied && [[done]] +> --[[Joey]] + Otherwise the XML parser chokes. -- cgit v1.2.3 From 031da9c134fca2c6d689f343ac0b4a537b4cfd15 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 May 2010 16:28:09 -0400 Subject: po: guard against reimportation If po is imported twice, bad things happen. Guard against that. I'm not sure what causes the double import; I saw it when websetup did a wiki rebuild. Carp failed to show a backtrace for the second call to import. --- IkiWiki/Plugin/po.pm | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 7c979ebca..990847b48 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -51,18 +51,20 @@ 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; - inject(name => "IkiWiki::targetpage", call => \&mytargetpage); - $origsubs{'urlto'}=\&IkiWiki::urlto; - inject(name => "IkiWiki::urlto", call => \&myurlto); - $origsubs{'cgiurl'}=\&IkiWiki::cgiurl; - inject(name => "IkiWiki::cgiurl", call => \&mycgiurl); - $origsubs{'rootpage'}=\&IkiWiki::rootpage; - inject(name => "IkiWiki::rootpage", call => \&myrootpage); + if (! %origsubs) { + $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; + inject(name => "IkiWiki::targetpage", call => \&mytargetpage); + $origsubs{'urlto'}=\&IkiWiki::urlto; + inject(name => "IkiWiki::urlto", call => \&myurlto); + $origsubs{'cgiurl'}=\&IkiWiki::cgiurl; + inject(name => "IkiWiki::cgiurl", call => \&mycgiurl); + $origsubs{'rootpage'}=\&IkiWiki::rootpage; + inject(name => "IkiWiki::rootpage", call => \&myrootpage); + } } -- cgit v1.2.3 From 8ff761afa24febdb280c672b3b31d6145990f050 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 14:21:45 -0400 Subject: remove, rename: Add guards against XSRF attacks. --- IkiWiki/Plugin/remove.pm | 4 ++++ IkiWiki/Plugin/rename.pm | 4 ++++ debian/changelog | 1 + 3 files changed, 9 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index a46294e78..d23b2cc10 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -107,6 +107,8 @@ sub confirmation_form ($$) { fields => [qw{do page}], ); + $f->field(name => "sid", type => "hidden", value => $session->id, + force => 1); $f->field(name => "do", type => "hidden", value => "remove", force => 1); return $f, ["Remove", "Cancel"]; @@ -188,6 +190,8 @@ sub sessioncgi ($$) { postremove($session); } elsif ($form->submitted eq 'Remove' && $form->validate) { + IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); + my @pages=$form->field("page"); # Validate removal by checking that the page exists, diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 537e91317..0da90a538 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -131,6 +131,8 @@ sub rename_form ($$$) { ); $f->field(name => "do", type => "hidden", value => "rename", force => 1); + $f->field(name => "sid", type => "hidden", value => $session->id, + force => 1); $f->field(name => "page", type => "hidden", value => $page, force => 1); $f->field(name => "new_name", value => pagetitle($page, 1), size => 60); if (!$q->param("attachment")) { @@ -286,6 +288,8 @@ sub sessioncgi ($$) { postrename($session); } elsif ($form->submitted eq 'Rename' && $form->validate) { + IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); + # Queue of rename actions to perfom. my @torename; diff --git a/debian/changelog b/debian/changelog index e6c5e42ae..a09c8e228 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low (And also negative years.) * calendar: Display year in title of month calendar. * Use xhtml friendly pubdate setting. + * remove, rename: Add guards against XSRF attacks. -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 -- cgit v1.2.3 From 5a4c95cc352d6895c11542245981c62a5c003370 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:04:02 -0400 Subject: enable action bar on misctemplates So RecentChanges shows on the action bar there, convert recentchanges to use new pageactions hook, with compatability code to avoid breaking old templates. --- IkiWiki.pm | 11 ++++++++++- IkiWiki/Plugin/recentchanges.pm | 18 ++++++++++++++++-- templates/page.tmpl | 3 --- 3 files changed, 26 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 33e4e1d1f..46c29abe3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1748,7 +1748,6 @@ sub misctemplate ($$;@) { $template->param( dynamic => 1, - have_actions => 0, # force off title => $title, wikiname => $config{wikiname}, content => $content, @@ -1756,6 +1755,16 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); + + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => ""); + }); + $template->param(actions => \@actions); + if (@actions) { + $template->param(have_actions => 1); + } return $template->output; } diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 5c7b71aaa..65044080f 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,6 +11,7 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); + hook(type => "pageactions", id => "recentchanges", call => \&pageactions); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -61,14 +62,27 @@ sub refresh ($) { } # Enable the recentchanges link on wiki pages. +sub pageactions (@) { + my %params=@_; + my $page=$params{page}; + + if (defined $config{recentchangespage} && $config{rcs} && + $page ne $config{recentchangespage}) { + return htmllink($page, $page, $config{recentchangespage}, + gettext("RecentChanges")); + } +} + +# Backwards compatability for templates still using +# RECENTCHANGESURL. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; my $page=$params{page}; if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage} && - $template->query(name => "recentchangesurl")) { + $template->query(name => "recentchangesurl") && + $page ne $config{recentchangespage}) { $template->param(recentchangesurl => urlto($config{recentchangespage}, $page)); $template->param(have_actions => 1); } diff --git a/templates/page.tmpl b/templates/page.tmpl index 3bb7197f0..049d31ad5 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,9 +61,6 @@
  • Edit
  • - -
  • RecentChanges
  • -
  • History
  • -- cgit v1.2.3 From 377e82b16c95833a37c1f87e57122e8b44c187cb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:10:18 -0400 Subject: we want the recentchanges link to be the first floating action --- IkiWiki/Plugin/recentchanges.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 65044080f..7eba931be 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,7 +11,8 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); - hook(type => "pageactions", id => "recentchanges", call => \&pageactions); + hook(type => "pageactions", id => "recentchanges", call => \&pageactions, + first => 1); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges -- cgit v1.2.3 From bbe971881a7a3c03dfdb5312215c434e35eff94e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:20:41 -0400 Subject: refactor template actions --- IkiWiki.pm | 22 ++++++++++++++++++---- IkiWiki/Render.pm | 18 +++--------------- 2 files changed, 21 insertions(+), 19 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 46c29abe3..a42f56bf0 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1755,18 +1755,32 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); + + templateactions($template, ""); + return $template->output; +} + +sub templateactions ($$) { + my $template=shift; + my $page=shift; + + my $have_actions=0; my @actions; run_hooks(pageactions => sub { push @actions, map { { action => $_ } } - grep { defined } shift->(page => ""); + grep { defined } shift->(page => $page); }); $template->param(actions => \@actions); - if (@actions) { - $template->param(have_actions => 1); + + if ($config{cgiurl} && exists $hooks{auth}) { + $template->param(prefsurl => cgiurl(do => "prefs")); + $have_actions=1; } - return $template->output; + if ($have_actions || @actions) { + $template->param(have_actions => 1); + } } sub hook (@) { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 8b1b9aef4..833fcaaff 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -84,19 +84,14 @@ sub genpage ($$) { $template=template('page.tmpl', blind_cache => 1); } - my $actions=0; + my $actions=0; if (length $config{cgiurl}) { if (IkiWiki->can("cgi_editpage")) { $template->param(editurl => cgiurl(do => "edit", page => $page)); $actions++; } - if (exists $hooks{auth}) { - $template->param(prefsurl => cgiurl(do => "prefs")); - $actions++; - } } - if (defined $config{historyurl} && length $config{historyurl}) { my $u=$config{historyurl}; $u=~s/\[\[file\]\]/$pagesources{$page}/g; @@ -111,17 +106,10 @@ sub genpage ($$) { $actions++; } } - - my @actions; - run_hooks(pageactions => sub { - push @actions, map { { action => $_ } } - grep { defined } shift->(page => $page); - }); - $template->param(actions => \@actions); - - if ($actions || @actions) { + if ($actions) { $template->param(have_actions => 1); } + templateactions($template, $page); my @backlinks=sort { $a->{page} cmp $b->{page} } backlinks($page); my ($backlinks, $more_backlinks); -- cgit v1.2.3 From d80a649073ecabe70870fbe01dfcdf6fc8735201 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:29:16 -0400 Subject: bugfix --- IkiWiki/Plugin/recentchanges.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 7eba931be..0ee8f0e66 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -70,7 +70,7 @@ sub pageactions (@) { if (defined $config{recentchangespage} && $config{rcs} && $page ne $config{recentchangespage}) { return htmllink($page, $page, $config{recentchangespage}, - gettext("RecentChanges")); + linktext => gettext("RecentChanges")); } } -- cgit v1.2.3 From 3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:38:08 -0400 Subject: put back recentchangesurl On second thought, misctemplate can use pagetemplate hooks to provide it, so it's better to keep back-compat, and allow full customisation of how it's displayed via the template. --- IkiWiki/Plugin/recentchanges.pm | 17 +---------------- templates/page.tmpl | 3 +++ 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 0ee8f0e66..e546e4702 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,8 +11,6 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); - hook(type => "pageactions", id => "recentchanges", call => \&pageactions, - first => 1); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -62,20 +60,7 @@ sub refresh ($) { } } -# Enable the recentchanges link on wiki pages. -sub pageactions (@) { - my %params=@_; - my $page=$params{page}; - - if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage}) { - return htmllink($page, $page, $config{recentchangespage}, - linktext => gettext("RecentChanges")); - } -} - -# Backwards compatability for templates still using -# RECENTCHANGESURL. +# Enable the recentchanges link. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; diff --git a/templates/page.tmpl b/templates/page.tmpl index 049d31ad5..3bb7197f0 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,6 +61,9 @@
  • Edit
  • + +
  • RecentChanges
  • +
  • History
  • -- cgit v1.2.3 From f69c072d8aad7ad68547f17bf60bd804542b064f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:40:30 -0400 Subject: better misctemplate splitting sequence --- IkiWiki/Plugin/websetup.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 9cb5eb13c..c4b75c4b3 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -450,8 +450,8 @@ sub showform ($$) { IkiWiki::unlockwiki(); # Print the top part of a standard misctemplate, - # then show the rebuild or refresh. - my $divider="xxx"; + # then show the rebuild or refresh, live. + my $divider="\0"; my $html=IkiWiki::misctemplate("setup", $divider); IkiWiki::printheader($session); my ($head, $tail)=split($divider, $html, 2); -- cgit v1.2.3 From 4c6fa6413fc26ddbb1f8dc2c73f97a105c5002f8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:42:48 -0400 Subject: avoid showing redundant search box on search results page --- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index cc26b7ac1..a9089620b 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -228,7 +228,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. - my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0"); + my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", + searching => 1); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index f7944e40e..a7d200466 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,9 +48,11 @@ + +
    -- cgit v1.2.3 From c8b34aa31c7d146adf4210c6171dfea2988a7688 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:45:22 -0400 Subject: allow misctemplate callers to pass params to suppress actions etc Suppress disiplay of small search for on search results page, and of Prefrences link on prefs page. --- IkiWiki.pm | 3 +-- IkiWiki/CGI.pm | 4 +++- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index a42f56bf0..699ad13da 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1745,6 +1745,7 @@ sub misctemplate ($$;@) { run_hooks(pagetemplate => sub { shift->(page => "", destpage => "", template => $template); }); + templateactions($template, ""); $template->param( dynamic => 1, @@ -1755,8 +1756,6 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); - - templateactions($template, ""); return $template->output; } diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b98e9e0a1..28020b500 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -247,7 +247,9 @@ sub cgi_prefs ($$) { $form->text(gettext("Preferences saved.")); } - showform($form, $buttons, $session, $q); + showform($form, $buttons, $session, $q, + prefsurl => "", # avoid showing the preferences link + ); } sub cgi_custom_failure ($$$) { diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index a9089620b..ff5d0ccbe 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -229,7 +229,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", - searching => 1); + searchform => "", # avoid showing the small search form + ); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index a7d200466..f7944e40e 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,11 +48,9 @@ - -
    -- cgit v1.2.3 From 4a6d5330e5b9554f1bd25b9025dd96200c6519c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 May 2010 22:28:07 -0400 Subject: avoid showing comment post stuff on dynamic pages If the site is configured to allow comments on *, then the comment post interface was being added to cgi pages like signin and prefs. This fixes it w/o requiring more page.tmpl changes. The pagetemplate hook is called by misctemplate with an empty page name for dynamic pages. --- IkiWiki/Plugin/comments.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 3cafcbe9c..af7e7eccd 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -742,6 +742,7 @@ sub pagetemplate (@) { $template->query(name => 'commentsurl') || $template->query(name => 'atomcommentsurl') || $template->query(name => 'comments')) && + length $page && # not dynamic commentsshown($page); if ($template->query(name => 'comments')) { -- cgit v1.2.3 From ff67a31db53dee296ef5f603cc6062d2191c7178 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 May 2010 22:38:59 -0400 Subject: Revert "avoid showing comment post stuff on dynamic pages" This reverts commit 4a6d5330e5b9554f1bd25b9025dd96200c6519c7. That was too ugly, the DYNAMIC test on page.tmpl will avoid the problem anyway -- just needs to be added. --- IkiWiki/Plugin/comments.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index af7e7eccd..3cafcbe9c 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -742,7 +742,6 @@ sub pagetemplate (@) { $template->query(name => 'commentsurl') || $template->query(name => 'atomcommentsurl') || $template->query(name => 'comments')) && - length $page && # not dynamic commentsshown($page); if ($template->query(name => 'comments')) { -- cgit v1.2.3 From 8e77dc1c9cda0777158b12025d6123452e090765 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 May 2010 23:54:00 -0400 Subject: fix typo --- IkiWiki/Plugin/sidebar.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 0350f2b71..2d495db2c 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -22,7 +22,7 @@ sub getsetup () { }, global_sidebars => { type => "boolean", - examples => 1, + example => 1, description => "show sidebar page on all pages?", safe => 1, rebuild => 1, -- cgit v1.2.3 From facc77e10925301575b46d26e031c9f6914edafb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 May 2010 17:06:13 -0400 Subject: force scalar context --- IkiWiki/Plugin/comments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 3cafcbe9c..eb861d74f 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -859,7 +859,7 @@ sub num_comments ($$) { my $dir=shift; my @comments=glob("$dir/$page/$config{comments_pagename}*._comment"); - return @comments; + return int @comments; } sub unique_comment_location ($$$$) { -- cgit v1.2.3 From 7aa209f1ce882372590ff032a1a94ad2b977544d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 May 2010 13:28:35 -0400 Subject: Fix a bug that prevented matching deleted comments, and so did not update pages that had contained them. Problem is that by the time rendering calls render_dependent, %pagesources has had deleted files removed from it. So match_comment's lookup of files in there to see if they had the _comment extension failed. I had to introduce a hash that temporarily holds filenames of deleted pages to fix this. Note that unlike comment(), internal() had avoided this pitfall by being defined to match both internal and non-internal pages. --- IkiWiki.pm | 6 +++--- IkiWiki/Plugin/comments.pm | 18 ++++++++++-------- IkiWiki/Render.pm | 1 + debian/changelog | 2 ++ 4 files changed, 16 insertions(+), 11 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 699ad13da..0f28801a6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -12,9 +12,9 @@ use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %wikistate %renderedfiles %oldrenderedfiles - %pagesources %destsources %depends %depends_simple @mass_depends - %hooks %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks - %autofiles}; + %pagesources %delpagesources %destsources %depends %depends_simple + @mass_depends %hooks %forcerebuild %loaded_plugins %typedlinks + %oldtypedlinks %autofiles}; use Exporter q{import}; our @EXPORT = qw(hook debug error htmlpage template template_depends diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index eb861d74f..de193bd12 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -908,10 +908,12 @@ sub match_comment ($$;@) { my $page = shift; my $glob = shift; - if (! IkiWiki::isinternal($page)) { - return IkiWiki::FailReason->new("$page is not a comment"); - } - my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page}); + # To see if it's a comment, check the source file type. + # Deal with comments that were just deleted. + my $source=exists $IkiWiki::pagesources{$page} ? + $IkiWiki::pagesources{$page} : + $IkiWiki::delpagesources{$page}; + my $type=IkiWiki::pagetype($source); if (defined $type && $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } @@ -923,10 +925,10 @@ sub match_comment_pending ($$;@) { my $page = shift; my $glob = shift; - if (! IkiWiki::isinternal($page)) { - return IkiWiki::FailReason->new("$page is not a pending comment"); - } - my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page}); + my $source=exists $IkiWiki::pagesources{$page} ? + $IkiWiki::pagesources{$page} : + $IkiWiki::delpagesources{$page}; + my $type=IkiWiki::pagetype($source); if (defined $type && $type ne "_comment_pending") { return IkiWiki::FailReason->new("$page is not a pending comment"); } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 833fcaaff..f9fbc801f 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -442,6 +442,7 @@ sub remove_del (@) { } delete $pagecase{lc $page}; + $delpagesources{$page}=$pagesources{$page}; delete $pagesources{$page}; } } diff --git a/debian/changelog b/debian/changelog index b8939f455..8b5389e88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20100516) UNRELEASED; urgency=low * page.tmpl: Accidentially broke po plugin's otherlanguages list styling when modifying for html5; now fixed. + * Fix a bug that prevented matching deleted comments, and so did not update + pages that had contained them. -- Joey Hess Sun, 16 May 2010 00:03:06 -0400 -- cgit v1.2.3 From baaa176b9b8138429f607ddf5ec9f3725e169486 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 May 2010 13:36:51 -0400 Subject: simplify example I've seen user(http://*) confuse someone who didn't know pagespecs to think that just http://* would moderate all comments to every page, or something like that. --- IkiWiki/Plugin/moderatedcomments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm index b0a328a06..ff2c2b160 100644 --- a/IkiWiki/Plugin/moderatedcomments.pm +++ b/IkiWiki/Plugin/moderatedcomments.pm @@ -19,7 +19,7 @@ sub getsetup () { }, moderate_pagespec => { type => 'pagespec', - example => 'user(http://*)', + example => '*', description => 'PageSpec matching users or comment locations to moderate', link => 'ikiwiki/PageSpec', safe => 1, -- cgit v1.2.3 From 14de1d87eff9b3a28435103f1efed2cb0972ec3d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 May 2010 14:16:58 -0400 Subject: Fix a typo in the last release. --- IkiWiki/Plugin/comments.pm | 4 ++-- debian/changelog | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index de193bd12..f2cd8f90a 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -914,7 +914,7 @@ sub match_comment ($$;@) { $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; my $type=IkiWiki::pagetype($source); - if (defined $type && $type ne "_comment") { + if (! defined $type || $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } @@ -929,7 +929,7 @@ sub match_comment_pending ($$;@) { $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; my $type=IkiWiki::pagetype($source); - if (defined $type && $type ne "_comment_pending") { + if (! defined $type || $type ne "_comment_pending") { return IkiWiki::FailReason->new("$page is not a pending comment"); } diff --git a/debian/changelog b/debian/changelog index c829f2f06..da4851d5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100518.2) unstable; urgency=low + + * Fix a typo in the last release. + + -- Joey Hess Tue, 18 May 2010 14:16:30 -0400 + ikiwiki (3.20100518) unstable; urgency=low * page.tmpl: Accidentially broke po plugin's otherlanguages list styling -- cgit v1.2.3 From 6472302b8dc1fd0edd76ab3ac6d2e1f224e3cc40 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 May 2010 13:39:07 -0400 Subject: disable warnings when evaling setup files In particular, perl warns if a qw{} contains a #, but openids can. If the setup file has 'use warnings', it will turn warning messages back on, so it seems reasonable to squelch them by default. --- IkiWiki/Setup.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index 06102058b..ee5be95d2 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -33,6 +33,7 @@ sub load ($;$) { if ($1) { error sprintf(gettext("cannot load %s in safe mode"), $file) if $safemode; + no warnings; eval IkiWiki::possibly_foolish_untaint($content); error("$file: ".$@) if $@; } -- cgit v1.2.3 From 3d769f784983604fbf1acda472908c21473c0dfa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 May 2010 18:03:21 -0400 Subject: fix uninitalized value warning --- IkiWiki/Plugin/comments.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index f2cd8f90a..86b60a2b2 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -913,7 +913,7 @@ sub match_comment ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); + my $type=defined $source ? IkiWiki::pagetype($source) : undef; if (! defined $type || $type ne "_comment") { return IkiWiki::FailReason->new("$page is not a comment"); } @@ -928,7 +928,7 @@ sub match_comment_pending ($$;@) { my $source=exists $IkiWiki::pagesources{$page} ? $IkiWiki::pagesources{$page} : $IkiWiki::delpagesources{$page}; - my $type=IkiWiki::pagetype($source); + my $type=defined $source ? IkiWiki::pagetype($source) : undef; if (! defined $type || $type ne "_comment_pending") { return IkiWiki::FailReason->new("$page is not a pending comment"); } -- cgit v1.2.3 From 0ccf21daafa76fd182df5e6bc156f22873fe062d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Jun 2010 21:13:37 -0400 Subject: img: Fill in missing height or width when scaling image. --- IkiWiki/Plugin/img.pm | 6 +++--- debian/changelog | 1 + doc/bugs/img_plugin_and_missing_heigth_value.mdwn | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index f06121578..63dfa9019 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -115,9 +115,6 @@ sub preprocess (@) { $im = Image::Magick->new; $r = $im->Read($outfile); error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r; - - $dwidth = $im->Get("width"); - $dheight = $im->Get("height"); } else { ($dwidth, $dheight)=($w, $h); @@ -133,6 +130,9 @@ sub preprocess (@) { $imglink = $file; } } + + $dwidth = $im->Get("width") unless defined $dwidth; + $dheight = $im->Get("height") unless defined $dheight; } } else { diff --git a/debian/changelog b/debian/changelog index 0a7d17eb7..9a10332ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.20100518.3) UNRELEASED; urgency=low * creation_day() etc use local time, not gmtime. To match calendars, which use local time. + * img: Fill in missing height or width when scaling image. -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/img_plugin_and_missing_heigth_value.mdwn b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn index a82e2a7d7..bcb17c330 100644 --- a/doc/bugs/img_plugin_and_missing_heigth_value.mdwn +++ b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn @@ -1,3 +1,5 @@ When I set up my picture page with `\[[!img defaults size=300x]]` then the html validator complains that the value for height is missing and the IE browsers won't show the pictures up at all; no problems with ff tho. If I set up my picture page with `\[[!img defaults size=300x300]]` then all the images are funny stretched. What am I doing wrong? > This is a bug. --[[Joey]] + +> And .. [[fixed|done]] --[[Joey]] -- cgit v1.2.3 From e96cf38eccd219714140f221090d2e7751fd4ee0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 16:00:12 -0400 Subject: When editing a page, show that page's sidebar. (Thanks, privat) --- IkiWiki.pm | 13 +++++++++++-- IkiWiki/Plugin/editpage.pm | 13 ++++++++----- debian/changelog | 1 + ...t_respect_the_current_page___40__if_any__41__.mdwn | 19 ++++++++++++++++++- 4 files changed, 38 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 27fa4ca17..d2ed99923 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1739,11 +1739,20 @@ sub template ($;@) { sub misctemplate ($$;@) { my $title=shift; my $content=shift; + my %params=@_; my $template=template("page.tmpl"); + my $page=""; + if (exists $params{page}) { + $page=delete $params{page}; + } run_hooks(pagetemplate => sub { - shift->(page => "", destpage => "", template => $template); + shift->( + page => $page, + destpage => $page, + template => $template, + ); }); templateactions($template, ""); @@ -1754,7 +1763,7 @@ sub misctemplate ($$;@) { content => $content, baseurl => baseurl(), html5 => $config{html5}, - @_, + %params, ); return $template->output; diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 670eedfd9..aa73eb87d 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -312,7 +312,8 @@ sub cgi_editpage ($$) { $form->title(sprintf(gettext("editing %s"), pagetitle($page))); } - showform($form, \@buttons, $session, $q, forcebaseurl => $baseurl); + showform($form, \@buttons, $session, $q, + forcebaseurl => $baseurl, page => $page); } else { # save page @@ -329,7 +330,8 @@ sub cgi_editpage ($$) { $form->field(name => "page", type => 'hidden'); $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); - showform($form, \@buttons, $session, $q, forcebaseurl => $baseurl); + showform($form, \@buttons, $session, $q, + forcebaseurl => $baseurl, page => $page); exit; } elsif ($form->field("do") eq "create" && $exists) { @@ -343,7 +345,8 @@ sub cgi_editpage ($$) { value => readfile("$config{srcdir}/$file"). "\n\n\n".$form->field("editcontent"), force => 1); - showform($form, \@buttons, $session, $q, forcebaseurl => $baseurl); + showform($form, \@buttons, $session, $q, + forcebaseurl => $baseurl, page => $page); exit; } @@ -384,7 +387,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); exit; } @@ -423,7 +426,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); } else { # The trailing question mark tries to avoid broken diff --git a/debian/changelog b/debian/changelog index 36848d680..66d525572 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.20100609) unstable; urgency=low * Remove example blog tag pages; allow autotag creation to create them when used. * Fix support for globbing in tagged() pagespecs. + * When editing a page, show that page's sidebar. (Thanks, privat) -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn index 58cf9d737..2ef5cdba3 100644 --- a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn +++ b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn @@ -18,6 +18,12 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is * -> Problem: 404, the browser goes to "/bar/foo" * -> Was expected: the browser goes to "/foo" +> You must have a locally modified `page.tmpl` that omits the "TMPL_IF DYNAMIC" +> that adds a `` tag. That is needed to make all links displayed by +> cgis work reliably. Not just in this page editing case. +> The [[version_3.20100515]] announcment mentions that you need to +> update old `page.tmpl` files to include that on upgrade. --[[Joey]] + ### A second example * create "/bar/sidebar.mdwn" with "world" @@ -28,6 +34,10 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is * -> Problem: the sidebar now shows the foo link (it is the root sidebar!) * -> Was expecte : the sidebar displays "world" +> One could argue that the behavior here is right, or wrong. +> Is a page edit page really the same as the page being edited? +> The next case is more clear.. --[[Joey]] + ### A last example * with the web browser edit the page "bar" @@ -36,6 +46,8 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is * -> Problem: the sidebar still displays the foo link * -> Was expected: the sidebar display "goodby" +> I think this is worth fixing. --[[Joey]] + ## Some superficial hacking With the following workaround hacks, I manage to solve the 3 examples shown above: @@ -47,4 +59,9 @@ With the following workaround hacks, I manage to solve the 3 examples shown abov
    my %params=@_;
     shift->(page => $params{page}, destpage => $params{destpage}, template => $template);
    -I do not guarantee (I do not even expect) that it is the proper way to solve this bug but it may help developers to find and solve the real problem. +I do not guarantee (I do not even expect) that it is the proper way to solve +this bug but it may help developers to find and solve the real problem. + +> Oh, it's pretty reasonable. I don't think it breaks anything. :) +> [[done]] +> --[[Joey]] -- cgit v1.2.3 From 95b45864debe8070e8229cc7def21aef5447f541 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 16:16:48 -0400 Subject: relativedate: Fix problem with localised dates not working. --- IkiWiki/Plugin/relativedate.pm | 7 +++++-- debian/changelog | 1 + ...lugins__47__relativedate_depends_on_locale_at_setup_file.mdwn | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm index 179f9238c..c9280ef14 100644 --- a/IkiWiki/Plugin/relativedate.pm +++ b/IkiWiki/Plugin/relativedate.pm @@ -49,10 +49,13 @@ sub mydisplaytime ($;$$) { 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 - # as the title if javascript is not available. + # (Being fairly human readable is also nice, as it will be exposed + # as the title if javascript is not available.) + my $lc_time=POSIX::setlocale(&POSIX::LC_TIME); + POSIX::setlocale(&POSIX::LC_TIME, "C"); my $gmtime=decode_utf8(POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time))); + POSIX::setlocale(&POSIX::LC_TIME, $lc_time); my $mid=' class="relativedate" title="'.$gmtime.'">'. IkiWiki::formattime($time, $format); diff --git a/debian/changelog b/debian/changelog index 66d525572..fdf111168 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.20100609) unstable; urgency=low when used. * Fix support for globbing in tagged() pagespecs. * When editing a page, show that page's sidebar. (Thanks, privat) + * relativedate: Fix problem with localised dates not working. -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn b/doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn index db009fa19..e2ea3e4f6 100644 --- a/doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn +++ b/doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn @@ -3,3 +3,12 @@ If I switch locale to en_US.UTF-8 then this plugin correctly parses text date and print relative date. But when I mouseover on date I see unusual formating of the date (it uses AM/PM format while russians use 24-h notation). P.S. All pages but RecentChanges show well-formated date. RecentChanges show date formated using locale. Anyway, plugin does not work without en_US locale. + +> [[Fixed|done]]. Now it uses C locale for the date put in the title, +> that is used by relativedate. The mouseover will display the date in your +> native locale. +> +> Only exception is that when javascript is disabled... then +> relativedate can't work, so instead you will see your localized date +> displayed; but on mouseover you will get shown the C locale date. +> --[[Joey]] -- cgit v1.2.3 From e93cee33786da51d80f375cbeb8fb24db24bf0c9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 16:59:17 -0400 Subject: Fix display of sidebar when previewing page edit. (Thanks, privat) On second thought, only display a page's personal sidebar when previewing it, not when editing normally. --- IkiWiki/Plugin/editpage.pm | 17 +++++++++++------ debian/changelog | 2 +- ...not_respect_the_current_page___40__if_any__41__.mdwn | 15 +++++++++++---- 3 files changed, 23 insertions(+), 11 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index aa73eb87d..af2c5ff4e 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -153,6 +153,7 @@ sub cgi_editpage ($$) { noimageinline => 1, linktext => "FormattingHelp")); + my $previewing=0; if ($form->submitted eq "Cancel") { if ($form->field("do") eq "create" && defined $from) { redirect($q, urlto($from, undef, 1)); @@ -166,6 +167,8 @@ sub cgi_editpage ($$) { exit; } elsif ($form->submitted eq "Preview") { + $previewing=1; + my $new=not exists $pagesources{$page}; if ($new) { # temporarily record its type @@ -255,7 +258,7 @@ sub cgi_editpage ($$) { if (! @page_locs) { # hmm, someone else made the page in the # meantime? - if ($form->submitted eq "Preview") { + if ($previewing) { # let them go ahead with the edit # and resolve the conflict at save # time @@ -313,7 +316,9 @@ sub cgi_editpage ($$) { } showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, page => $page); + forcebaseurl => $baseurl, + ($previewing ? (page => $page) : ()), + ); } else { # save page @@ -331,7 +336,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, page => $page); + forcebaseurl => $baseurl); exit; } elsif ($form->field("do") eq "create" && $exists) { @@ -346,7 +351,7 @@ sub cgi_editpage ($$) { "\n\n\n".$form->field("editcontent"), force => 1); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, page => $page); + forcebaseurl => $baseurl); exit; } @@ -387,7 +392,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, page => $page); + forcebaseurl => $baseurl); exit; } @@ -426,7 +431,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, page => $page); + forcebaseurl => $baseurl); } else { # The trailing question mark tries to avoid broken diff --git a/debian/changelog b/debian/changelog index fdf111168..5cfb9ce89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,7 @@ ikiwiki (3.20100609) unstable; urgency=low * Remove example blog tag pages; allow autotag creation to create them when used. * Fix support for globbing in tagged() pagespecs. - * When editing a page, show that page's sidebar. (Thanks, privat) + * Fix display of sidebar when previewing page edit. (Thanks, privat) * relativedate: Fix problem with localised dates not working. -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn index 2ef5cdba3..f1e4649ff 100644 --- a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn +++ b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn @@ -34,9 +34,10 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is * -> Problem: the sidebar now shows the foo link (it is the root sidebar!) * -> Was expecte : the sidebar displays "world" -> One could argue that the behavior here is right, or wrong. -> Is a page edit page really the same as the page being edited? -> The next case is more clear.. --[[Joey]] +> I think it's a misconception to think that the page editing page is the same +> as the page it's editing. If you were deleting that page, would you expect +> the "are you sure" confirmation page to display the page's sidebar? +> --[[Joey]] ### A last example @@ -46,7 +47,12 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is * -> Problem: the sidebar still displays the foo link * -> Was expected: the sidebar display "goodby" -> I think this is worth fixing. --[[Joey]] +> In the specific case of previewing, it is indeed a bug that the +> right sidebar is not displayed. And replacing the regular sidebar +> with the one from the previewed page is probably the best we can do.. +> displaying 2 sidebars would be confusing, and the `page.tmpl` can +> put the sidebar anywhere so we can't just display the preview sidebar +> next to the rest of the page preview. --[[Joey]] ## Some superficial hacking @@ -63,5 +69,6 @@ I do not guarantee (I do not even expect) that it is the proper way to solve this bug but it may help developers to find and solve the real problem. > Oh, it's pretty reasonable. I don't think it breaks anything. :) +> I modified it a bit, and explicitly made it *not* "fix" the second example. > [[done]] > --[[Joey]] -- cgit v1.2.3 From b2327cfae4ac7da1df7bbf848f575b553f74eafb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 17:43:20 -0400 Subject: improve preview mode comments --- IkiWiki/Plugin/graphviz.pm | 3 ++- IkiWiki/Plugin/img.pm | 3 ++- IkiWiki/Plugin/sparkline.pm | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index c91c92fec..dfd66a03e 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -71,7 +71,8 @@ sub render_graph (\%) { writefile($dest, $config{destdir}, $png, 1); } else { - # can't write the file, so embed it in a data uri + # in preview mode, embed the image in a data uri + # to avoid temp file clutter eval q{use MIME::Base64}; error($@) if $@; return "Resize(geometry => "${w}x${h}"); error sprintf(gettext("failed to resize: %s"), $r) if $r; - # don't actually write file in preview mode + # don't actually write resized file in preview mode; + # rely on width and height settings if (! $params{preview}) { my @blob = $im->ImageToBlob(); writefile($imglink, $config{destdir}, $blob[0], 1); diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index 42665ac63..1b1d04cba 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -158,7 +158,8 @@ sub preprocess (@) { writefile($fn, $config{destdir}, $png, 1); } else { - # can't write the file, so embed it in a data uri + # in preview mode, embed the image in a data uri + # to avoid temp file clutter eval q{use MIME::Base64}; error($@) if $@; return " Date: Wed, 9 Jun 2010 17:44:40 -0400 Subject: editpage: Avoid storing accidental state changes when previewing pages. This is a slow, safe, stupid approach. Could make deep copies of the data structures as backups instead of re-loading the index from disk. --- IkiWiki/Plugin/editpage.pm | 15 ++++++--------- debian/changelog | 1 + .../comments_preview_unsafe_with_allowdirectives.mdwn | 8 ++++++++ doc/bugs/preview_pagestate.mdwn | 2 ++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 doc/bugs/comments_preview_unsafe_with_allowdirectives.mdwn (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index af2c5ff4e..3d731d399 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -170,10 +170,8 @@ sub cgi_editpage ($$) { $previewing=1; my $new=not exists $pagesources{$page}; - if ($new) { - # temporarily record its type - $pagesources{$page}=$page.".".$type; - } + # temporarily record its type + $pagesources{$page}=$page.".".$type if $new; my %wasrendered=map { $_ => 1 } @{$renderedfiles{$page}}; my $content=$form->field('editcontent'); @@ -198,18 +196,17 @@ sub cgi_editpage ($$) { }); $form->tmpl_param("page_preview", $preview); - if ($new) { - delete $pagesources{$page}; - } - # Previewing may have created files on disk. # Keep a list of these to be deleted later. my %previews = map { $_ => 1 } @{$wikistate{editpage}{previews}}; foreach my $f (@{$renderedfiles{$page}}) { $previews{$f}=1 unless $wasrendered{$f}; } + + # Throw out any other state changes made during previewing, + # and save the previews list. + loadindex(); @{$wikistate{editpage}{previews}} = keys %previews; - $renderedfiles{$page}=[keys %wasrendered]; saveindex(); } elsif ($form->submitted eq "Save Page") { diff --git a/debian/changelog b/debian/changelog index 5cfb9ce89..96188c093 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ ikiwiki (3.20100609) unstable; urgency=low * Fix support for globbing in tagged() pagespecs. * Fix display of sidebar when previewing page edit. (Thanks, privat) * relativedate: Fix problem with localised dates not working. + * editpage: Avoid storing accidental state changes when previewing pages. -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/comments_preview_unsafe_with_allowdirectives.mdwn b/doc/bugs/comments_preview_unsafe_with_allowdirectives.mdwn new file mode 100644 index 000000000..7f9fb67e9 --- /dev/null +++ b/doc/bugs/comments_preview_unsafe_with_allowdirectives.mdwn @@ -0,0 +1,8 @@ +If `comments_allowdirectives` is set, previewing a comment can run +directives that create files. (Eg, img.) Unlike editpage, it does not +keep track of those files and expire them. So the files will linger in +destdir forever. + +Probably when the user then tries to save the comment, ikiwiki will refuse +to overwrite the unknown file, and will crash. +--[[Joey]] diff --git a/doc/bugs/preview_pagestate.mdwn b/doc/bugs/preview_pagestate.mdwn index 14973908b..7f7ec0976 100644 --- a/doc/bugs/preview_pagestate.mdwn +++ b/doc/bugs/preview_pagestate.mdwn @@ -9,3 +9,5 @@ saves other state changes. Seems like it needs to isolate all state changes when previewing... ugh. --[[Joey]] + +[[done]] -- cgit v1.2.3 From 1bdf98a4a0b3a0bddbede8390df0930193d06a5a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 17:47:49 -0400 Subject: let's allow comments of "0" --- IkiWiki/Plugin/comments.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 86b60a2b2..b244a7431 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -433,7 +433,8 @@ sub editcomment ($$) { $content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n"; - my $editcontent = $form->field('editcontent') || ''; + my $editcontent = $form->field('editcontent'); + $editcontent="" if ! defined $editcontent; $editcontent =~ s/\r\n/\n/g; $editcontent =~ s/\r/\n/g; $editcontent =~ s/"/\\"/g; -- cgit v1.2.3 From 04ff998c51b578017edf369e0dfc2dc7c63d8071 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Jun 2010 15:01:10 -0400 Subject: calendar styling * calendar: Shorten day names, and improve styling of month calendar. * style.css: Reduced sidebar width back to 20ex from 30; the month calendar will now fit in the smaller width, and 30 was feeling too large. --- IkiWiki/Plugin/calendar.pm | 5 +++-- debian/changelog | 9 ++++++--- doc/style.css | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 0bf933dcd..359c9b861 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -123,6 +123,7 @@ sub format_month (@) { } # Find out month names for this, next, and previous months + my $monthabbrev=POSIX::strftime("%b", @monthstart); my $monthname=POSIX::strftime("%B", @monthstart); my $pmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900))); my $nmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900))); @@ -137,7 +138,7 @@ sub format_month (@) { $url = htmllink($params{page}, $params{destpage}, "$archivebase/$params{year}/".$params{month}, noimageinline => 1, - linktext => "$monthname $params{year}", + linktext => "$monthabbrev $params{year}", title => $monthname); } add_depends($params{page}, "$archivebase/$params{year}/$params{month}", @@ -182,7 +183,7 @@ EOF for my $dow ($week_start_day..$week_start_day+6) { my @day=localtime(timelocal(0,0,0,$start_day++,$params{month}-1,$params{year}-1900)); my $downame = POSIX::strftime("%A", @day); - my $dowabbr = POSIX::strftime("%a", @day); + my $dowabbr = substr($downame, 0, 1); $downame{$dow % 7}=$downame; $dowabbr{$dow % 7}=$dowabbr; $calendar.= qq{\t\t$dowabbr\n}; diff --git a/debian/changelog b/debian/changelog index f7810c66f..d66bcab20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100609) unstable; urgency=low +ikiwiki (3.20100610) unstable; urgency=low * creation_day() etc use local time, not gmtime. To match calendars, which use local time. @@ -11,10 +11,13 @@ ikiwiki (3.20100609) unstable; urgency=low * editpage: Avoid storing accidental state changes when previewing pages. * page.tmpl: Add a div around the sidebar, page content, and comments, to aide in styling. - * style.css: Improvements to make floating sidebar fit better on + * style.css: Improvements to make floating sidebar fit much better on pages with inlines. + * calendar: Shorten day names, and improve styling of month calendar. + * style.css: Reduced sidebar width back to 20ex from 30; the month calendar + will now fit in the smaller width, and 30 was feeling too large. - -- Joey Hess Mon, 31 May 2010 20:44:17 -0400 + -- Joey Hess Thu, 10 Jun 2010 14:24:05 -0400 ikiwiki (3.20100518.2) unstable; urgency=low diff --git a/doc/style.css b/doc/style.css index 154729721..2cc467b4f 100644 --- a/doc/style.css +++ b/doc/style.css @@ -199,7 +199,7 @@ div.recentchanges { } .sidebar { - width: 30ex; + width: 20ex; float: right; margin-left: 4px; margin-bottom: 4px; @@ -383,8 +383,17 @@ pre.hl { color:#000000; background-color:#ffffff; } .hl.kwd { color:#010181; } /* calendar plugin */ -.month-calendar-day-this-day { background-color: #eee; } -.year-calendar-this-month { background-color: #eee; } +.month-calendar-day-this-day, +.year-calendar-this-month { + background-color: #eee; +} +.month-calendar-day-head, +.month-calendar-day-nolink, +.month-calendar-day-link, +.month-calendar-day-this-day, +.month-calendar-day-future { + text-align: right; +} .month-calendar-arrow A:link, .year-calendar-arrow A:link, .month-calendar-arrow A:visited, -- cgit v1.2.3 From 475b4199e1624350b928a002fe83033ee3389b31 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Jun 2010 13:53:56 -0400 Subject: openid: Add openid_realm and openid_cgiurl configuration options, useful in a few edge case setups. --- IkiWiki/Plugin/openid.pm | 27 ++++++++++++++++++++++++--- debian/changelog | 7 +++++++ doc/plugins/openid.mdwn | 16 ++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index e10e21f4d..57cb139ca 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -40,6 +40,18 @@ sub getsetup () { rebuild => 0, section => "auth", }, + openid_realm => { + type => "string", + description => "url of openid realm (default is cgiurl)", + safe => 0, + rebuild => 0, + }, + openid_cgiurl => { + type => "string", + description => "url to ikiwiki cgi to use for openid authentication (default is cgiurl)", + safe => 0, + rebuild => 0, + }, } sub openid_selector { @@ -135,9 +147,15 @@ sub validate ($$$;$) { ); } + my $cgiurl=$config{openid_cgiurl}; + $cgiurl=$config{cgiurl} if ! defined $cgiurl; + + my $trust_root=$config{openid_realm}; + $trust_root=$cgiurl if ! defined $trust_root; + my $check_url = $claimed_identity->check_url( - return_to => IkiWiki::cgiurl(do => "postsignin"), - trust_root => $config{cgiurl}, + return_to => "$cgiurl?do=postsignin", + trust_root => $trust_root, delayed_return => 1, ); # Redirect the user to the OpenID server, which will @@ -220,12 +238,15 @@ sub getobj ($$) { $secret=rand; $session->param(openid_secret => $secret); } + + my $cgiurl=$config{openid_cgiurl}; + $cgiurl=$config{cgiurl} if ! defined $cgiurl; return Net::OpenID::Consumer->new( ua => $ua, args => $q, consumer_secret => sub { return shift()+$secret }, - required_root => $config{cgiurl}, + required_root => $cgiurl, ); } diff --git a/debian/changelog b/debian/changelog index 01307db55..9a6b1361c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100611) UNRELEASED; urgency=low + + * openid: Add openid_realm and openid_cgiurl configuration options, + useful in a few edge case setups. + + -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 + ikiwiki (3.20100610) unstable; urgency=low * creation_day() etc use local time, not gmtime. To match calendars, which diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 7da2f8575..3fb4c26b8 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -13,3 +13,19 @@ to support users entering "https" OpenID urls. 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]]. + +## options + +These options do not normally need to be set, but can be useful in +certian setups. + +* `openid_realm` can be used to control the scope of the openid request. + It defaults to the `cgiurl` (or `openid_cgiurl` if set); only allowing + ikiwiki's [[CGI]] to authenticate. If you have multiple ikiwiki instances, + or other things using openid on the same site, you may choose to put them + all in the same realm to improve the user's openid experience. + +* `openid_cgiurl` can be used to cause a different than usual `cgiurl` + to be used when doing openid authentication. The `openid_cgiurl` must + point to an ikiwiki [[CGI]], and it will need to match the `openid_realm` + to work. -- cgit v1.2.3 From d5181a197732f1c6bb80fdf8c508568b8c4225c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Jun 2010 14:14:20 -0400 Subject: realm is an url pattern --- IkiWiki/Plugin/openid.pm | 2 +- doc/plugins/openid.mdwn | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 57cb139ca..f4ba8db18 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -42,7 +42,7 @@ sub getsetup () { }, openid_realm => { type => "string", - description => "url of openid realm (default is cgiurl)", + description => "url pattern of openid realm (default is cgiurl)", safe => 0, rebuild => 0, }, diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 3fb4c26b8..f3b3abfbb 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -23,7 +23,8 @@ certian setups. It defaults to the `cgiurl` (or `openid_cgiurl` if set); only allowing ikiwiki's [[CGI]] to authenticate. If you have multiple ikiwiki instances, or other things using openid on the same site, you may choose to put them - all in the same realm to improve the user's openid experience. + all in the same realm to improve the user's openid experience. It is an + url pattern, so can be set to eg "http://*.example.com/" * `openid_cgiurl` can be used to cause a different than usual `cgiurl` to be used when doing openid authentication. The `openid_cgiurl` must -- cgit v1.2.3 From 9923f5db65f85485d10cb2b5a10c42bb36168de7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 14:29:56 -0400 Subject: attachment: Show files from underlay in attachments list. While those files cannot be removed or renamed, this allows easy downloading of them, and a new version can after all be uploaded. --- IkiWiki/Plugin/attachment.pm | 3 +-- debian/changelog | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 8c3ff887a..53a65236c 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -225,8 +225,7 @@ sub attachment_list ($) { my @ret; foreach my $f (values %pagesources) { if (! defined pagetype($f) && - $f=~m/^\Q$loc\E[^\/]+$/ && - -e "$config{srcdir}/$f") { + $f=~m/^\Q$loc\E[^\/]+$/) { push @ret, { "field-select" => '', link => htmllink($page, $page, $f, noimageinline => 1), diff --git a/debian/changelog b/debian/changelog index 9a6b1361c..4e120c622 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * openid: Add openid_realm and openid_cgiurl configuration options, useful in a few edge case setups. + * attachment: Show files from underlay in attachments list. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From d7cfcef54a067221b801de17fafc1f05a13c2004 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 16:16:24 -0400 Subject: img: Support hspace and vspace attributes. --- IkiWiki/Plugin/img.pm | 12 ++++++++---- debian/changelog | 1 + doc/ikiwiki/directive/img.mdwn | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 48211454e..a69175ba6 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -156,14 +156,18 @@ sub preprocess (@) { $imgurl="$config{url}/$imglink"; } + my $attrs=''; + foreach my $attr (qw{alt title class id hspace vspace}) { + if (exists $params{$attr}) { + $attrs.=" $attr=\"$params{$attr}\""; + } + } + my $imgtag=''.$params{alt}.''; my $link; diff --git a/debian/changelog b/debian/changelog index 4e120c622..dcf589861 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * openid: Add openid_realm and openid_cgiurl configuration options, useful in a few edge case setups. * attachment: Show files from underlay in attachments list. + * img: Support hspace and vspace attributes. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/doc/ikiwiki/directive/img.mdwn b/doc/ikiwiki/directive/img.mdwn index 94cc754bd..cda62b58f 100644 --- a/doc/ikiwiki/directive/img.mdwn +++ b/doc/ikiwiki/directive/img.mdwn @@ -18,7 +18,8 @@ making the image smaller than the specified size. You can also specify only the width or the height, and the other value will be calculated based on it: "200x", "x200" -You can also pass `alt`, `title`, `class`, `align` and `id` parameters. +You can also pass `alt`, `title`, `class`, `align`, `id`, `hspace`, and +`vspace` parameters. These are passed through unchanged to the html img tag. If you include a `caption` parameter, the caption will be displayed centered beneath the image. -- cgit v1.2.3 From 31fa7714e7a3eba6e34b601426047f2aa2f8db01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 18:10:33 -0400 Subject: editpage: Rename "comments" field to avoid CSS conflict with the comments div. --- IkiWiki/Plugin/editpage.pm | 10 +++++----- debian/changelog | 2 ++ templates/editpage.tmpl | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 3d731d399..21f1f1824 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -64,7 +64,7 @@ sub cgi_editpage ($$) { decode_cgi_utf8($q); - my @fields=qw(do rcsinfo subpage from page type editcontent comments); + my @fields=qw(do rcsinfo subpage from page type editcontent editmessage); my @buttons=("Save Page", "Preview", "Cancel"); eval q{use CGI::FormBuilder}; error($@) if $@; @@ -144,7 +144,7 @@ sub cgi_editpage ($$) { $form->field(name => "subpage", type => 'hidden'); $form->field(name => "page", value => $page, force => 1); $form->field(name => "type", value => $type, force => 1); - $form->field(name => "comments", type => "text", size => 80); + $form->field(name => "editmessage", type => "text", size => 80); $form->field(name => "editcontent", type => "textarea", rows => 20, cols => 80); $form->tmpl_param("can_commit", $config{rcs}); @@ -353,9 +353,9 @@ sub cgi_editpage ($$) { } my $message=""; - if (defined $form->field('comments') && - length $form->field('comments')) { - $message=$form->field('comments'); + if (defined $form->field('editmessage') && + length $form->field('editmessage')) { + $message=$form->field('editmessage'); } my $content=$form->field('editcontent'); diff --git a/debian/changelog b/debian/changelog index dcf589861..1d849f558 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low useful in a few edge case setups. * attachment: Show files from underlay in attachments list. * img: Support hspace and vspace attributes. + * editpage: Rename "comments" field to avoid CSS conflict with the + comments div. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl index 36076cb35..b4b0d05df 100644 --- a/templates/editpage.tmpl +++ b/templates/editpage.tmpl @@ -23,8 +23,8 @@
  • - -
    + +
  • -- cgit v1.2.3 From c225cdad2524a12b998e550b6c0ba7079d164cff Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 22:20:22 -0400 Subject: edittemplate: Make silent mode not disable display when the template page does not exist, so it can be easily created. --- IkiWiki/Plugin/edittemplate.pm | 3 ++- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index d65072010..742413c94 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -59,8 +59,9 @@ sub preprocess (@) { my $bestlink=bestlink($params{page}, $link); $pagestate{$params{page}}{edittemplate}{$params{match}}=$bestlink; - return "" if ($params{silent} && IkiWiki::yesno($params{silent})); add_depends($params{page}, $link, deptype("presence")); + return "" if ($params{silent} && IkiWiki::yesno($params{silent})) && + length $bestlink; return sprintf(gettext("edittemplate %s registered for %s"), htmllink($params{page}, $params{destpage}, $link), $params{match}); diff --git a/debian/changelog b/debian/changelog index 1d849f558..d607640c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * img: Support hspace and vspace attributes. * editpage: Rename "comments" field to avoid CSS conflict with the comments div. + * edittemplate: Make silent mode not disable display when the template + page does not exist, so it can be easily created. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From dccd76487151acc6adc93ec79f1808096bc41324 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 22:43:34 -0400 Subject: edittemplate: Look for template pages under templates/ like everything else (still looks in old location for backwards compatability). --- IkiWiki/Plugin/edittemplate.pm | 7 ++++++- debian/changelog | 2 ++ doc/plugins/edittemplate.mdwn | 4 ++-- doc/templates.mdwn | 16 +++++++++------- 4 files changed, 19 insertions(+), 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 742413c94..226f83bb4 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -56,10 +56,15 @@ sub preprocess (@) { } my $link=linkpage($params{template}); + add_depends($params{page}, $link, deptype("presence")); my $bestlink=bestlink($params{page}, $link); + if (! length $bestlink) { + add_depends($params{page}, "templates/$link", deptype("presence")); + $link="/templates/".$link; + $bestlink=bestlink($params{page}, $link); + } $pagestate{$params{page}}{edittemplate}{$params{match}}=$bestlink; - add_depends($params{page}, $link, deptype("presence")); return "" if ($params{silent} && IkiWiki::yesno($params{silent})) && length $bestlink; return sprintf(gettext("edittemplate %s registered for %s"), diff --git a/debian/changelog b/debian/changelog index d607640c4..07b349c57 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low comments div. * edittemplate: Make silent mode not disable display when the template page does not exist, so it can be easily created. + * edittemplate: Look for template pages under templates/ like everything + else (still looks in old location for backwards compatability). -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/doc/plugins/edittemplate.mdwn b/doc/plugins/edittemplate.mdwn index 85dfdfc2d..c19ecd858 100644 --- a/doc/plugins/edittemplate.mdwn +++ b/doc/plugins/edittemplate.mdwn @@ -2,5 +2,5 @@ [[!tag type/web]] This plugin provides the [[ikiwiki/directive/edittemplate]] [[ikiwiki/directive]]. -This directive allows registering template pages, that provide default -content for new pages created using the web frontend. +This directive allows registering [[template|templates]] pages, that +provide default content for new pages created using the web frontend. diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 22b9345ef..d7480ee8f 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -22,20 +22,22 @@ easy to learn. All you really need to know to modify templates is this: The template directive allows wiki pages to be used as templates, filled out and inserted into other pages in the wiki. """]] -[[!if test="enabled(template) and enabled(inline)" then=""" -[[!inline pages="templates/* and !*.tmpl and !*/discussion" -feeds=no archive=yes sort=title template=titlepage -rootpage=templates postformtext="Add a new template named:"]] -"""]] [[!if test="enabled(edittemplate)" then=""" -## edit templates +## default content for new pages 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 +containing text from a template page, which can be filled as out the page is edited. """]] +[[!if test="(enabled(template) or enabled(edittemplate) +and enabled(inline)" then=""" +[[!inline pages="templates/* and !*.tmpl and !templates/*/* and !*/discussion" +feeds=no archive=yes sort=title template=titlepage +rootpage=templates postformtext="Add a new template named:"]] +"""]] + ## wiki templates These templates are used to build the wiki. The aim is to keep almost all -- cgit v1.2.3 From 35a0715b9a7a84b222523e648e815cbcc21301ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 22:59:46 -0400 Subject: avoid ugly warning if size="" is specified --- IkiWiki/Plugin/img.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index a69175ba6..eb1b68124 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -39,7 +39,7 @@ sub preprocess (@) { } } - if (! exists $params{size}) { + if (! exists $params{size} || ! length $params{size}) { $params{size}='full'; } -- cgit v1.2.3 From c65658eeb5cd83417f3ec1c69eff2ebcd6a481db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 12 Jun 2010 23:00:30 -0400 Subject: attachment: When inserting links, insert img directives for images, if that plugin is enabled. --- IkiWiki/Plugin/attachment.pm | 9 ++++++++- debian/changelog | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 53a65236c..9c774557f 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -195,7 +195,14 @@ sub formbuilder (@) { foreach my $f ($q->param("attachment_select")) { $f=Encode::decode_utf8($f); $f=~s/^$page\///; - $add.="[[$f]]\n"; + if (IkiWiki::isinlinableimage($f) && + UNIVERSAL::can("IkiWiki::Plugin::img", "import")) { + $add.='[[!img '.$f.' align="right" size="" alt=""]]'; + } + else { + $add.="[[$f]]"; + } + $add.="\n"; } $form->field(name => 'editcontent', value => $form->field('editcontent')."\n\n".$add, diff --git a/debian/changelog b/debian/changelog index 07b349c57..fd7d1569e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low page does not exist, so it can be easily created. * edittemplate: Look for template pages under templates/ like everything else (still looks in old location for backwards compatability). + * attachment: When inserting links, insert img directives for images, + if that plugin is enabled. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 17592a951bf06ede47f500af25308e9c68944279 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 13 Jun 2010 10:21:19 -0400 Subject: websetup: Allow enabling plugins listed in disable_plugins. The bug here was that disabling a plugin included thru goodstuff, like htmlscrubber, caused it to be added to disable_plugins, and those plugins were never loaded, so could not be re-enabled. Fix by allowing them to be force loaded when appropriate. (Also that allows disabled plugins to still record their setup options when dumping a setup file.) --- IkiWiki.pm | 5 +++-- IkiWiki/Setup.pm | 2 +- debian/changelog | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index d2ed99923..203da3ba2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -592,10 +592,11 @@ sub loadplugins () { return 1; } -sub loadplugin ($) { +sub loadplugin ($;$) { my $plugin=shift; + my $force=shift; - return if grep { $_ eq $plugin} @{$config{disable_plugins}}; + return if ! $force && grep { $_ eq $plugin} @{$config{disable_plugins}}; foreach my $dir (defined $config{libdir} ? possibly_foolish_untaint($config{libdir}) : undef, "$installdir/lib/ikiwiki") { diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm index ee5be95d2..2b0259e2a 100644 --- a/IkiWiki/Setup.pm +++ b/IkiWiki/Setup.pm @@ -123,7 +123,7 @@ sub getsetup () { # Load all plugins, so that all setup options are available. my @plugins=IkiWiki::listplugins(); foreach my $plugin (@plugins) { - eval { IkiWiki::loadplugin($plugin) }; + eval { IkiWiki::loadplugin($plugin, 1) }; if (exists $IkiWiki::hooks{checkconfig}{$plugin}{call}) { my @s=eval { $IkiWiki::hooks{checkconfig}{$plugin}{call}->() }; } diff --git a/debian/changelog b/debian/changelog index fd7d1569e..52b727440 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low else (still looks in old location for backwards compatability). * attachment: When inserting links, insert img directives for images, if that plugin is enabled. + * websetup: Allow enabling plugins listed in disable_plugins. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 9f7a118ffc4c16c0810ce8f5ecaa0b6a577f523f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 13 Jun 2010 10:23:05 -0400 Subject: more symetric enable/disable Removing a plugin from add_plugins is not always enough to disable it. It may have been redundantly added there and also pulled in via goodstuff. Always add didabled plugins to disable_plugins. --- IkiWiki/Plugin/websetup.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index c4b75c4b3..11b4428e3 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -253,12 +253,8 @@ sub enable_plugin ($) { sub disable_plugin ($) { my $plugin=shift; - if (grep { $_ eq $plugin } @{$config{add_plugins}}) { - $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}]; - } - else { - push @{$config{disable_plugins}}, $plugin; - } + $config{add_plugins}=[grep { $_ ne $plugin } @{$config{add_plugins}}]; + push @{$config{disable_plugins}}, $plugin; } sub showform ($$) { -- cgit v1.2.3 From c0bc2d08398ae5cfa6becba155a2127a481a4d5e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 14 Jun 2010 14:34:52 -0400 Subject: editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) --- IkiWiki/Plugin/comments.pm | 2 +- IkiWiki/Plugin/editpage.pm | 12 +++++------- debian/changelog | 2 ++ ...does_not_respect_the_current_page___40__if_any__41__.mdwn | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index b244a7431..d204a7737 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -537,7 +537,7 @@ sub editcomment ($$) { } else { IkiWiki::showform ($form, \@buttons, $session, $cgi, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); } exit; diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 21f1f1824..3ba6c519e 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -313,9 +313,7 @@ sub cgi_editpage ($$) { } showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl, - ($previewing ? (page => $page) : ()), - ); + forcebaseurl => $baseurl, page => $page); } else { # save page @@ -333,7 +331,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); exit; } elsif ($form->field("do") eq "create" && $exists) { @@ -348,7 +346,7 @@ sub cgi_editpage ($$) { "\n\n\n".$form->field("editcontent"), force => 1); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); exit; } @@ -389,7 +387,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); exit; } @@ -428,7 +426,7 @@ sub cgi_editpage ($$) { $form->field(name => "type", type => 'hidden'); $form->title(sprintf(gettext("editing %s"), $page)); showform($form, \@buttons, $session, $q, - forcebaseurl => $baseurl); + forcebaseurl => $baseurl, page => $page); } else { # The trailing question mark tries to avoid broken diff --git a/debian/changelog b/debian/changelog index 52b727440..32ba0cf08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * attachment: When inserting links, insert img directives for images, if that plugin is enabled. * websetup: Allow enabling plugins listed in disable_plugins. + * editpage, comments: Fix broken links in sidebar (due to forcebaseurl). + (Thanks, privat) -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn index c6f1cef3d..adf0ec745 100644 --- a/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn +++ b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn @@ -33,6 +33,8 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is >> >> The fix commited work for previewing, but not in other cases : links are still broken. Please juste follow the example step-by-step to reproduce it (I just retried it with a "fixed" version: Debian 3.20100610). If you cannot reproduce, please say it explicitely instead of guessing about my innability to read changelogs. -- [[JeanPrivat]] +>>> Sorry if my not seeing the bug offended you. [[Fixed|done]] --[[Joey]] + ### A second example * create "/bar/sidebar.mdwn" with "world" -- cgit v1.2.3 From d541cc854a6e610d2d9f5f7b950f4abb76e36954 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 13:38:19 -0400 Subject: calendar: Tune archive_pagespec to only match pages, not other files. --- IkiWiki/Plugin/calendar.pm | 2 +- auto-blog.setup | 2 +- debian/changelog | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 359c9b861..bb995d499 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -49,7 +49,7 @@ sub getsetup () { }, archive_pagespec => { type => "pagespec", - example => "posts/* and !*/Discussion", + example => "page(posts/*) and !*/Discussion", description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command", link => 'ikiwiki/PageSpec', safe => 1, diff --git a/auto-blog.setup b/auto-blog.setup index ef03295d6..980074ec3 100644 --- a/auto-blog.setup +++ b/auto-blog.setup @@ -46,7 +46,7 @@ IkiWiki::Setup::Automator->import( example => "blog", comments_pagespec => "posts/* and !*/Discussion", blogspam_pagespec => "postcomment(*)", - archive_pagespec => "posts/* and !*/Discussion", + archive_pagespec => "page(posts/*) and !*/Discussion", global_sidebars => 0, discussion => 0, locked_pages => "*", diff --git a/debian/changelog b/debian/changelog index 32ba0cf08..bddedeafa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * websetup: Allow enabling plugins listed in disable_plugins. * editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) + * calendar: Tune archive_pagespec to only match pages, not other files. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 69383fb6b0820360ad54122d79a3c64909d01a9d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 16:40:37 -0400 Subject: Fix issues with combining unicode srcdirs and source files. A short story: Once there was a unicode string, let's call him Srcdir. Along came a crufy old File::Find, who went through a tree and pasted each of the leaves in turn onto Srcdir. But this 90's relic didn't decode the leaves -- despite some of them using unicode! Poor Srcdir, with these leaves stuck on him, tainted them with his nice unicode-ness. They didn't look like leaves at all, but instead garbage. In other words, perl's unicode support sucks mightily, and drives us all to drink and bad storytelling. But we knew that.. So, srcdir is not normally flagged as unicode, because typically it's pure ascii. And in that case, things work ok; File::Find finds filenames, which are not yet decoded to unicode, and appends them to the srcdir, and then decode_utf8 happily converts the whole thing. But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of *all* strings, even those containing only ascii. In either case, srcdir has the unicode flag set; a non-decoded filename is appended, and decode_utf8 sees the flag and does *nothing*. The result is that the filename is not decoded, so looks valid and gets skipped. File::Find only sticks the directory and filenames together in no_chdir mode .. but we need that mode for security. In order to retain the security, and avoid the problem, I made it not pass srcdir to File::Find. Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem is avoided. Note that it takes care to chdir back to the starting location. Because the user may have specified relative paths and so staying in the srcdir might break. A relative path could even be specifed for an underlay dir, so it chdirs back after each. --- IkiWiki/Render.pm | 19 ++++++++++++++----- debian/changelog | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index f9fbc801f..0e7aa9a48 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -292,12 +292,11 @@ sub find_src_files () { eval q{use File::Find}; error($@) if $@; - my ($page, $dir, $underlay); + my ($page, $underlay); my $helper=sub { my $file=decode_utf8($_); - return if -l $file || -d _; - $file=~s/^\Q$dir\E\/?//; + $file=~s/^\Q.\/\E//; return if ! length $file; $page = pagename($file); if (! exists $pagesources{$page} && @@ -330,17 +329,27 @@ sub find_src_files () { } }; + eval q{use Cwd}; + die $@ if $@; + my $origdir=getcwd(); + + chdir($config{srcdir}) || die "chdir: $!"; find({ no_chdir => 1, wanted => $helper, - }, $dir=$config{srcdir}); + }, '.'); + chdir($origdir) || die "chdir: $!"; + $underlay=1; foreach (@{$config{underlaydirs}}, $config{underlaydir}) { + chdir($_) || die "chdir: $!"; find({ no_chdir => 1, wanted => $helper, - }, $dir=$_); + }, '.'); + chdir($origdir) || die "chdir: $!"; }; + return \@files, \%pages; } diff --git a/debian/changelog b/debian/changelog index bddedeafa..16f14b3a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) * calendar: Tune archive_pagespec to only match pages, not other files. + * Fix issues with combining unicode srcdirs and source files. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 86a43aefb4f4c79a2044caf847622d0a00cd5356 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 16:40:37 -0400 Subject: Fix issues with combining unicode srcdirs and source files. A short story: Once there was a unicode string, let's call him Srcdir. Along came a crufy old File::Find, who went through a tree and pasted each of the leaves in turn onto Srcdir. But this 90's relic didn't decode the leaves -- despite some of them using unicode! Poor Srcdir, with these leaves stuck on him, tainted them with his nice unicode-ness. They didn't look like leaves at all, but instead garbage. (In other words, perl's unicode support sucks mightily, and drives us all to drink and bad storytelling. But we knew that..) So, srcdir is not normally flagged as unicode, because typically it's pure ascii. And in that case, things work ok; File::Find finds filenames, which are not yet decoded to unicode, and appends them to the srcdir, and then decode_utf8 happily converts the whole thing. But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of *all* strings, even those containing only ascii. In either case, srcdir has the unicode flag set; a non-decoded filename is appended, and the flag remains set; and decode_utf8 sees the flag and does *nothing*. The result is that the filename is not decoded, so looks valid and gets skipped. File::Find only sticks the directory and filenames together in no_chdir mode .. but we need that mode for security. In order to retain the security, and avoid the problem, I made it not pass srcdir to File::Find. Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem is avoided. Note that chdir srcdir is safe because we check for symlinks in the srcdir path. Note that it takes care to chdir back to the starting location. Because the user may have specified relative paths and so staying in the srcdir might break. A relative path could even be specifed for an underlay dir, so it chdirs back after each. --- IkiWiki/Plugin/autoindex.pm | 15 +++++++++------ IkiWiki/Plugin/comments.pm | 12 ++++++++++-- IkiWiki/Render.pm | 21 ++++++++++++++++----- debian/changelog | 1 + 4 files changed, 36 insertions(+), 13 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 0dd76259e..5e8a9e0a3 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -33,18 +33,19 @@ sub genindex ($) { sub refresh () { eval q{use File::Find}; error($@) if $@; + eval q{use Cwd}; + error($@) if $@; + my $origdir=getcwd(); my (%pages, %dirs); foreach my $dir ($config{srcdir}, @{$config{underlaydirs}}, $config{underlaydir}) { - require File::Spec; - $dir=File::Spec->canonpath($dir); + chdir($dir) || die "chdir: $!"; find({ no_chdir => 1, wanted => sub { - my $file=File::Spec->canonpath(decode_utf8($_)); - return if $file eq $dir; - $file=~s/^\Q$dir\E\/?//; + my $file=decode_utf8($_); + $file=~s/^\.\/?//; return unless length $file; if (IkiWiki::file_pruned($file)) { $File::Find::prune=1; @@ -61,7 +62,9 @@ sub refresh () { } } } - }, $dir); + }, '.'); + + chdir($origdir) || die "chdir: $!"; } my %deleted; diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index d204a7737..17cd99c3b 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -660,16 +660,22 @@ sub comments_pending () { eval q{use File::Find}; error($@) if $@; + eval q{use Cwd}; + error($@) if $@; + my $origdir=getcwd(); my $find_comments=sub { my $dir=shift; my $extension=shift; return unless -d $dir; + + chdir($dir) || die "chdir: $!"; + find({ no_chdir => 1, wanted => sub { my $file=decode_utf8($_); - $file=~s/^\Q$dir\E\/?//; + $file=~s/^\.\///; return if ! length $file || IkiWiki::file_pruned($file) || -l $_ || -d _ || $file !~ /\Q$extension\E$/; my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint @@ -678,7 +684,9 @@ sub comments_pending () { push @ret, [$f, $dir, $ctime]; } } - }, $dir); + }, "."); + + chdir($origdir) || die "chdir: $!"; }; $find_comments->($config{srcdir}, "._comment_pending"); diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index f9fbc801f..f81e373b7 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -292,12 +292,17 @@ sub find_src_files () { eval q{use File::Find}; error($@) if $@; - my ($page, $dir, $underlay); + eval q{use Cwd}; + die $@ if $@; + my $origdir=getcwd(); + my $abssrcdir=Cwd::abs_path($config{srcdir}); + + my ($page, $underlay); my $helper=sub { my $file=decode_utf8($_); return if -l $file || -d _; - $file=~s/^\Q$dir\E\/?//; + $file=~s/^\.\///; return if ! length $file; $page = pagename($file); if (! exists $pagesources{$page} && @@ -314,7 +319,7 @@ sub find_src_files () { if ($underlay) { # avoid underlaydir override attacks; see security.mdwn - if (! -l "$config{srcdir}/$f" && ! -e _) { + if (! -l "$abssrcdir/$f" && ! -e _) { if (! $pages{$page}) { push @files, $f; $pages{$page}=1; @@ -330,17 +335,23 @@ sub find_src_files () { } }; + chdir($config{srcdir}) || die "chdir: $!"; find({ no_chdir => 1, wanted => $helper, - }, $dir=$config{srcdir}); + }, '.'); + chdir($origdir) || die "chdir: $!"; + $underlay=1; foreach (@{$config{underlaydirs}}, $config{underlaydir}) { + chdir($_) || die "chdir: $!"; find({ no_chdir => 1, wanted => $helper, - }, $dir=$_); + }, '.'); + chdir($origdir) || die "chdir: $!"; }; + return \@files, \%pages; } diff --git a/debian/changelog b/debian/changelog index bddedeafa..16f14b3a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) * calendar: Tune archive_pagespec to only match pages, not other files. + * Fix issues with combining unicode srcdirs and source files. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 5f33532468fbd52b15ab599a3198749efcfc7710 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 22:56:06 -0400 Subject: Make --gettime be honored after initial setup. Bugfix in passing: New files not treated as such when no rcs is used. --- IkiWiki/Render.pm | 58 +++++++++++++++++++++++++++++-------------------------- debian/changelog | 1 + 2 files changed, 32 insertions(+), 27 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 740bb52b0..c6167b437 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -300,6 +300,7 @@ sub find_src_files () { my ($page, $underlay); my $helper=sub { my $file=decode_utf8($_); + return if -l $file || -d _; $file=~s/^\.\///; return if ! length $file; @@ -363,6 +364,35 @@ sub find_new_files ($) { foreach my $file (@$files) { my $page=pagename($file); + + if ($config{rcs} && $config{gettime} && + -e "$config{srcdir}/$file") { + if (! $times_noted) { + debug(sprintf(gettext("querying %s for file creation and modification times.."), $config{rcs})); + $times_noted=1; + } + + eval { + my $ctime=rcs_getctime("$config{srcdir}/$file"); + if ($ctime > 0) { + $pagectime{$page}=$ctime; + } + }; + if ($@) { + print STDERR $@; + } + my $mtime; + eval { + $mtime=rcs_getmtime("$config{srcdir}/$file"); + }; + if ($@) { + print STDERR $@; + } + elsif ($mtime > 0) { + utime($mtime, $mtime, "$config{srcdir}/$file"); + } + } + if (exists $pagesources{$page} && $pagesources{$page} ne $file) { # the page has changed its type $forcerebuild{$page}=1; @@ -372,34 +402,8 @@ sub find_new_files ($) { if (isinternal($page)) { push @internal_new, $file; } - elsif ($config{rcs}) { + else { push @new, $file; - if ($config{gettime} && -e "$config{srcdir}/$file") { - if (! $times_noted) { - debug(sprintf(gettext("querying %s for file creation and modification times.."), $config{rcs})); - $times_noted=1; - } - - eval { - my $ctime=rcs_getctime("$config{srcdir}/$file"); - if ($ctime > 0) { - $pagectime{$page}=$ctime; - } - }; - if ($@) { - print STDERR $@; - } - my $mtime; - eval { - $mtime=rcs_getmtime("$config{srcdir}/$file"); - }; - if ($@) { - print STDERR $@; - } - elsif ($mtime > 0) { - utime($mtime, $mtime, "$config{srcdir}/$file"); - } - } } $pagecase{lc $page}=$page; if (! exists $pagectime{$page}) { diff --git a/debian/changelog b/debian/changelog index c28120922..cc128c46f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * calendar: Tune archive_pagespec to only match pages, not other files. * Fix issues with combining unicode srcdirs and source files. (Workaround bug #586045) + * Make --gettime be honored after initial setup. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From da2be6e85cc6d515e173597f88712386aa2a27f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Jun 2010 23:21:55 -0400 Subject: git: Gix --gettime to properly support utf8 filenames. In passing, fixed a bug where the srcdir was in a subdir of a repository named "0". --- IkiWiki/Plugin/git.pm | 50 ++++++++++++++++++++++++++++++++++---------------- debian/changelog | 1 + 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index aa402c04f..bb3f89a82 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -280,11 +280,35 @@ sub merge_past ($$$) { return $conflict; } -sub parse_diff_tree ($@) { +{ +my $prefix; +sub decode_git_file ($) { + my $file=shift; + + # git does not output utf-8 filenames, but instead + # double-quotes them with the utf-8 characters + # escaped as \nnn\nnn. + if ($file =~ m/^"(.*)"$/) { + ($file=$1) =~ s/\\([0-7]{1,3})/chr(oct($1))/eg; + } + + # strip prefix if in a subdir + if (! defined $prefix) { + $prefix = run_or_die('git', 'rev-parse', '--show-prefix'); + if (! defined $prefix) { + $prefix=""; + } + } + $file =~ s/^\Q$prefix\E//; + + return decode("utf8", $file); +} +} + +sub parse_diff_tree ($) { # Parse the raw diff tree chunk and return the info hash. # See git-diff-tree(1) for the syntax. - - my ($prefix, $dt_ref) = @_; + my $dt_ref = shift; # End of stream? return if !defined @{ $dt_ref } || @@ -367,16 +391,9 @@ sub parse_diff_tree ($@) { my $sha1_to = shift(@tmp); my $status = shift(@tmp); - # git does not output utf-8 filenames, but instead - # double-quotes them with the utf-8 characters - # escaped as \nnn\nnn. - if ($file =~ m/^"(.*)"$/) { - ($file=$1) =~ s/\\([0-7]{1,3})/chr(oct($1))/eg; - } - $file =~ s/^\Q$prefix\E//; if (length $file) { push @{ $ci{'details'} }, { - 'file' => decode("utf8", $file), + 'file' => decode_git_file($file), 'sha1_from' => $sha1_from[0], 'sha1_to' => $sha1_to, 'mode_from' => $mode_from[0], @@ -403,10 +420,9 @@ sub git_commit_info ($;$) { my @raw_lines = run_or_die('git', 'log', @opts, '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c', '-r', $sha1, '--', '.'); - my ($prefix) = run_or_die('git', 'rev-parse', '--show-prefix'); my @ci; - while (my $parsed = parse_diff_tree(($prefix or ""), \@raw_lines)) { + while (my $parsed = parse_diff_tree(\@raw_lines)) { push @ci, $parsed; } @@ -638,10 +654,12 @@ sub findtimes ($$) { $date=undef; } else { - if (! $time_cache{$line}) { - $time_cache{$line}[0]=$date; # mtime + my $f=decode_git_file($line); + + if (! $time_cache{$f}) { + $time_cache{$f}[0]=$date; # mtime } - $time_cache{$line}[1]=$date; # ctime + $time_cache{$f}[1]=$date; # ctime } } } diff --git a/debian/changelog b/debian/changelog index cc128c46f..aeb9dc0eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * Fix issues with combining unicode srcdirs and source files. (Workaround bug #586045) * Make --gettime be honored after initial setup. + * git: Gix --gettime to properly support utf8 filenames. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From 69c22fa1ea143e3eb36692e087b167ae2171581e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Jun 2010 13:23:32 -0400 Subject: attachment: Support Windows paths when taking basename of client-supplied file name. --- IkiWiki/Plugin/attachment.pm | 5 ++++- debian/changelog | 2 ++ doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 9c774557f..ce688ca40 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -134,9 +134,12 @@ sub formbuilder (@) { } } + $filename=IkiWiki::basename($filename); + $filename=~s/.*\\+(.+)/$1/; # hello, windows + $filename=linkpage(IkiWiki::possibly_foolish_untaint( attachment_location($form->field('page')). - IkiWiki::basename($filename))); + $filename)); if (IkiWiki::file_pruned($filename)) { error(gettext("bad attachment filename")); } diff --git a/debian/changelog b/debian/changelog index aeb9dc0eb..1f350912e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low (Workaround bug #586045) * Make --gettime be honored after initial setup. * git: Gix --gettime to properly support utf8 filenames. + * attachment: Support Windows paths when taking basename of client-supplied + file name. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn b/doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn index de57a1441..ad3aadbce 100644 --- a/doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn +++ b/doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn @@ -4,6 +4,13 @@ It seems as if windows clients (IE) submit filenames with backslash as directory But the attachment plugin translates these backslashes to underscore, making the whole path a filename. +> As far as I can see, that just means that the file will be saved with +> a filename something like `c:__92__My_Documents__92__somefile`. +> I don't see any "does not work" here. Error message? +> +> Still, I don't mind adding a special case, though obviously not in +> `basename`. [[done]] --[[Joey]] + This little hack fixed the backslash problem, although I wonder if that really is the problem? (Everything works perfectly from linux clients of course. :-) -- cgit v1.2.3 From a748f283ace7ff83ac4630674d58767fd2540d8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Jun 2010 15:30:33 -0400 Subject: Encode not used --- IkiWiki/Plugin/wmd.pm | 1 - 1 file changed, 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 99b136281..71d7c9d17 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -4,7 +4,6 @@ package IkiWiki::Plugin::wmd; use warnings; use strict; use IkiWiki 3.00; -use Encode; sub import { add_underlay("wmd"); -- cgit v1.2.3 From 062ed44f47d61c3bbbf2e8a7944a9b4e423b735a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Jun 2010 15:43:42 -0400 Subject: add theme plugin --- IkiWiki/Plugin/theme.pm | 37 ++++ Makefile.PL | 14 +- debian/changelog | 1 + doc/plugins/theme.pm | 11 + themes/actiontabs/style.css | 123 +++++++++++ themes/bzed/background_darkness.png | Bin 0 -> 165 bytes themes/bzed/style.css | 280 ++++++++++++++++++++++++++ underlays/themes/actiontabs/style.css | 123 ----------- underlays/themes/bzed/background_darkness.png | Bin 165 -> 0 bytes underlays/themes/bzed/style.css | 280 -------------------------- 10 files changed, 465 insertions(+), 404 deletions(-) create mode 100644 IkiWiki/Plugin/theme.pm create mode 100644 doc/plugins/theme.pm create mode 100644 themes/actiontabs/style.css create mode 100644 themes/bzed/background_darkness.png create mode 100644 themes/bzed/style.css delete mode 100644 underlays/themes/actiontabs/style.css delete mode 100644 underlays/themes/bzed/background_darkness.png delete mode 100644 underlays/themes/bzed/style.css (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm new file mode 100644 index 000000000..5e6e4b092 --- /dev/null +++ b/IkiWiki/Plugin/theme.pm @@ -0,0 +1,37 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::theme; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "theme", call => \&getsetup); + hook(type => "checkconfig", id => "theme", call => \&checkconfig); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 0, + section => "web", + }, + theme => { + type => "string", + example => "actiontabs", + description => "name of theme to enable", + safe => 1, + rebuild => 0, + }, +} + +my $added=0; +sub checkconfig () { + if (! $added && exists $config{theme} && $config{theme} =~ /^\w+$/) { + add_underlay("themes/".$config{theme}); + $added=1; + } +} + +1 diff --git a/Makefile.PL b/Makefile.PL index 4001c841b..29ec9c209 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -78,7 +78,19 @@ underlay_install: install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \ fi \ done - + + # Themes have their style.css appended to the normal one. + for theme in themes/*; do \ + install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$theme; \ + for file in $$theme/*; do \ + if echo "$$file" | grep -q style.css; then \ + (cat doc/style.css; cat $$file) >> $(DESTDIR)$(PREFIX)/share/ikiwiki/$$theme/style.css; \ + elif [ -f "$$file" ]; then \ + install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file; \ + fi \ + done; \ + done + extra_install: underlay_install # Install example sites. for dir in `cd doc/examples; find . -type d ! -regex '.*\.svn.*'`; do \ diff --git a/debian/changelog b/debian/changelog index 1f350912e..0d49df676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * git: Gix --gettime to properly support utf8 filenames. * attachment: Support Windows paths when taking basename of client-supplied file name. + * theme: New plugin, allows easily theming a site via the underlay. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 diff --git a/doc/plugins/theme.pm b/doc/plugins/theme.pm new file mode 100644 index 000000000..7149cc163 --- /dev/null +++ b/doc/plugins/theme.pm @@ -0,0 +1,11 @@ +[[!template id=plugin name=theme author="[[Joey]]"]] +[[!tag type/web]] + +The theme plugin allows easily applying a theme to your wiki, by +configuring the `theme` setting in the setup file with the name of a theme +to use. The themes you can choose from are all subdirectories, typically +inside `/usr/share/ikiwiki/themes/`. + +A theme provides, via the underlay, an enhanced version of the regular +[[style.css]]. This leaves [[local.css]] free for you to further +customise. Themes can also provide header and background images. diff --git a/themes/actiontabs/style.css b/themes/actiontabs/style.css new file mode 100644 index 000000000..f48448e2e --- /dev/null +++ b/themes/actiontabs/style.css @@ -0,0 +1,123 @@ +/* actiontabs theme for ikiwiki + * + * by svend + */ + +a { + text-decoration: none; + color: #005a9c; +} + +a:hover { + text-decoration: underline; +} + + +hr { + border-style: none; + background-color: #999; + height: 1px; +} + +code, pre { + background: #eee; +} + +pre { + padding: .5em; +} + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + color: black; + background: white; +} + +.pageheader { + margin: 0; + padding: 1em 2em 0 2em; + background: #eee; + border-color: #999; + border-style: none none solid none; + border-width: 1px; +} + +.header { + font-size: 100%; + font-weight: normal; +} + +.title { + display: block; + margin-top: .2em; + font: 140% sans-serif; + text-transform: capitalize; +} + +.actions { + text-align: right; + padding: 0; +} + +#content, #comments, #footer { + margin: 1em 2em; +} + +#pageinfo { + border-color: #999; +} + +.inlinepage { + margin: .4em 0; + padding: .4em 0; + border-style: none; + border-top: 1px solid #aaa; +} + +.inlineheader { + font-size: 120%; + font-weight: normal; +} + +h1 { font: 120% sans-serif } +h2 { font: bold 100% sans-serif } +h3 { font: italic 100% sans-serif } +h4, h5, h6 { font: small-caps 100% sans-serif } + +/* Smaller headings for inline pages */ +.inlinepage h1 { font-size: 110% } +.inlinepage h2 { font-size: 100% } +.inlinepage h3 { font-size: 100% } + +.pageheader .actions ul { + border-style: none +} + +.actions ul { + font-size: 75%; + padding: 0; + border-style: none; +} + +.actions ul li a { + text-decoration: none; +} + +.actions ul li { + margin: 0; + padding: .1em .5em 0 .5em; + background: white; + border-color: #999; + border-style: solid solid none solid; + border-width: 1px; +} + +div.recentchanges { + border-style: none; +} + +.pagecloud { + width: auto; +} diff --git a/themes/bzed/background_darkness.png b/themes/bzed/background_darkness.png new file mode 100644 index 000000000..0a1cb4e9e Binary files /dev/null and b/themes/bzed/background_darkness.png differ diff --git a/themes/bzed/style.css b/themes/bzed/style.css new file mode 100644 index 000000000..540cac415 --- /dev/null +++ b/themes/bzed/style.css @@ -0,0 +1,280 @@ +/* bzed theme for ikiwiki + * + * Copyright (C) 2010 Bernd Zeimetz + * Licensed under same license as ikiwiki: GPL v2 or later + * + * Parts of this file are based on the awesome YUI, + * these parts will stay under the BSD license, + * but you're free to apply the GPLv2 to them, of course. + */ + + + +/* ------------------------------------------------------------------------------------------------- +Based on reset-fonts-grids.css from yui. +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.5.1 +*/ +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,legend,p,blockquote,th,td{margin:0;padding:0;} +table{border-collapse:collapse;border-spacing:0;} +img{border:0;} +address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;} +li{list-style:none;} +caption,th{text-align:left;} +h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} +q:before,q:after{content:'';} +abbr,acronym {border:0;font-variant:normal;} +sup {vertical-align:text-top;} +sub {vertical-align:text-bottom;} +input,textarea,select{font-family:inherit;font-size: 13px/1.23;font-weight:normal;} +input,textarea,select{*font-size:100%;} +legend{color:#000;} +/* body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;} */ +body {font:13px/1.231 "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif;*font-size:small;*font:x-small;} +table {font-size:inherit;font:100%;} +pre,code,kbd,samp,tt{font-family:monospace;} + + +body{text-align:left;} +.inlinefooter{clear:both;} + +/* #doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;} */ +.page {margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;} + +/* #doc3{margin:auto 10px;width:auto;} */ +.page {margin:auto 10px;width:auto;} + +#pagebody, .sidebar{position:relative;} +#pagebody, .sidebar{_position:static;} +#pagebody {position:static;} +.sidebar {float:right;width:16.5em;*width:16em;} +#pagebody {margin-right:19em;*margin-right:18.5em;} +/* #content {float:none;width:auto;} */ +#pagebody:after, .sidebar:after, .page:after{content:".";display:block;height:0;clear:both;visibility:hidden;} +.page f{zoom:1;} + +/* ------------------------------------------------------------------------------------------------ + * Taken from base.css, part of YUI's CSS Foundation + * Copyright (c) 2008, Yahoo! Inc. All rights reserved. + * Code licensed under the BSD License: + * http://developer.yahoo.net/yui/license.txt + * version: 2.5.1 +*/ +h1 { + /*18px via YUI Fonts CSS foundation*/ + font-size:138.5%; +} +h2 { + /*16px via YUI Fonts CSS foundation*/ + font-size:123.1%; +} +h3 { + /*14px via YUI Fonts CSS foundation*/ + font-size:108%; +} +h1,h2,h3 { + /* top & bottom margin based on font size */ + margin:1em 0; +} +h1,h2,h3,h4,h5,h6,strong { + /*bringing boldness back to headers and the strong element*/ + font-weight:bold; +} +abbr,acronym { + /*indicating to users that more info is available */ + border-bottom:1px dotted #000; + cursor:help; +} +em { + /*bringing italics back to the em element*/ + font-style:italic; +} +blockquote,ul,ol,dl { + /*giving blockquotes and lists room to breath*/ + margin:1em; +} +ol,ul,dl { + /*bringing lists on to the page with breathing room */ + margin-left:2em; +} +ol li { + /*giving OL's LIs generated numbers*/ + list-style: decimal outside; +} +ul li { + /*giving UL's LIs generated disc markers*/ + list-style: disc outside; +} +dl dd { + /*giving UL's LIs generated numbers*/ + margin-left:1em; +} +th,td { + /*borders and padding to make the table readable*/ + border:1px solid #000; + padding:.5em; +} +th { + /*distinguishing table headers from data cells*/ + font-weight:bold; + text-align:center; +} +caption { + /*coordinated margin to match cell's padding*/ + margin-bottom:.5em; + /*centered so it doesn't blend in to other content*/ + text-align:center; +} +p,fieldset,table,pre { + /*so things don't run into each other*/ + margin-bottom:1em; +} + +#searchbox { + width:21.5em;*width:21em; +} + + + +/* ------------------------------------------------------------------------------------------------ + * All CSS below is + * Copyright (C) 2010 Bernd Zeimetz + * Licensed under same license as ikiwiki: GPL v2 or later */ + +.page, .pageheader, .sidebar, #content, #comments, .inlinepage, .recentchanges, .pageheader .actions ul, #pagebody { + border: none; +} + +html, body { + color:#000; + /* background-image: url('body_background.png'); + background-repeat: repeat; */ + background-color: #8da1b8; +} + +body { + padding-left: 5%; + padding-right: 5%; + padding-top: 1em; + padding-bottom: 1em; +} + +.page { + background: #fff; + border: outset #ccc; + padding-left: 1em; + padding-right: 1em; + padding-top: 1em; +} + +.pageheader { + background-image: url('header_background.png'); + background-repeat: repeat-x; + height: 100px; + padding-left: 1em; + padding-right: 1em; + padding-bottom: 1em; + padding-top: 1em; +} + +.pageheader .header { + text-align: top; + clear: both; +} + +.pageheader .header form { + padding: 0em 0em 0em 0em; + float: right; + margin-top: 0.5em; +} + +.pageheader .header .title, .pageheader .header .parentlinks, + .inlinepage .inlineheader, + h1, h2, h3, h4, h5, h6 { + margin-top: 1em; + font-weight: bold; +} + +.pageheader .header .title, .pageheader .header .parentlinks, .pageheader .actions ul li, .pageheader .header span { + padding: 0.25em 0.25em 0.25em 0.25em; + background-image: url('background_darkness.png'); + background-repeat: repeat; + color: white; +} + +.pageheader .header span a, .pageheader .actions ul li a, .pageheader .header .parentlinks a { + color: white; + text-decoration: none; +} + +.pageheader .actions { + text-align: right; + vertical-align: bottom; + clear: both; +} + +#pagebody { + padding-right: 1em; + padding-bottom: 2em; + border-right: ridge #eee; + clear: none; +} + +#content a, #comments a, .sidebar a { + color: #315485; + text-decoration: none; + font-weight: bold; +} + +.sidebar h2 { + border-bottom: ridge #eee; + padding-right: 0; +} + +.sidebar .menu { + margin-left: 1em; +} + + +.inlinepage, .recentchanges, div.recentchanges { + clear: none !important; + margin-bottom: 2em; +} + +.inlinefooter { + border-top: 1px dotted #315485; +} + +.inlinefooter .pagedate, .inlinefooter .tags { + display: inline; + clear: none; + margin-right: 2em; +} + +.calendar .month-calendar th, .calendar .month-calendar td { + padding: 0.22em; +} + +@media print { + .sidebar, .page .pageheader .header .parentlinks { + content:"."; + display:block; + height:0; + visibility:hidden; + } + .page { + padding: 1em 1em 1em 1em; + } + .pageheader .header span a, .pageheader .actions ul li a, .pageheader .header .parentlinks a { + color #315485; + } + #content, #comments, #pagebody { + margin-right: 0; + *margin-right: 0; + border-right: none; + } + +} + diff --git a/underlays/themes/actiontabs/style.css b/underlays/themes/actiontabs/style.css deleted file mode 100644 index f48448e2e..000000000 --- a/underlays/themes/actiontabs/style.css +++ /dev/null @@ -1,123 +0,0 @@ -/* actiontabs theme for ikiwiki - * - * by svend - */ - -a { - text-decoration: none; - color: #005a9c; -} - -a:hover { - text-decoration: underline; -} - - -hr { - border-style: none; - background-color: #999; - height: 1px; -} - -code, pre { - background: #eee; -} - -pre { - padding: .5em; -} - -body { - margin: 0; - padding: 0; - font-family: sans-serif; - color: black; - background: white; -} - -.pageheader { - margin: 0; - padding: 1em 2em 0 2em; - background: #eee; - border-color: #999; - border-style: none none solid none; - border-width: 1px; -} - -.header { - font-size: 100%; - font-weight: normal; -} - -.title { - display: block; - margin-top: .2em; - font: 140% sans-serif; - text-transform: capitalize; -} - -.actions { - text-align: right; - padding: 0; -} - -#content, #comments, #footer { - margin: 1em 2em; -} - -#pageinfo { - border-color: #999; -} - -.inlinepage { - margin: .4em 0; - padding: .4em 0; - border-style: none; - border-top: 1px solid #aaa; -} - -.inlineheader { - font-size: 120%; - font-weight: normal; -} - -h1 { font: 120% sans-serif } -h2 { font: bold 100% sans-serif } -h3 { font: italic 100% sans-serif } -h4, h5, h6 { font: small-caps 100% sans-serif } - -/* Smaller headings for inline pages */ -.inlinepage h1 { font-size: 110% } -.inlinepage h2 { font-size: 100% } -.inlinepage h3 { font-size: 100% } - -.pageheader .actions ul { - border-style: none -} - -.actions ul { - font-size: 75%; - padding: 0; - border-style: none; -} - -.actions ul li a { - text-decoration: none; -} - -.actions ul li { - margin: 0; - padding: .1em .5em 0 .5em; - background: white; - border-color: #999; - border-style: solid solid none solid; - border-width: 1px; -} - -div.recentchanges { - border-style: none; -} - -.pagecloud { - width: auto; -} diff --git a/underlays/themes/bzed/background_darkness.png b/underlays/themes/bzed/background_darkness.png deleted file mode 100644 index 0a1cb4e9e..000000000 Binary files a/underlays/themes/bzed/background_darkness.png and /dev/null differ diff --git a/underlays/themes/bzed/style.css b/underlays/themes/bzed/style.css deleted file mode 100644 index 540cac415..000000000 --- a/underlays/themes/bzed/style.css +++ /dev/null @@ -1,280 +0,0 @@ -/* bzed theme for ikiwiki - * - * Copyright (C) 2010 Bernd Zeimetz - * Licensed under same license as ikiwiki: GPL v2 or later - * - * Parts of this file are based on the awesome YUI, - * these parts will stay under the BSD license, - * but you're free to apply the GPLv2 to them, of course. - */ - - - -/* ------------------------------------------------------------------------------------------------- -Based on reset-fonts-grids.css from yui. -Copyright (c) 2008, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.5.1 -*/ -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,legend,p,blockquote,th,td{margin:0;padding:0;} -table{border-collapse:collapse;border-spacing:0;} -img{border:0;} -address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;} -li{list-style:none;} -caption,th{text-align:left;} -h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} -q:before,q:after{content:'';} -abbr,acronym {border:0;font-variant:normal;} -sup {vertical-align:text-top;} -sub {vertical-align:text-bottom;} -input,textarea,select{font-family:inherit;font-size: 13px/1.23;font-weight:normal;} -input,textarea,select{*font-size:100%;} -legend{color:#000;} -/* body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;} */ -body {font:13px/1.231 "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif;*font-size:small;*font:x-small;} -table {font-size:inherit;font:100%;} -pre,code,kbd,samp,tt{font-family:monospace;} - - -body{text-align:left;} -.inlinefooter{clear:both;} - -/* #doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;} */ -.page {margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;} - -/* #doc3{margin:auto 10px;width:auto;} */ -.page {margin:auto 10px;width:auto;} - -#pagebody, .sidebar{position:relative;} -#pagebody, .sidebar{_position:static;} -#pagebody {position:static;} -.sidebar {float:right;width:16.5em;*width:16em;} -#pagebody {margin-right:19em;*margin-right:18.5em;} -/* #content {float:none;width:auto;} */ -#pagebody:after, .sidebar:after, .page:after{content:".";display:block;height:0;clear:both;visibility:hidden;} -.page f{zoom:1;} - -/* ------------------------------------------------------------------------------------------------ - * Taken from base.css, part of YUI's CSS Foundation - * Copyright (c) 2008, Yahoo! Inc. All rights reserved. - * Code licensed under the BSD License: - * http://developer.yahoo.net/yui/license.txt - * version: 2.5.1 -*/ -h1 { - /*18px via YUI Fonts CSS foundation*/ - font-size:138.5%; -} -h2 { - /*16px via YUI Fonts CSS foundation*/ - font-size:123.1%; -} -h3 { - /*14px via YUI Fonts CSS foundation*/ - font-size:108%; -} -h1,h2,h3 { - /* top & bottom margin based on font size */ - margin:1em 0; -} -h1,h2,h3,h4,h5,h6,strong { - /*bringing boldness back to headers and the strong element*/ - font-weight:bold; -} -abbr,acronym { - /*indicating to users that more info is available */ - border-bottom:1px dotted #000; - cursor:help; -} -em { - /*bringing italics back to the em element*/ - font-style:italic; -} -blockquote,ul,ol,dl { - /*giving blockquotes and lists room to breath*/ - margin:1em; -} -ol,ul,dl { - /*bringing lists on to the page with breathing room */ - margin-left:2em; -} -ol li { - /*giving OL's LIs generated numbers*/ - list-style: decimal outside; -} -ul li { - /*giving UL's LIs generated disc markers*/ - list-style: disc outside; -} -dl dd { - /*giving UL's LIs generated numbers*/ - margin-left:1em; -} -th,td { - /*borders and padding to make the table readable*/ - border:1px solid #000; - padding:.5em; -} -th { - /*distinguishing table headers from data cells*/ - font-weight:bold; - text-align:center; -} -caption { - /*coordinated margin to match cell's padding*/ - margin-bottom:.5em; - /*centered so it doesn't blend in to other content*/ - text-align:center; -} -p,fieldset,table,pre { - /*so things don't run into each other*/ - margin-bottom:1em; -} - -#searchbox { - width:21.5em;*width:21em; -} - - - -/* ------------------------------------------------------------------------------------------------ - * All CSS below is - * Copyright (C) 2010 Bernd Zeimetz - * Licensed under same license as ikiwiki: GPL v2 or later */ - -.page, .pageheader, .sidebar, #content, #comments, .inlinepage, .recentchanges, .pageheader .actions ul, #pagebody { - border: none; -} - -html, body { - color:#000; - /* background-image: url('body_background.png'); - background-repeat: repeat; */ - background-color: #8da1b8; -} - -body { - padding-left: 5%; - padding-right: 5%; - padding-top: 1em; - padding-bottom: 1em; -} - -.page { - background: #fff; - border: outset #ccc; - padding-left: 1em; - padding-right: 1em; - padding-top: 1em; -} - -.pageheader { - background-image: url('header_background.png'); - background-repeat: repeat-x; - height: 100px; - padding-left: 1em; - padding-right: 1em; - padding-bottom: 1em; - padding-top: 1em; -} - -.pageheader .header { - text-align: top; - clear: both; -} - -.pageheader .header form { - padding: 0em 0em 0em 0em; - float: right; - margin-top: 0.5em; -} - -.pageheader .header .title, .pageheader .header .parentlinks, - .inlinepage .inlineheader, - h1, h2, h3, h4, h5, h6 { - margin-top: 1em; - font-weight: bold; -} - -.pageheader .header .title, .pageheader .header .parentlinks, .pageheader .actions ul li, .pageheader .header span { - padding: 0.25em 0.25em 0.25em 0.25em; - background-image: url('background_darkness.png'); - background-repeat: repeat; - color: white; -} - -.pageheader .header span a, .pageheader .actions ul li a, .pageheader .header .parentlinks a { - color: white; - text-decoration: none; -} - -.pageheader .actions { - text-align: right; - vertical-align: bottom; - clear: both; -} - -#pagebody { - padding-right: 1em; - padding-bottom: 2em; - border-right: ridge #eee; - clear: none; -} - -#content a, #comments a, .sidebar a { - color: #315485; - text-decoration: none; - font-weight: bold; -} - -.sidebar h2 { - border-bottom: ridge #eee; - padding-right: 0; -} - -.sidebar .menu { - margin-left: 1em; -} - - -.inlinepage, .recentchanges, div.recentchanges { - clear: none !important; - margin-bottom: 2em; -} - -.inlinefooter { - border-top: 1px dotted #315485; -} - -.inlinefooter .pagedate, .inlinefooter .tags { - display: inline; - clear: none; - margin-right: 2em; -} - -.calendar .month-calendar th, .calendar .month-calendar td { - padding: 0.22em; -} - -@media print { - .sidebar, .page .pageheader .header .parentlinks { - content:"."; - display:block; - height:0; - visibility:hidden; - } - .page { - padding: 1em 1em 1em 1em; - } - .pageheader .header span a, .pageheader .actions ul li a, .pageheader .header .parentlinks a { - color #315485; - } - #content, #comments, #pagebody { - margin-right: 0; - *margin-right: 0; - border-right: none; - } - -} - -- cgit v1.2.3 From 2f3f826b5bf123886d4e65eb8bd709b12639ca8b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Jun 2010 15:44:21 -0400 Subject: force rebuild for theme change For now, a rebuild is the only way to ensure the changed theme is used. Ikiwiki normally will not realize style.css has changed, since themes tend to have the same timestamp for the file. --- IkiWiki/Plugin/theme.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm index 5e6e4b092..ba6966381 100644 --- a/IkiWiki/Plugin/theme.pm +++ b/IkiWiki/Plugin/theme.pm @@ -22,7 +22,7 @@ sub getsetup () { example => "actiontabs", description => "name of theme to enable", safe => 1, - rebuild => 0, + rebuild => 1, }, } -- cgit v1.2.3 From eff5e233a2a3bf5e965c17734a3ad765c5fe9df5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Jun 2010 16:07:41 -0400 Subject: force list context run_or_die returns a status code in scalar context --- IkiWiki/Plugin/git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index bb3f89a82..222692eda 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -294,7 +294,7 @@ sub decode_git_file ($) { # strip prefix if in a subdir if (! defined $prefix) { - $prefix = run_or_die('git', 'rev-parse', '--show-prefix'); + ($prefix) = run_or_die('git', 'rev-parse', '--show-prefix'); if (! defined $prefix) { $prefix=""; } -- cgit v1.2.3 From cb4b99929757f970d5ae697f0d09514ad624ed46 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 17 Jun 2010 16:54:03 -0400 Subject: avoid dying if cannot chdir to an underlaydir --- IkiWiki/Plugin/autoindex.pm | 4 ++-- IkiWiki/Plugin/comments.pm | 4 ++-- IkiWiki/Render.pm | 17 +++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index 5e8a9e0a3..c3eb53300 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -39,7 +39,7 @@ sub refresh () { my (%pages, %dirs); foreach my $dir ($config{srcdir}, @{$config{underlaydirs}}, $config{underlaydir}) { - chdir($dir) || die "chdir: $!"; + chdir($dir) || next; find({ no_chdir => 1, @@ -64,7 +64,7 @@ sub refresh () { } }, '.'); - chdir($origdir) || die "chdir: $!"; + chdir($origdir) || die "chdir $origdir: $!"; } my %deleted; diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 17cd99c3b..d1558001a 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -669,7 +669,7 @@ sub comments_pending () { my $extension=shift; return unless -d $dir; - chdir($dir) || die "chdir: $!"; + chdir($dir) || die "chdir $dir: $!"; find({ no_chdir => 1, @@ -686,7 +686,7 @@ sub comments_pending () { } }, "."); - chdir($origdir) || die "chdir: $!"; + chdir($origdir) || die "chdir $origdir: $!"; }; $find_comments->($config{srcdir}, "._comment_pending"); diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index c6167b437..aae1f90b0 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -335,21 +335,22 @@ sub find_src_files () { } }; - chdir($config{srcdir}) || die "chdir: $!"; + chdir($config{srcdir}) || die "chdir $config{srcdir}: $!"; find({ no_chdir => 1, wanted => $helper, }, '.'); - chdir($origdir) || die "chdir: $!"; + chdir($origdir) || die "chdir $origdir: $!"; $underlay=1; foreach (@{$config{underlaydirs}}, $config{underlaydir}) { - chdir($_) || die "chdir: $!"; - find({ - no_chdir => 1, - wanted => $helper, - }, '.'); - chdir($origdir) || die "chdir: $!"; + if (chdir($_)) { + find({ + no_chdir => 1, + wanted => $helper, + }, '.'); + chdir($origdir) || die "chdir: $!"; + } }; return \@files, \%pages; -- cgit v1.2.3 From 2797a659db82dd1a0021dacd005fa80212c41579 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jun 2010 12:48:05 -0400 Subject: mercurial: Fix buggy getctime code. The file passed to rcs_getctime is already absolute, and it was trying to stick the srcdir on the front. Also, eliminated potentially unsafe shelling. --- IkiWiki/Plugin/mercurial.pm | 10 ++++------ debian/changelog | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index 34e009c7a..a80bb2da5 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -236,15 +236,13 @@ sub rcs_diff ($) { sub rcs_getctime ($) { my ($file) = @_; - # XXX filename passes through the shell here, should try to avoid - # that just in case my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", - "--style", "default", "$config{srcdir}/$file"); - open (my $out, "@cmdline |"); + "--style", "default", $file); + open (my $out, "-|", @cmdline); - my @log = mercurial_log($out); + my @log = (mercurial_log($out)); - if (length @log < 1) { + if (@log < 1) { return 0; } diff --git a/debian/changelog b/debian/changelog index 0d49df676..516b84063 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low * attachment: Support Windows paths when taking basename of client-supplied file name. * theme: New plugin, allows easily theming a site via the underlay. + * mercurial: Fix buggy getctime code. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400 -- cgit v1.2.3 From d5199424c5625a816a2a3204708905e76bfb71aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jun 2010 12:50:31 -0400 Subject: avoid shelling --- IkiWiki/Plugin/bzr.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index e7c1b8d8e..9bee0c4b2 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -287,9 +287,7 @@ sub rcs_diff ($) { } sub extract_timestamp (@) { - # XXX filename passes through the shell here, should try to avoid - # that just in case - open (my $out, "@_ |"); + open (my $out, "-|", @_); my @log = bzr_log($out); if (length @log < 1) { -- cgit v1.2.3 From cfcc79ed4c9f11ef8af2ae19e3bb402289e9ea39 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jun 2010 16:15:57 -0400 Subject: needsbuild hook is passed an array ref --- IkiWiki/Plugin/skeleton.pm.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index 34713c73b..adffc91c9 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -70,7 +70,7 @@ sub refresh () { debug("skeleton plugin refresh"); } -sub needsbuild () { +sub needsbuild ($) { debug("skeleton plugin needsbuild"); } -- cgit v1.2.3 From 57e56828f5b03f8fb31631f36731f989d4335607 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 18 Jun 2010 16:40:47 -0400 Subject: store state to avoid needing to rebuild when changing theme --- IkiWiki/Plugin/theme.pm | 30 +++++++++++++++++++++++++++++- doc/bugs/underlaydir_file_expose.mdwn | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm index ba6966381..03b0816ed 100644 --- a/IkiWiki/Plugin/theme.pm +++ b/IkiWiki/Plugin/theme.pm @@ -8,6 +8,7 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "theme", call => \&getsetup); hook(type => "checkconfig", id => "theme", call => \&checkconfig); + hook(type => "needsbuild", id => "theme", call => \&needsbuild); } sub getsetup () { @@ -22,7 +23,7 @@ sub getsetup () { example => "actiontabs", description => "name of theme to enable", safe => 1, - rebuild => 1, + rebuild => 0, }, } @@ -34,4 +35,31 @@ sub checkconfig () { } } +sub needsbuild ($) { + my $needsbuild=shift; + if (($config{theme} || '') ne ($wikistate{theme}{currenttheme} || '')) { + # theme changed; ensure all files in the theme are built + my %needsbuild=map { $_ => 1 } @$needsbuild; + if ($config{theme}) { + foreach my $file (glob("$config{underlaydirbase}/themes/$config{theme}/*")) { + if (-f $file) { + my $f=IkiWiki::basename($file); + push @$needsbuild, $f + unless $needsbuild{$f}; + } + } + } + elsif ($wikistate{theme}{currenttheme}) { + foreach my $file (glob("$config{underlaydirbase}/themes/$wikistate{theme}{currenttheme}/*")) { + my $f=IkiWiki::basename($file); + if (-f $file && defined eval { srcfile($f) }) { + push @$needsbuild, $f; + } + } + } + + $wikistate{theme}{currenttheme}=$config{theme}; + } +} + 1 diff --git a/doc/bugs/underlaydir_file_expose.mdwn b/doc/bugs/underlaydir_file_expose.mdwn index ca492e396..4ee30e39d 100644 --- a/doc/bugs/underlaydir_file_expose.mdwn +++ b/doc/bugs/underlaydir_file_expose.mdwn @@ -9,4 +9,5 @@ gets rebuilt.) > A related problem occurs if changing a site's theme with the > [[plugins/theme]] plugin. The style.css of the old and new theme > often has the same mtime, so ikiwiki does not update it w/o a rebuild. +> This is worked around in theme.pm with a special-purpose needsbuild hook. > --[[Joey]] -- cgit v1.2.3 From dd3274ce734e3af0ca6a7940f69201d8d4b84fda Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Mon, 14 Jun 2010 01:18:33 +0200 Subject: Enhance the link plugin to handle external links. The following ways to create a link are supported now: [[url]] [[text|url]] url can be one of the following: - an internal wikilink: will be handled as before - any other kind of URL, including mailto: proper links will be created: url text - an email address: url text --- IkiWiki/Plugin/link.pm | 89 +++++++++++++++++++++++++++++++++++++------------- doc/plugins/link.mdwn | 2 +- 2 files changed, 68 insertions(+), 23 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index 3838aec09..d41965bd3 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -7,6 +7,9 @@ use IkiWiki 3.00; my $link_regexp; +my $email_regexp = qr/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; +my $url_regexp = qr/^(?:[^:]+:\/\/|mailto:).*/i; + sub import { hook(type => "getsetup", id => "link", call => \&getsetup); hook(type => "checkconfig", id => "link", call => \&checkconfig); @@ -57,8 +60,42 @@ sub checkconfig () { )? # optional \]\] # end of link - }x, + }x; + } +} + +sub is_externallink ($$) { + my $page = shift; + my $url = shift; + if ($url =~ /$email_regexp/) { + # url looks like an email address, so we assume it + # is supposed to be an external link if there is no + # page with that name. + $url =~ s/#.*//; + return (! (bestlink($page, linkpage($url)))) } + return ($url =~ /$url_regexp/) +} + +sub externallink ($;@) { + my $url = shift; + my $pagetitle = shift; + + # build pagetitle + if (!($pagetitle)) { + $pagetitle = $url; + # use only the email address as title for mailto: urls + if ($pagetitle =~ /^mailto:.*/) { + $pagetitle =~ s/^mailto:([^?]+).*/$1/; + } + } + + # handle email-addresses (without mailto:): + if ($url =~ /$email_regexp/) { + $url = "mailto:" . $url; + } + + return "$pagetitle"; } sub linkify (@) { @@ -70,12 +107,16 @@ sub linkify (@) { defined $2 ? ( $1 ? "[[$2|$3".($4 ? "#$4" : "")."]]" - : htmllink($page, $destpage, linkpage($3), - anchor => $4, linktext => pagetitle($2))) + : is_externallink($page, $3 . ($4 ? "#$4" : "")) + ? externallink("$3" . ($4 ? "#$4" : ""), $2) + : htmllink($page, $destpage, linkpage($3), + anchor => $4, linktext => pagetitle($2))) : ( $1 ? "[[$3".($4 ? "#$4" : "")."]]" - : htmllink($page, $destpage, linkpage($3), - anchor => $4)) + : is_externallink($page, $3 . ($4 ? "#$4" : "")) + ? externallink("$3" . ($4 ? "#$4" : "")) + : htmllink($page, $destpage, linkpage($3), + anchor => $4)) }eg; return $params{content}; @@ -87,7 +128,9 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /(? Date: Wed, 23 Jun 2010 13:40:10 -0400 Subject: avoid needing full email regexp Fully validating the email address is not necessary, all that matters is not matching an url like http://foo@bar/ as an email address. --- IkiWiki/Plugin/link.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index d41965bd3..7d4692ef0 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -7,7 +7,7 @@ use IkiWiki 3.00; my $link_regexp; -my $email_regexp = qr/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i; +my $email_regexp = qr/^.+@.+$/; my $url_regexp = qr/^(?:[^:]+:\/\/|mailto:).*/i; sub import { @@ -82,7 +82,7 @@ sub externallink ($;@) { my $pagetitle = shift; # build pagetitle - if (!($pagetitle)) { + if (! $pagetitle) { $pagetitle = $url; # use only the email address as title for mailto: urls if ($pagetitle =~ /^mailto:.*/) { @@ -90,8 +90,8 @@ sub externallink ($;@) { } } - # handle email-addresses (without mailto:): - if ($url =~ /$email_regexp/) { + if ($url !~ /$url_regexp/) { + # handle email addresses (without mailto:) $url = "mailto:" . $url; } -- cgit v1.2.3 From 6e67219eff9ea599e9efa8a846a4c78c76c5b008 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 13:57:27 -0400 Subject: simplify anchor handling At least two bugfixes in here. First, an old bug; \[[foo#0]] was displayed as [[foo]], losing the anchor as the anchor text was false. Secondly, a new bug; an email like foo#bar@baz should not check bestlink("foo@baz"). --- IkiWiki/Plugin/link.pm | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index 7d4692ef0..87e06ca89 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -64,23 +64,33 @@ sub checkconfig () { } } -sub is_externallink ($$) { +sub is_externallink ($$;$) { my $page = shift; my $url = shift; + my $anchor = shift; + + if (defined $anchor) { + $url.="#".$anchor; + } + if ($url =~ /$email_regexp/) { # url looks like an email address, so we assume it # is supposed to be an external link if there is no # page with that name. - $url =~ s/#.*//; return (! (bestlink($page, linkpage($url)))) } return ($url =~ /$url_regexp/) } -sub externallink ($;@) { +sub externallink ($$;$) { my $url = shift; + my $anchor = shift; my $pagetitle = shift; + if (defined $anchor) { + $url.="#".$anchor; + } + # build pagetitle if (! $pagetitle) { $pagetitle = $url; @@ -106,15 +116,15 @@ sub linkify (@) { $params{content} =~ s{(\\?)$link_regexp}{ defined $2 ? ( $1 - ? "[[$2|$3".($4 ? "#$4" : "")."]]" - : is_externallink($page, $3 . ($4 ? "#$4" : "")) - ? externallink("$3" . ($4 ? "#$4" : ""), $2) + ? "[[$2|$3".(defined $4 ? "#$4" : "")."]]" + : is_externallink($page, $3, $4) + ? externallink($3, $4, $2) : htmllink($page, $destpage, linkpage($3), anchor => $4, linktext => pagetitle($2))) : ( $1 - ? "[[$3".($4 ? "#$4" : "")."]]" - : is_externallink($page, $3 . ($4 ? "#$4" : "")) - ? externallink("$3" . ($4 ? "#$4" : "")) + ? "[[$3".(defined $4 ? "#$4" : "")."]]" + : is_externallink($page, $3, $4) + ? externallink($3, $4) : htmllink($page, $destpage, linkpage($3), anchor => $4)) }eg; @@ -128,7 +138,7 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /(? Date: Wed, 23 Jun 2010 14:05:57 -0400 Subject: bugfix: record email-like links as page links This way, an email-like link will be a mailto until a matching page is created, then it will link to the page. And removing the page will convert it back to a mailto. --- IkiWiki/Plugin/link.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index 87e06ca89..f6c3573f7 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -64,21 +64,23 @@ sub checkconfig () { } } -sub is_externallink ($$;$) { +sub is_externallink ($$;$$) { my $page = shift; my $url = shift; my $anchor = shift; + my $force = shift; if (defined $anchor) { $url.="#".$anchor; } - if ($url =~ /$email_regexp/) { + if (! $force && $url =~ /$email_regexp/) { # url looks like an email address, so we assume it # is supposed to be an external link if there is no # page with that name. return (! (bestlink($page, linkpage($url)))) } + return ($url =~ /$url_regexp/) } @@ -138,7 +140,7 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /(? Date: Wed, 23 Jun 2010 15:23:13 -0400 Subject: whitespace --- IkiWiki/Plugin/cvs.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 360d97249..18491d517 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -305,7 +305,7 @@ sub rcs_rename ($$) { rcs_remove($src); } -sub rcs_recentchanges($) { +sub rcs_recentchanges ($) { my $num = shift; my @ret; -- cgit v1.2.3 From c46bcb425af0948ac59581d6ba7b477826d83ae3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 15:32:27 -0400 Subject: Add new optional field usershort to rcs_recentchanges. Now the git plugin supports commits with author fields that look like: Author: http://my.openid/ Then in recentchanges, the short username will be displayed, linking to the openid. Particularly useful for the horrible google openids, of course. --- IkiWiki/Plugin/git.pm | 15 +++++++++++---- IkiWiki/Plugin/recentchanges.pm | 3 +-- debian/changelog | 6 ++++++ doc/plugins/write.mdwn | 4 +++- 4 files changed, 21 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 222692eda..a43b85920 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -342,8 +342,9 @@ sub parse_diff_tree ($) { $ci{ "${who}_epoch" } = $epoch; $ci{ "${who}_tz" } = $tz; - if ($name =~ m/^[^<]+\s+<([^@>]+)/) { - $ci{"${who}_username"} = $1; + if ($name =~ m/^([^<]+)\s+<([^@>]+)/) { + $ci{"${who}_name"} = $1; + $ci{"${who}_username"} = $2; } elsif ($name =~ m/^([^<]+)\s+<>$/) { $ci{"${who}_username"} = $1; @@ -588,9 +589,14 @@ sub rcs_recentchanges ($) { push @messages, { line => $line }; } - my $user=$ci->{'author_username'}; + my $user=$ci->{'author_name'}; + my $usershort=$ci->{'author_username'}; my $web_commit = ($ci->{'author'} =~ /\@web>/); - + + if ($usershort =~ /:\/\//) { + $usershort=undef; # url; not really short + } + # compatability code for old web commit messages if (! $web_commit && defined $messages[0] && @@ -603,6 +609,7 @@ sub rcs_recentchanges ($) { push @rets, { rev => $sha1, user => $user, + usershort => $usershort, committype => $web_commit ? "web" : "git", when => $when, message => [@messages], diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index e546e4702..9f188cbff 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -114,12 +114,11 @@ sub store ($$$) { ]; push @{$change->{pages}}, { link => '...' } if $is_excess; - # See if the committer is an openid. $change->{author}=$change->{user}; my $oiduser=eval { IkiWiki::openiduser($change->{user}) }; if (defined $oiduser) { $change->{authorurl}=$change->{user}; - $change->{user}=$oiduser; + $change->{user}=defined $change->{usershort} ? $change->{usershort} : $oiduser; } elsif (length $config{cgiurl}) { $change->{authorurl} = IkiWiki::cgiurl( diff --git a/debian/changelog b/debian/changelog index 032041346..01d0abb47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100624) UNRELEASED; urgency=low + + * Add new optional field usershort to rcs_recentchanges. + + -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 + ikiwiki (3.20100623) unstable; urgency=low * openid: Add openid_realm and openid_cgiurl configuration options, diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 193005565..5f0e95a9f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1103,7 +1103,9 @@ The data structure returned for each change is: { rev => # the RCSs id for this commit - user => # name of user who made the change, + user => # user who made the change (may be an openid), + usershort => # short name of user (optional; not an openid), + committype => # either "web" or the name of the rcs, when => # time when the change was made, message => [ -- cgit v1.2.3 From b4a43406f61b7ff9ab77d242edf4d59369ac8596 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 16:05:49 -0400 Subject: API: rcs_commit and rcs_commit_staged are passed a new parameter that may contain the username component of the email address of the user making the commit. --- IkiWiki/Plugin/bzr.pm | 8 ++++---- IkiWiki/Plugin/cvs.pm | 7 ++++--- IkiWiki/Plugin/darcs.pm | 8 ++++---- IkiWiki/Plugin/git.pm | 8 ++++---- IkiWiki/Plugin/mercurial.pm | 8 ++++---- IkiWiki/Plugin/monotone.pm | 7 ++++--- IkiWiki/Plugin/norcs.pm | 8 ++++---- IkiWiki/Plugin/svn.pm | 7 ++++--- IkiWiki/Plugin/tla.pm | 7 ++++--- debian/changelog | 5 ++++- doc/plugins/write.mdwn | 10 ++++++---- 11 files changed, 46 insertions(+), 37 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 9bee0c4b2..44ab9a86a 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -137,8 +137,8 @@ sub bzr_author ($$) { } } -sub rcs_commit ($$$;$$) { - my ($file, $message, $rcstoken, $user, $ipaddr) = @_; +sub rcs_commit ($$$;$$$) { + my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; $user = bzr_author($user, $ipaddr); @@ -156,10 +156,10 @@ sub rcs_commit ($$$;$$) { return undef; # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; $user = bzr_author($user, $ipaddr); diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 18491d517..a9fe162a1 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -183,7 +183,7 @@ sub rcs_prepedit ($) { return defined $rev ? $rev : ""; } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. @@ -192,6 +192,7 @@ sub rcs_commit ($$$;$$) { my $rcstoken=shift; my $user=shift; my $ipaddr=shift; + my $emailuser=shift; return unless cvs_is_controlling; @@ -224,10 +225,10 @@ sub rcs_commit ($$$;$$) { return undef # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; if (defined $user) { $message="web commit by $user".(length $message ? ": $message" : ""); diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index f17fadcb1..345456c01 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -140,11 +140,11 @@ sub rcs_prepedit ($) { return $rev; } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { # Commit the page. Returns 'undef' on success and a version of the page # with conflict markers on failure. - my ($file, $message, $rcstoken, $user, $ipaddr) = @_; + my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; # Compute if the "revision" of $file changed. my $changed = darcs_rev($file) ne $rcstoken; @@ -239,8 +239,8 @@ sub rcs_commit ($$$;$$) { } } -sub rcs_commit_staged ($$$) { - my ($message, $user, $ipaddr) = @_; +sub rcs_commit_staged ($$$;$) { + my ($message, $user, $ipaddr, $emailuser) = @_; my $author; if (defined $user) { diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index a43b85920..b56f229d7 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -464,12 +464,12 @@ sub rcs_prepedit ($) { return git_sha1($file); } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { # Try to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on # failure. - my ($file, $message, $rcstoken, $user, $ipaddr) = @_; + my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; # Check to see if the page has been changed by someone else since # rcs_prepedit was called. @@ -485,10 +485,10 @@ sub rcs_commit ($$$;$$) { return rcs_commit_staged($message, $user, $ipaddr); } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; # Set the commit author and email to the web committer. my %env=%ENV; diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index a80bb2da5..1793ab4bb 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -126,8 +126,8 @@ sub rcs_prepedit ($) { return ""; } -sub rcs_commit ($$$;$$) { - my ($file, $message, $rcstoken, $user, $ipaddr) = @_; +sub rcs_commit ($$$;$$$) { + my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; if (defined $user) { $user = IkiWiki::possibly_foolish_untaint($user); @@ -153,10 +153,10 @@ sub rcs_commit ($$$;$$) { return undef; # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; error("rcs_commit_staged not implemented for mercurial"); # TODO } diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index 67d4abbaa..55d8039e0 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -293,7 +293,7 @@ sub rcs_prepedit ($) { return get_rev(); } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. @@ -302,6 +302,7 @@ sub rcs_commit ($$$;$$) { my $rcstoken=shift; my $user=shift; my $ipaddr=shift; + my $emailuser=shift; my $author; if (defined $user) { @@ -438,10 +439,10 @@ sub rcs_commit ($$$;$$) { return undef # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; # Note - this will also commit any spurious changes that happen to be # lying around in the working copy. There shouldn't be any, but... diff --git a/IkiWiki/Plugin/norcs.pm b/IkiWiki/Plugin/norcs.pm index 053652a5f..5131a1502 100644 --- a/IkiWiki/Plugin/norcs.pm +++ b/IkiWiki/Plugin/norcs.pm @@ -38,13 +38,13 @@ sub rcs_prepedit ($) { return "" } -sub rcs_commit ($$$;$$) { - my ($file, $message, $rcstoken, $user, $ipaddr) = @_; +sub rcs_commit ($$$;$$$) { + my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; return undef # success } -sub rcs_commit_staged ($$$) { - my ($message, $user, $ipaddr)=@_; +sub rcs_commit_staged ($$$;$) { + my ($message, $user, $ipaddr, $emailuser)=@_; return undef # success } diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index d10b4888d..ffacb8cf9 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -144,7 +144,7 @@ sub rcs_prepedit ($) { } } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. @@ -153,6 +153,7 @@ sub rcs_commit ($$$;$$) { my $rcstoken=shift; my $user=shift; my $ipaddr=shift; + my $emailuser=shift; if (defined $user) { $message="web commit by $user".(length $message ? ": $message" : ""); @@ -189,10 +190,10 @@ sub rcs_commit ($$$;$$) { return undef # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; if (defined $user) { $message="web commit by $user".(length $message ? ": $message" : ""); diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index f5ad0cc96..80c015e3c 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -98,12 +98,13 @@ sub rcs_prepedit ($) { } } -sub rcs_commit ($$$;$$) { +sub rcs_commit ($$$;$$$) { my $file=shift; my $message=shift; my $rcstoken=shift; my $user=shift; my $ipaddr=shift; + my $emailuser=shift; if (defined $user) { $message="web commit by $user".(length $message ? ": $message" : ""); @@ -139,10 +140,10 @@ sub rcs_commit ($$$;$$) { return undef # success } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged ($$$;$) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr)=@_; + my ($message, $user, $ipaddr, $emailuser)=@_; error("rcs_commit_staged not implemented for tla"); # TODO } diff --git a/debian/changelog b/debian/changelog index 01d0abb47..2dfebd0b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low - * Add new optional field usershort to rcs_recentchanges. + * API: Add new optional field usershort to rcs_recentchanges. + * API: rcs_commit and rcs_commit_staged are passed a new parameter + that may contain the username component of the email address of + the user making the commit. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 5f0e95a9f..ab2934bf1 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1051,15 +1051,17 @@ token, that will be passed into `rcs_commit` when committing. For example, it might return the current revision ID of the file, and use that information later when merging changes. -#### `rcs_commit($$$;$$)` +#### `rcs_commit($$$;$$$)` -Passed a file, message, token (from `rcs_prepedit`), user, and ip address. +Passed a file, message, token (from `rcs_prepedit`), user, ip address, +and optionally the username component of the committer's email address. Should try to commit the file. Returns `undef` on *success* and a version of the page with the rcs's conflict markers on failure. -#### `rcs_commit_staged($$$)` +#### `rcs_commit_staged($$$;$)` -Passed a message, user, and ip address. Should commit all staged changes. +Passed a message, user, ip address, and optionally the username component of +the committer's email address. Should commit all staged changes. Returns undef on success, and an error message on failure. Changes can be staged by calls to `rcs_add`, `rcs_remove`, and -- cgit v1.2.3 From 4292802ee5f93f7ec7644c5d0a30f7ffeb95e566 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 16:32:20 -0400 Subject: stop using REMOTE_ADDR Everywhere that REMOTE_ADDR was used, a session object is available, so instead use its remote_addr method. In IkiWiki::Receive, stop setting a dummy REMOTE_ADDR. Note that it's possible for a session cookie to be obtained using one IP address, and then used from another IP. In this case, the first IP will now be used. I think that should be ok. --- IkiWiki/CGI.pm | 2 +- IkiWiki/Plugin/attachment.pm | 5 +++-- IkiWiki/Plugin/blogspam.pm | 3 ++- IkiWiki/Plugin/comments.pm | 10 ++++++---- IkiWiki/Plugin/editpage.pm | 3 ++- IkiWiki/Plugin/lockedit.pm | 2 +- IkiWiki/Plugin/moderatedcomments.pm | 4 ++-- IkiWiki/Plugin/passwordauth.pm | 2 +- IkiWiki/Plugin/poll.pm | 3 ++- IkiWiki/Plugin/remove.pm | 3 ++- IkiWiki/Plugin/rename.pm | 8 +++++--- IkiWiki/Receive.pm | 1 - 12 files changed, 27 insertions(+), 19 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 28020b500..f2a32a958 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -283,7 +283,7 @@ sub check_banned ($$) { foreach my $b (@{$config{banned_users}}) { if (pagespec_match("", $b, - ip => $ENV{REMOTE_ADDR}, + ip => $session->remote_addr(), name => defined $name ? $name : "", )) { $banned=1; diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index ce688ca40..216e00b3d 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -58,7 +58,7 @@ sub check_canattach ($$;$) { $config{allowed_attachments}, file => $file, user => $session->param("name"), - ip => $ENV{REMOTE_ADDR}, + ip => $session->remote_addr(), ); } @@ -185,7 +185,8 @@ sub formbuilder (@) { IkiWiki::disable_commit_hook(); IkiWiki::rcs_commit($filename, gettext("attachment upload"), IkiWiki::rcs_prepedit($filename), - $session->param("name"), $ENV{REMOTE_ADDR}); + $session->param("name"), + $session->remote_addr()); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index c4e5cf390..8db3780e8 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -58,6 +58,7 @@ sub checkconfig () { sub checkcontent (@) { my %params=@_; + my $session=$params{session}; if (exists $config{blogspam_pagespec}) { return undef @@ -88,7 +89,7 @@ sub checkcontent (@) { push @options, "exclude=stopwords"; my %req=( - ip => $ENV{REMOTE_ADDR}, + ip => $session->remote_addr(), comment => defined $params{diff} ? $params{diff} : $params{content}, subject => defined $params{subject} ? $params{subject} : "", name => defined $params{author} ? $params{author} : "", diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index d1558001a..4770209c9 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -402,8 +402,8 @@ sub editcomment ($$) { $username =~ s/"/"/g; $content .= " username=\"$username\"\n"; } - elsif (defined $ENV{REMOTE_ADDR}) { - my $ip = $ENV{REMOTE_ADDR}; + elsif (defined $session->remote_addr()) { + my $ip = $session->remote_addr(); if ($ip =~ m/^([.0-9]+)$/) { $content .= " ip=\"$1\"\n"; } @@ -514,7 +514,8 @@ sub editcomment ($$) { IkiWiki::rcs_add($file); IkiWiki::disable_commit_hook(); $conflict = IkiWiki::rcs_commit_staged($message, - $session->param('name'), $ENV{REMOTE_ADDR}); + $session->param('name'), + $session->remote_addr()); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } @@ -603,7 +604,8 @@ sub commentmoderation ($$) { my $message = gettext("Comment moderation"); IkiWiki::disable_commit_hook(); $conflict=IkiWiki::rcs_commit_staged($message, - $session->param('name'), $ENV{REMOTE_ADDR}); + $session->param('name'), + $session->remote_addr()); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 3ba6c519e..a8e75121f 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -403,7 +403,8 @@ sub cgi_editpage ($$) { disable_commit_hook(); $conflict=rcs_commit($file, $message, $form->field("rcsinfo"), - $session->param("name"), $ENV{REMOTE_ADDR}); + $session->param("name"), + $session->remote_addr()); enable_commit_hook(); rcs_update(); } diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index 1466e8337..5b50fd115 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -38,7 +38,7 @@ sub canedit ($$) { if (defined $config{locked_pages} && length $config{locked_pages} && pagespec_match($page, $config{locked_pages}, user => $session->param("name"), - ip => $ENV{REMOTE_ADDR}, + ip => $session->remote_addr(), )) { if ((! defined $user || ! IkiWiki::userinfo_get($session->param("name"), "regdate")) && diff --git a/IkiWiki/Plugin/moderatedcomments.pm b/IkiWiki/Plugin/moderatedcomments.pm index ff2c2b160..5957833fc 100644 --- a/IkiWiki/Plugin/moderatedcomments.pm +++ b/IkiWiki/Plugin/moderatedcomments.pm @@ -48,11 +48,11 @@ sub checkcontent (@) { } my $session=$params{session}; - my $user=$session->param("name") if $session; + my $user=$session->param("name"); if (pagespec_match($params{page}, $config{moderate_pagespec}, location => $params{page}, (defined $user ? (user => $user) : ()), - (defined $ENV{REMOTE_ADDR} ? (ip => $ENV{REMOTE_ADDR}) : ()), + (defined $session->remote_addr() ? (ip => $session->remote_addr()) : ()), )) { return gettext("comment needs moderation"); } diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index baddca093..35ebd961f 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -297,7 +297,7 @@ sub formbuilder (@) { ), wikiurl => $config{url}, wikiname => $config{wikiname}, - REMOTE_ADDR => $ENV{REMOTE_ADDR}, + remote_addr => $session->remote_addr(), ); eval q{use Mail::Sendmail}; diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index 6bc4579c2..e50efa5e0 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -136,7 +136,8 @@ sub sessioncgi ($$) { IkiWiki::disable_commit_hook(); IkiWiki::rcs_commit($pagesources{$page}, "poll vote ($choice)", IkiWiki::rcs_prepedit($pagesources{$page}), - $session->param("name"), $ENV{REMOTE_ADDR}); + $session->param("name"), + $session->remote_addr()); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index d23b2cc10..b664cbf74 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -214,7 +214,8 @@ sub sessioncgi ($$) { IkiWiki::rcs_remove($file); } IkiWiki::rcs_commit_staged(gettext("removed"), - $session->param("name"), $ENV{REMOTE_ADDR}); + $session->param("name"), + $session->remote_addr()); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 0da90a538..977c09e67 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -350,7 +350,9 @@ sub sessioncgi ($$) { } IkiWiki::rcs_commit_staged( sprintf(gettext("rename %s to %s"), $srcfile, $destfile), - $session->param("name"), $ENV{REMOTE_ADDR}) if $config{rcs}; + $session->param("name"), + $session->remote_addr(), + ) if $config{rcs}; # Then link fixups. foreach my $rename (@torename) { @@ -575,8 +577,8 @@ sub fixlinks ($$$) { $file, sprintf(gettext("update for rename of %s to %s"), $rename->{srcfile}, $rename->{destfile}), $token, - $session->param("name"), - $ENV{REMOTE_ADDR} + $session->param("name"), + $session->remote_addr(), ); push @fixedlinks, $page if ! defined $conflict; } diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index ae1bd8bef..fdd463025 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -57,7 +57,6 @@ sub test () { eval q{use CGI}; error($@) if $@; my $cgi=CGI->new; - $ENV{REMOTE_ADDR}='unknown' unless exists $ENV{REMOTE_ADDR}; # And dummy up a session object. require IkiWiki::CGI; -- cgit v1.2.3 From caf7bcdda38c1f2c31c70e36a95e4fa3f116f0d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 16:56:50 -0400 Subject: update for new rcs_commit_staged API In the process, lost the commits from special usernames when committing changed po files. Instead of trying to dummy up a session object for the special username, I just don't pass one, and the commit will appear to be from whatever user ikiwiki runs as. --- IkiWiki/Plugin/po.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 990847b48..86d5087f4 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -429,8 +429,7 @@ sub change (@) { if ($updated_po_files) { commit_and_refresh( - gettext("updated PO files"), - "IkiWiki::Plugin::po::change"); + gettext("updated PO files")); } } @@ -1035,17 +1034,18 @@ sub deletetranslations ($) { if (@todelete) { commit_and_refresh( - gettext("removed obsolete PO files"), - "IkiWiki::Plugin::po::deletetranslations"); + gettext("removed obsolete PO files")); } } -sub commit_and_refresh ($$) { - my ($msg, $author) = (shift, shift); +sub commit_and_refresh ($) { + my $msg = shift; if ($config{rcs}) { IkiWiki::disable_commit_hook(); - IkiWiki::rcs_commit_staged($msg, $author, "127.0.0.1"); + IkiWiki::rcs_commit_staged( + message => $msg, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } -- cgit v1.2.3 From ecdfd1b8644bc926db008054ab6192e18351afed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 17:35:21 -0400 Subject: rcs_commit and rcs_commit_staged api changes Using named parameters for these is overdue. Passing the session in a parameter instead of passing username and IP separately will later allow storing other session info, like username or part of the email. Note that these functions are not part of the exported API, and the prototype change will catch (most) skew, so I am not changing API versions. Any third-party plugins that call them will need updated though. --- IkiWiki.pm | 4 +- IkiWiki/Plugin/attachment.pm | 10 ++-- IkiWiki/Plugin/autoindex.pm | 4 +- IkiWiki/Plugin/bzr.pm | 43 +++++++++-------- IkiWiki/Plugin/comments.pm | 14 +++--- IkiWiki/Plugin/cvs.pm | 59 ++++++++++++----------- IkiWiki/Plugin/darcs.pm | 75 +++++++++++++++--------------- IkiWiki/Plugin/editpage.pm | 10 ++-- IkiWiki/Plugin/git.pm | 52 +++++++++++++-------- IkiWiki/Plugin/mercurial.pm | 32 ++++++------- IkiWiki/Plugin/monotone.pm | 85 +++++++++++++++------------------- IkiWiki/Plugin/norcs.pm | 6 +-- IkiWiki/Plugin/poll.pm | 10 ++-- IkiWiki/Plugin/remove.pm | 7 +-- IkiWiki/Plugin/rename.pm | 5 +- IkiWiki/Plugin/svn.pm | 59 ++++++++++++----------- IkiWiki/Plugin/tag.pm | 2 +- IkiWiki/Plugin/tla.pm | 34 ++++++++------ debian/changelog | 5 +- doc/plugins/write.mdwn | 16 ++++--- ikiwiki-calendar.in | 2 +- ikiwiki.spec | 2 +- po/ikiwiki.pot | 108 +++++++++++++++++++++---------------------- t/bazaar.t | 25 ++++++++-- t/cvs.t | 6 ++- t/git.t | 12 +++-- t/mercurial.t | 11 ++++- t/svn.t | 6 ++- 28 files changed, 380 insertions(+), 324 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 203da3ba2..35b38df46 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1840,11 +1840,11 @@ sub rcs_prepedit ($) { $hooks{rcs}{rcs_prepedit}{call}->(@_); } -sub rcs_commit ($$$;$$) { +sub rcs_commit (@) { $hooks{rcs}{rcs_commit}{call}->(@_); } -sub rcs_commit_staged ($$$) { +sub rcs_commit_staged (@) { $hooks{rcs}{rcs_commit_staged}{call}->(@_); } diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 216e00b3d..ee105a170 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -183,10 +183,12 @@ sub formbuilder (@) { if ($config{rcs}) { IkiWiki::rcs_add($filename); IkiWiki::disable_commit_hook(); - IkiWiki::rcs_commit($filename, gettext("attachment upload"), - IkiWiki::rcs_prepedit($filename), - $session->param("name"), - $session->remote_addr()); + IkiWiki::rcs_commit( + file => $filename, + message => gettext("attachment upload"), + token => IkiWiki::rcs_prepedit($filename), + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index c3eb53300..11595e217 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -117,8 +117,8 @@ sub refresh () { } if ($config{rcs}) { IkiWiki::rcs_commit_staged( - gettext("automatic index generation"), - undef, undef); + message => gettext("automatic index generation"), + ); IkiWiki::enable_commit_hook(); } } diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 44ab9a86a..562d5d389 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -123,8 +123,13 @@ sub rcs_prepedit ($) { return ""; } -sub bzr_author ($$) { - my ($user, $ipaddr) = @_; +sub bzr_author ($) { + my $session=shift; + + return unless defined $session; + + my $user=$session->param("name"); + my $ipaddr=$session->remote_addr(); if (defined $user) { return IkiWiki::possibly_foolish_untaint($user); @@ -137,18 +142,19 @@ sub bzr_author ($$) { } } -sub rcs_commit ($$$;$$$) { - my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; +sub rcs_commit (@) { + my %params=@_; - $user = bzr_author($user, $ipaddr); + my $user=bzr_author($params{session}); - $message = IkiWiki::possibly_foolish_untaint($message); - if (! length $message) { - $message = "no message given"; + $params{message} = IkiWiki::possibly_foolish_untaint($params{message}); + if (! length $params{message}) { + $params{message} = "no message given"; } - my @cmdline = ("bzr", "commit", "--quiet", "-m", $message, "--author", $user, - $config{srcdir}."/".$file); + my @cmdline = ("bzr", "commit", "--quiet", "-m", $params{message}, + (defined $user ? ("--author", $user) : ()), + $config{srcdir}."/".$params{file}); if (system(@cmdline) != 0) { warn "'@cmdline' failed: $!"; } @@ -156,19 +162,18 @@ sub rcs_commit ($$$;$$$) { return undef; # success } -sub rcs_commit_staged ($$$;$) { - # Commits all staged changes. Changes can be staged using rcs_add, - # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; +sub rcs_commit_staged (@) { + my %params=@_; - $user = bzr_author($user, $ipaddr); + my $user=bzr_author($params{session}); - $message = IkiWiki::possibly_foolish_untaint($message); - if (! length $message) { - $message = "no message given"; + $params{message} = IkiWiki::possibly_foolish_untaint($params{message}); + if (! length $params{message}) { + $params{message} = "no message given"; } - my @cmdline = ("bzr", "commit", "--quiet", "-m", $message, "--author", $user, + my @cmdline = ("bzr", "commit", "--quiet", "-m", $params{message}, + (defined $user ? ("--author", $user) : ()), $config{srcdir}); if (system(@cmdline) != 0) { warn "'@cmdline' failed: $!"; diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 4770209c9..41c6948e8 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -513,9 +513,10 @@ sub editcomment ($$) { IkiWiki::rcs_add($file); IkiWiki::disable_commit_hook(); - $conflict = IkiWiki::rcs_commit_staged($message, - $session->param('name'), - $session->remote_addr()); + $conflict = IkiWiki::rcs_commit_staged( + message => $message, + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } @@ -603,9 +604,10 @@ sub commentmoderation ($$) { if ($config{rcs} and $config{comments_commit}) { my $message = gettext("Comment moderation"); IkiWiki::disable_commit_hook(); - $conflict=IkiWiki::rcs_commit_staged($message, - $session->param('name'), - $session->remote_addr()); + $conflict=IkiWiki::rcs_commit_staged( + message => $message, + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index a9fe162a1..c6687d780 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -183,41 +183,47 @@ sub rcs_prepedit ($) { return defined $rev ? $rev : ""; } -sub rcs_commit ($$$;$$$) { +sub commitmessage (@) { + my %params=@_; + + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + return "web commit by ". + $params{session}->param("name"). + (length $params{message} ? ": $params{message}" : ""); + } + elsif (defined $params{session}->remote_addr()) { + return "web commit from ". + $params{session}->remote_addr(). + (length $params{message} ? ": $params{message}" : ""); + } + } + return $params{message}; +} + +sub rcs_commit (@) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. - my $file=shift; - my $message=shift; - my $rcstoken=shift; - my $user=shift; - my $ipaddr=shift; - my $emailuser=shift; + my %params=@_; return unless cvs_is_controlling; - if (defined $user) { - $message="web commit by $user".(length $message ? ": $message" : ""); - } - elsif (defined $ipaddr) { - $message="web commit from $ipaddr".(length $message ? ": $message" : ""); - } - # Check to see if the page has been changed by someone # else since rcs_prepedit was called. - my ($oldrev)=$rcstoken=~/^([0-9]+)$/; # untaint - my $rev=cvs_info("Repository revision", "$config{srcdir}/$file"); + my ($oldrev)=$params{token}=~/^([0-9]+)$/; # untaint + my $rev=cvs_info("Repository revision", "$config{srcdir}/$params{file}"); if (defined $rev && defined $oldrev && $rev != $oldrev) { # Merge their changes into the file that we've # changed. - cvs_runcvs('update', $file) || + cvs_runcvs('update', $params{file}) || warn("cvs merge from $oldrev to $rev failed\n"); } if (! cvs_runcvs('commit', '-m', - IkiWiki::possibly_foolish_untaint $message)) { - my $conflict=readfile("$config{srcdir}/$file"); - cvs_runcvs('update', '-C', $file) || + IkiWiki::possibly_foolish_untaint(commitmessage(%params)))) { + my $conflict=readfile("$config{srcdir}/$params{file}"); + cvs_runcvs('update', '-C', $params{file}) || warn("cvs revert failed\n"); return $conflict; } @@ -225,20 +231,13 @@ sub rcs_commit ($$$;$$$) { return undef # success } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; - - if (defined $user) { - $message="web commit by $user".(length $message ? ": $message" : ""); - } - elsif (defined $ipaddr) { - $message="web commit from $ipaddr".(length $message ? ": $message" : ""); - } + my %params=@_; if (! cvs_runcvs('commit', '-m', - IkiWiki::possibly_foolish_untaint $message)) { + IkiWiki::possibly_foolish_untaint(commitmessage(%params)))) { warn "cvs staged commit failed\n"; return 1; # failure } diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 345456c01..0dfc8708d 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -140,14 +140,31 @@ sub rcs_prepedit ($) { return $rev; } -sub rcs_commit ($$$;$$$) { +sub commitauthor (@) { + my %params=@_; + + my $author="anon\@web"; + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + return $params{session}->param("name").'@web'; + } + elsif (defined $params{session}->remote_addr()) { + return $params{session}->remote_addr().'@web'; + } + } + return 'anon@web'; +} + +sub rcs_commit (@) { # Commit the page. Returns 'undef' on success and a version of the page # with conflict markers on failure. + my %params=@_; - my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; + my ($file, $message, $token) = + ($params{file}, $params{message}, $params{token}); # Compute if the "revision" of $file changed. - my $changed = darcs_rev($file) ne $rcstoken; + my $changed = darcs_rev($file) ne $token; # Yes, the following is a bit convoluted. if ($changed) { @@ -155,7 +172,7 @@ sub rcs_commit ($$$;$$$) { rename("$config{srcdir}/$file", "$config{srcdir}/$file.save") or error("failed to rename $file to $file.save: $!"); - # Roll the repository back to $rcstoken. + # Roll the repository back to $token. # TODO. Can we be sure that no changes are lost? I think that # we can, if we make sure that the 'darcs push' below will always @@ -166,37 +183,28 @@ sub rcs_commit ($$$;$$$) { # TODO: 'yes | ...' needed? Doesn't seem so. silentsystem('darcs', "revert", "--repodir", $config{srcdir}, "--all") == 0 || error("'darcs revert' failed"); - # Remove all patches starting at $rcstoken. + # Remove all patches starting at $token. my $child = open(DARCS_OBLITERATE, "|-"); if (! $child) { open(STDOUT, ">/dev/null"); exec('darcs', "obliterate", "--repodir", $config{srcdir}, - "--match", "hash " . $rcstoken) and + "--match", "hash " . $token) and error("'darcs obliterate' failed"); } 1 while print DARCS_OBLITERATE "y"; close(DARCS_OBLITERATE); - # Restore the $rcstoken one. + # Restore the $token one. silentsystem('darcs', "pull", "--quiet", "--repodir", $config{srcdir}, - "--match", "hash " . $rcstoken, "--all") == 0 || + "--match", "hash " . $token, "--all") == 0 || error("'darcs pull' failed"); - # We're back at $rcstoken. Re-install the modified file. + # We're back at $token. Re-install the modified file. rename("$config{srcdir}/$file.save", "$config{srcdir}/$file") or error("failed to rename $file.save to $file: $!"); } # Record the changes. - my $author; - if (defined $user) { - $author = "$user\@web"; - } - elsif (defined $ipaddr) { - $author = "$ipaddr\@web"; - } - else { - $author = "anon\@web"; - } + my $author=commitauthor(%params); if (!defined $message || !length($message)) { $message = "empty message"; } @@ -211,13 +219,13 @@ sub rcs_commit ($$$;$$$) { # If this updating yields any conflicts, we'll record them now to resolve # them. If nothing is recorded, there are no conflicts. - $rcstoken = darcs_rev($file); + $token = darcs_rev($file); # TODO: Use only the first line here, i.e. only the patch name? writefile("$file.log", $config{srcdir}, 'resolve conflicts: ' . $message); silentsystem('darcs', 'record', '--repodir', $config{srcdir}, '--all', '-m', 'resolve conflicts: ' . $message, '--author', $author, $file) == 0 || error("'darcs record' failed"); - my $conflicts = darcs_rev($file) ne $rcstoken; + my $conflicts = darcs_rev($file) ne $token; unlink("$config{srcdir}/$file.log") or error("failed to remove '$file.log'"); @@ -239,25 +247,18 @@ sub rcs_commit ($$$;$$$) { } } -sub rcs_commit_staged ($$$;$) { - my ($message, $user, $ipaddr, $emailuser) = @_; +sub rcs_commit_staged (@) { + my %params=@_; - my $author; - if (defined $user) { - $author = "$user\@web"; - } - elsif (defined $ipaddr) { - $author = "$ipaddr\@web"; - } - else { - $author = "anon\@web"; - } - if (!defined $message || !length($message)) { - $message = "empty message"; + my $author=commitauthor(%params); + if (!defined $params{message} || !length($params{message})) { + $params{message} = "empty message"; } - silentsystem('darcs', "record", "--repodir", $config{srcdir}, "-a", "-A", $author, - "-m", $message) == 0 || error("'darcs record' failed"); + silentsystem('darcs', "record", "--repodir", $config{srcdir}, + "-a", "-A", $author, + "-m", $params{message}, + ) == 0 || error("'darcs record' failed"); # Push the changes to the main repository. silentsystem('darcs', 'push', '--quiet', '--repodir', $config{srcdir}, '--all') == 0 || diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index a8e75121f..1a04a72b5 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -401,10 +401,12 @@ sub cgi_editpage ($$) { # signaling to it that it should not try to # do anything. disable_commit_hook(); - $conflict=rcs_commit($file, $message, - $form->field("rcsinfo"), - $session->param("name"), - $session->remote_addr()); + $conflict=rcs_commit( + file => $file, + message => $message, + token => $form->field("rcsinfo"), + session => $session, + ); enable_commit_hook(); rcs_update(); } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index b56f229d7..b02fc118d 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -464,43 +464,55 @@ sub rcs_prepedit ($) { return git_sha1($file); } -sub rcs_commit ($$$;$$$) { +sub rcs_commit (@) { # Try to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on # failure. - - my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; + my %params=@_; # Check to see if the page has been changed by someone else since # rcs_prepedit was called. - my $cur = git_sha1($file); - my ($prev) = $rcstoken =~ /^($sha1_pattern)$/; # untaint + my $cur = git_sha1($params{file}); + my ($prev) = $params{token} =~ /^($sha1_pattern)$/; # untaint if (defined $cur && defined $prev && $cur ne $prev) { - my $conflict = merge_past($prev, $file, $dummy_commit_msg); + my $conflict = merge_past($prev, $params{file}, $dummy_commit_msg); return $conflict if defined $conflict; } - rcs_add($file); - return rcs_commit_staged($message, $user, $ipaddr); + rcs_add($params{file}); + return rcs_commit_staged( + message => $params{message}, + session => $params{session}, + ); } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; - - # Set the commit author and email to the web committer. + my %params=@_; + my %env=%ENV; - if (defined $user || defined $ipaddr) { - my $u=encode_utf8(defined $user ? $user : $ipaddr); - $ENV{GIT_AUTHOR_NAME}=$u; - $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; + + if (defined $params{session}) { + # Set the commit author and email based on web session info. + my $u; + if (defined $params{session}->param("name")) { + $u=$params{session}->param("name"); + } + elsif (defined $params{session}->remote_addr()) { + $u=$params{session}->remote_addr(); + } + if (defined $u) { + $u=encode_utf8($u); + $ENV{GIT_AUTHOR_NAME}=$u; + $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; + } } - $message = IkiWiki::possibly_foolish_untaint($message); + $params{message} = IkiWiki::possibly_foolish_untaint($params{message}); my @opts; - if ($message !~ /\S/) { + if ($params{message} !~ /\S/) { # Force git to allow empty commit messages. # (If this version of git supports it.) my ($version)=`git --version` =~ /git version (.*)/; @@ -508,13 +520,13 @@ sub rcs_commit_staged ($$$;$) { push @opts, '--cleanup=verbatim'; } else { - $message.="."; + $params{message}.="."; } } push @opts, '-q'; # git commit returns non-zero if file has not been really changed. # so we should ignore its exit status (hence run_or_non). - if (run_or_non('git', 'commit', @opts, '-m', $message)) { + if (run_or_non('git', 'commit', @opts, '-m', $params{message})) { if (length $config{gitorigin_branch}) { run_or_cry('git', 'push', $config{gitorigin_branch}); } diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index 1793ab4bb..edf915ae9 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -126,26 +126,26 @@ sub rcs_prepedit ($) { return ""; } -sub rcs_commit ($$$;$$$) { - my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; +sub rcs_commit (@) { + my %params=@_; - if (defined $user) { - $user = IkiWiki::possibly_foolish_untaint($user); - } - elsif (defined $ipaddr) { - $user = "Anonymous from ".IkiWiki::possibly_foolish_untaint($ipaddr); - } - else { - $user = "Anonymous"; + my $user="Anonymous"; + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + $user = $params{session}->param("name"); + } + elsif (defined $params{session}->remote_addr()) { + $user = "Anonymous from ".$params{session}->remote_addr(); + } } - $message = IkiWiki::possibly_foolish_untaint($message); - if (! length $message) { - $message = "no message given"; + if (! length $params{message}) { + $params{message} = "no message given"; } my @cmdline = ("hg", "-q", "-R", $config{srcdir}, "commit", - "-m", $message, "-u", $user); + "-m", IkiWiki::possibly_foolish_untaint($params{message}), + "-u", IkiWiki::possibly_foolish_untaint($user)); if (system(@cmdline) != 0) { warn "'@cmdline' failed: $!"; } @@ -153,10 +153,10 @@ sub rcs_commit ($$$;$$$) { return undef; # success } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; + my %params=@_; error("rcs_commit_staged not implemented for mercurial"); # TODO } diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index 55d8039e0..95fbcee76 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -293,32 +293,33 @@ sub rcs_prepedit ($) { return get_rev(); } -sub rcs_commit ($$$;$$$) { +sub commitauthor (@) { + my %params=@_; + + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + return "Web user: " . $params{session}->param("name"); + } + elsif (defined $params{session}->remote_addr()) { + return "Web IP: " . $params{session}->remote_addr(); + } + } + return "Web: Anonymous"; +} + + +sub rcs_commit (@) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. - my $file=shift; - my $message=shift; - my $rcstoken=shift; - my $user=shift; - my $ipaddr=shift; - my $emailuser=shift; - my $author; + my %params=@_; - if (defined $user) { - $author="Web user: " . $user; - } - elsif (defined $ipaddr) { - $author="Web IP: " . $ipaddr; - } - else { - $author="Web: Anonymous"; - } + my $author=IkiWiki::possibly_foolish_untaint(commitauthor(%params)), chdir $config{srcdir} or error("Cannot chdir to $config{srcdir}: $!"); - my ($oldrev)= $rcstoken=~ m/^($sha1_pattern)$/; # untaint + my ($oldrev) = $params{token} =~ m/^($sha1_pattern)$/; # untaint my $rev = get_rev(); if (defined $rev && defined $oldrev && $rev ne $oldrev) { my $automator = Monotone->new(); @@ -327,8 +328,8 @@ sub rcs_commit ($$$;$$$) { # Something has been committed, has this file changed? my ($out, $err); $automator->setOpts("r", $oldrev, "r", $rev); - ($out, $err) = $automator->call("content_diff", $file); - debug("Problem committing $file") if ($err ne ""); + ($out, $err) = $automator->call("content_diff", $params{file}); + debug("Problem committing $params{file}") if ($err ne ""); my $diff = $out; if ($diff) { @@ -337,11 +338,11 @@ sub rcs_commit ($$$;$$$) { # # first get the contents debug("File changed: forming branch"); - my $newfile=readfile("$config{srcdir}/$file"); + my $newfile=readfile("$config{srcdir}/$params{file}"); # then get the old content ID from the diff - if ($diff !~ m/^---\s$file\s+($sha1_pattern)$/m) { - error("Unable to find previous file ID for $file"); + if ($diff !~ m/^---\s$params{file}\s+($sha1_pattern)$/m) { + error("Unable to find previous file ID for $params{file}"); } my $oldFileID = $1; @@ -352,13 +353,13 @@ sub rcs_commit ($$$;$$$) { my $branch = $1; # then put the new content into the DB (and record the new content ID) - my $newRevID = commit_file_to_new_rev($automator, $file, $oldFileID, $newfile, $oldrev, $branch, $author, $message); + my $newRevID = commit_file_to_new_rev($automator, $params{file}, $oldFileID, $newfile, $oldrev, $branch, $author, $params{message}); $automator->close(); # if we made it to here then the file has been committed... revert the local copy - if (system("mtn", "--root=$config{mtnrootdir}", "revert", $file) != 0) { - debug("Unable to revert $file after merge on conflicted commit!"); + if (system("mtn", "--root=$config{mtnrootdir}", "revert", $params{file}) != 0) { + debug("Unable to revert $params{file} after merge on conflicted commit!"); } debug("Divergence created! Attempting auto-merge."); @@ -407,7 +408,7 @@ sub rcs_commit ($$$;$$$) { # for cleanup note, this relies on the fact # that ikiwiki seems to call rcs_prepedit() # again after we return - return readfile("$config{srcdir}/$file"); + return readfile("$config{srcdir}/$params{file}"); } return undef; } @@ -419,11 +420,12 @@ sub rcs_commit ($$$;$$$) { if (system("mtn", "--root=$config{mtnrootdir}", "commit", "--quiet", "--author", $author, "--key", $config{mtnkey}, "-m", - IkiWiki::possibly_foolish_untaint($message), $file) != 0) { + IkiWiki::possibly_foolish_untaint($params{message}), + $params{file}) != 0) { debug("Traditional commit failed! Returning data as conflict."); - my $conflict=readfile("$config{srcdir}/$file"); + my $conflict=readfile("$config{srcdir}/$params{file}"); if (system("mtn", "--root=$config{mtnrootdir}", "revert", - "--quiet", $file) != 0) { + "--quiet", $params{file}) != 0) { debug("monotone revert failed"); } return $conflict; @@ -439,32 +441,21 @@ sub rcs_commit ($$$;$$$) { return undef # success } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; - + my %params=@_; + # Note - this will also commit any spurious changes that happen to be # lying around in the working copy. There shouldn't be any, but... chdir $config{srcdir} or error("Cannot chdir to $config{srcdir}: $!"); - my $author; - - if (defined $user) { - $author="Web user: " . $user; - } - elsif (defined $ipaddr) { - $author="Web IP: " . $ipaddr; - } - else { - $author="Web: Anonymous"; - } - if (system("mtn", "--root=$config{mtnrootdir}", "commit", "--quiet", - "--author", $author, "--key", $config{mtnkey}, "-m", - IkiWiki::possibly_foolish_untaint($message)) != 0) { + "--author", IkiWiki::possibly_foolish_untaint(commitauthor(%params)), + "--key", $config{mtnkey}, "-m", + IkiWiki::possibly_foolish_untaint($params{message})) != 0) { error("Monotone commit failed"); } } diff --git a/IkiWiki/Plugin/norcs.pm b/IkiWiki/Plugin/norcs.pm index 5131a1502..a3bb6240e 100644 --- a/IkiWiki/Plugin/norcs.pm +++ b/IkiWiki/Plugin/norcs.pm @@ -38,13 +38,11 @@ sub rcs_prepedit ($) { return "" } -sub rcs_commit ($$$;$$$) { - my ($file, $message, $rcstoken, $user, $ipaddr, $emailuser) = @_; +sub rcs_commit (@) { return undef # success } -sub rcs_commit_staged ($$$;$) { - my ($message, $user, $ipaddr, $emailuser)=@_; +sub rcs_commit_staged (@) { return undef # success } diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index e50efa5e0..b333e2cdc 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -134,10 +134,12 @@ sub sessioncgi ($$) { $oldchoice=$session->param($choice_param); if ($config{rcs}) { IkiWiki::disable_commit_hook(); - IkiWiki::rcs_commit($pagesources{$page}, "poll vote ($choice)", - IkiWiki::rcs_prepedit($pagesources{$page}), - $session->param("name"), - $session->remote_addr()); + IkiWiki::rcs_commit( + file => $pagesources{$page}, + message => "poll vote ($choice)", + token => IkiWiki::rcs_prepedit($pagesources{$page}), + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index b664cbf74..95f148183 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -213,9 +213,10 @@ sub sessioncgi ($$) { foreach my $file (@files) { IkiWiki::rcs_remove($file); } - IkiWiki::rcs_commit_staged(gettext("removed"), - $session->param("name"), - $session->remote_addr()); + IkiWiki::rcs_commit_staged( + message => gettext("removed"), + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 977c09e67..61d39d4b5 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -349,9 +349,8 @@ sub sessioncgi ($$) { $pagesources{$rename->{src}}=$rename->{destfile}; } IkiWiki::rcs_commit_staged( - sprintf(gettext("rename %s to %s"), $srcfile, $destfile), - $session->param("name"), - $session->remote_addr(), + message => sprintf(gettext("rename %s to %s"), $srcfile, $destfile), + session => $session, ) if $config{rcs}; # Then link fixups. diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index ffacb8cf9..f1e608408 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -144,44 +144,50 @@ sub rcs_prepedit ($) { } } -sub rcs_commit ($$$;$$$) { +sub commitmessage (@) { + my %params=@_; + + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + return "web commit by ". + $params{session}->param("name"). + (length $params{message} ? ": $params{message}" : ""); + } + elsif (defined $params{session}->remote_addr()) { + return "web commit from ". + $params{session}->remote_addr(). + (length $params{message} ? ": $params{message}" : ""); + } + } + return $params{message}; +} + +sub rcs_commit (@) { # Tries to commit the page; returns undef on _success_ and # a version of the page with the rcs's conflict markers on failure. # The file is relative to the srcdir. - my $file=shift; - my $message=shift; - my $rcstoken=shift; - my $user=shift; - my $ipaddr=shift; - my $emailuser=shift; - - if (defined $user) { - $message="web commit by $user".(length $message ? ": $message" : ""); - } - elsif (defined $ipaddr) { - $message="web commit from $ipaddr".(length $message ? ": $message" : ""); - } + my %params=@_; if (-d "$config{srcdir}/.svn") { # Check to see if the page has been changed by someone # else since rcs_prepedit was called. - my ($oldrev)=$rcstoken=~/^([0-9]+)$/; # untaint - my $rev=svn_info("Revision", "$config{srcdir}/$file"); + my ($oldrev)=$params{token}=~/^([0-9]+)$/; # untaint + my $rev=svn_info("Revision", "$config{srcdir}/$params{file}"); if (defined $rev && defined $oldrev && $rev != $oldrev) { # Merge their changes into the file that we've # changed. if (system("svn", "merge", "--quiet", "-r$oldrev:$rev", - "$config{srcdir}/$file", "$config{srcdir}/$file") != 0) { + "$config{srcdir}/$params{file}", "$config{srcdir}/$params{file}") != 0) { warn("svn merge -r$oldrev:$rev failed\n"); } } if (system("svn", "commit", "--quiet", "--encoding", "UTF-8", "-m", - IkiWiki::possibly_foolish_untaint($message), + IkiWiki::possibly_foolish_untaint(commitmessage(%params)), $config{srcdir}) != 0) { - my $conflict=readfile("$config{srcdir}/$file"); - if (system("svn", "revert", "--quiet", "$config{srcdir}/$file") != 0) { + my $conflict=readfile("$config{srcdir}/$params{file}"); + if (system("svn", "revert", "--quiet", "$config{srcdir}/$params{file}") != 0) { warn("svn revert failed\n"); } return $conflict; @@ -190,21 +196,14 @@ sub rcs_commit ($$$;$$$) { return undef # success } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; - - if (defined $user) { - $message="web commit by $user".(length $message ? ": $message" : ""); - } - elsif (defined $ipaddr) { - $message="web commit from $ipaddr".(length $message ? ": $message" : ""); - } + my %params=@_; if (system("svn", "commit", "--quiet", "--encoding", "UTF-8", "-m", - IkiWiki::possibly_foolish_untaint($message), + IkiWiki::possibly_foolish_untaint(commitmessage(%params)), $config{srcdir}) != 0) { warn("svn commit failed\n"); return 1; # failure diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 62f030f4e..55064a9a3 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -90,7 +90,7 @@ sub gentag ($) { if ($config{rcs}) { IkiWiki::disable_commit_hook(); IkiWiki::rcs_add($tagfile); - IkiWiki::rcs_commit_staged($message, undef, undef); + IkiWiki::rcs_commit_staged(message => $message); IkiWiki::enable_commit_hook(); } }); diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index 80c015e3c..da4385446 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -98,19 +98,23 @@ sub rcs_prepedit ($) { } } -sub rcs_commit ($$$;$$$) { - my $file=shift; - my $message=shift; - my $rcstoken=shift; - my $user=shift; - my $ipaddr=shift; - my $emailuser=shift; - - if (defined $user) { - $message="web commit by $user".(length $message ? ": $message" : ""); - } - elsif (defined $ipaddr) { - $message="web commit from $ipaddr".(length $message ? ": $message" : ""); +sub rcs_commit (@) { + my %params=@_; + + my ($file, $message, $rcstoken)= + ($params{file}, $params{message}, $params{token}); + + if (defined $params{session}) { + if (defined $params{session}->param("name")) { + $message="web commit by ". + $params{session}->param("name"). + (length $message ? ": $message" : ""); + } + elsif (defined $params{session}->remote_addr()) { + $message="web commit from ". + $params{session}->remote_addr(). + (length $message ? ": $message" : ""); + } } if (-d "$config{srcdir}/{arch}") { @@ -140,10 +144,10 @@ sub rcs_commit ($$$;$$$) { return undef # success } -sub rcs_commit_staged ($$$;$) { +sub rcs_commit_staged (@) { # Commits all staged changes. Changes can be staged using rcs_add, # rcs_remove, and rcs_rename. - my ($message, $user, $ipaddr, $emailuser)=@_; + my %params=@_; error("rcs_commit_staged not implemented for tla"); # TODO } diff --git a/debian/changelog b/debian/changelog index 2dfebd0b2..f7452a070 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * API: Add new optional field usershort to rcs_recentchanges. - * API: rcs_commit and rcs_commit_staged are passed a new parameter - that may contain the username component of the email address of - the user making the commit. + * API: rcs_commit and rcs_commit_staged are now passed named + parameters. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index ab2934bf1..a2b954bd4 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1051,18 +1051,20 @@ token, that will be passed into `rcs_commit` when committing. For example, it might return the current revision ID of the file, and use that information later when merging changes. -#### `rcs_commit($$$;$$$)` +#### `rcs_commit(@)` + +Passed named parameters: `file`, `message`, `token` (from `rcs_prepedit`), +and `session` (optional). -Passed a file, message, token (from `rcs_prepedit`), user, ip address, -and optionally the username component of the committer's email address. Should try to commit the file. Returns `undef` on *success* and a version of the page with the rcs's conflict markers on failure. -#### `rcs_commit_staged($$$;$)` +#### `rcs_commit_staged(@)` + +Passed named parameters: `message`, and `session` (optional). -Passed a message, user, ip address, and optionally the username component of -the committer's email address. Should commit all staged changes. -Returns undef on success, and an error message on failure. +Should commit all staged changes. Returns undef on success, and an +error message on failure. Changes can be staged by calls to `rcs_add`, `rcs_remove`, and `rcs_rename`. diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in index 04352b970..60df99855 100755 --- a/ikiwiki-calendar.in +++ b/ikiwiki-calendar.in @@ -59,7 +59,7 @@ foreach my $y ($startyear..$endyear) { } } -IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef) +IkiWiki::rcs_commit_staged(message => gettext("calendar update")) if $config{rcs}; exec("ikiwiki", "-setup", $setup, "-refresh"); diff --git a/ikiwiki.spec b/ikiwiki.spec index 9a4bbf6bc..9644fd396 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20100623 +Version: 3.20100624 Release: 1%{?dist} Summary: A wiki compiler diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 437cdbdcc..e50fa0f68 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-06-10 15:02-0400\n" +"POT-Creation-Date: 2010-06-23 17:10-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1316 +#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1317 msgid "Error" msgstr "" @@ -163,19 +163,19 @@ msgstr "" msgid "prohibited by allowed_attachments" msgstr "" -#: ../IkiWiki/Plugin/attachment.pm:141 +#: ../IkiWiki/Plugin/attachment.pm:144 msgid "bad attachment filename" msgstr "" -#: ../IkiWiki/Plugin/attachment.pm:183 +#: ../IkiWiki/Plugin/attachment.pm:188 msgid "attachment upload" msgstr "" -#: ../IkiWiki/Plugin/autoindex.pm:117 +#: ../IkiWiki/Plugin/autoindex.pm:120 msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:109 +#: ../IkiWiki/Plugin/blogspam.pm:110 msgid "" "Sorry, but that looks like spam to blogspam: " @@ -248,19 +248,19 @@ msgstr "" msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:552 ../IkiWiki/Plugin/websetup.pm:272 +#: ../IkiWiki/Plugin/comments.pm:554 ../IkiWiki/Plugin/websetup.pm:268 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:603 +#: ../IkiWiki/Plugin/comments.pm:605 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:641 +#: ../IkiWiki/Plugin/comments.pm:645 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:790 +#: ../IkiWiki/Plugin/comments.pm:802 #, 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:800 +#: ../IkiWiki/Plugin/comments.pm:812 msgid "Comment" msgstr "" @@ -305,9 +305,9 @@ msgstr "" msgid "creating %s" msgstr "" -#: ../IkiWiki/Plugin/editpage.pm:312 ../IkiWiki/Plugin/editpage.pm:334 -#: ../IkiWiki/Plugin/editpage.pm:345 ../IkiWiki/Plugin/editpage.pm:390 -#: ../IkiWiki/Plugin/editpage.pm:429 +#: ../IkiWiki/Plugin/editpage.pm:312 ../IkiWiki/Plugin/editpage.pm:332 +#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:388 +#: ../IkiWiki/Plugin/editpage.pm:430 #, perl-format msgid "editing %s" msgstr "" @@ -320,12 +320,12 @@ msgstr "" msgid "match not specified" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:64 +#: ../IkiWiki/Plugin/edittemplate.pm:70 #, perl-format msgid "edittemplate %s registered for %s" msgstr "" -#: ../IkiWiki/Plugin/edittemplate.pm:125 ../IkiWiki/Plugin/inline.pm:339 +#: ../IkiWiki/Plugin/edittemplate.pm:131 ../IkiWiki/Plugin/inline.pm:339 #: ../IkiWiki/Plugin/template.pm:44 msgid "failed to process template:" msgstr "" @@ -356,18 +356,18 @@ msgstr "" msgid "%s is an attachment, not a page." msgstr "" -#: ../IkiWiki/Plugin/git.pm:687 ../IkiWiki/Plugin/git.pm:705 -#: ../IkiWiki/Receive.pm:130 +#: ../IkiWiki/Plugin/git.pm:724 ../IkiWiki/Plugin/git.pm:742 +#: ../IkiWiki/Receive.pm:129 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:727 +#: ../IkiWiki/Plugin/git.pm:764 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:731 +#: ../IkiWiki/Plugin/git.pm:768 msgid "you are not allowed to change file modes" msgstr "" @@ -513,7 +513,7 @@ msgstr "" msgid "more" msgstr "" -#: ../IkiWiki/Plugin/openid.pm:58 +#: ../IkiWiki/Plugin/openid.pm:70 #, perl-format msgid "failed to load openid module: " msgstr "" @@ -610,7 +610,7 @@ msgstr "" msgid "rebuilding all pages to fix meta titles" msgstr "" -#: ../IkiWiki/Plugin/po.pm:394 ../IkiWiki/Render.pm:769 +#: ../IkiWiki/Plugin/po.pm:394 ../IkiWiki/Render.pm:784 #, perl-format msgid "building %s" msgstr "" @@ -619,48 +619,48 @@ msgstr "" msgid "updated PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:456 +#: ../IkiWiki/Plugin/po.pm:455 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:476 +#: ../IkiWiki/Plugin/po.pm:475 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:876 +#: ../IkiWiki/Plugin/po.pm:875 #, perl-format msgid "POT file (%s) does not exist" msgstr "" -#: ../IkiWiki/Plugin/po.pm:890 +#: ../IkiWiki/Plugin/po.pm:889 #, perl-format msgid "failed to copy underlay PO file to %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:899 +#: ../IkiWiki/Plugin/po.pm:898 #, perl-format msgid "failed to update %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:905 +#: ../IkiWiki/Plugin/po.pm:904 #, perl-format msgid "failed to copy the POT file to %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:941 +#: ../IkiWiki/Plugin/po.pm:940 msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:954 +#: ../IkiWiki/Plugin/po.pm:953 #, perl-format msgid "failed to translate %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1038 +#: ../IkiWiki/Plugin/po.pm:1037 msgid "removed obsolete PO files" msgstr "" @@ -803,7 +803,7 @@ msgstr "" msgid "Please select the attachments to remove." msgstr "" -#: ../IkiWiki/Plugin/remove.pm:216 +#: ../IkiWiki/Plugin/remove.pm:217 msgid "removed" msgstr "" @@ -853,7 +853,7 @@ msgstr "" msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:576 +#: ../IkiWiki/Plugin/rename.pm:577 #, perl-format msgid "update for rename of %s to %s" msgstr "" @@ -988,26 +988,26 @@ msgstr "" msgid "enable %s?" msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:276 +#: ../IkiWiki/Plugin/websetup.pm:272 msgid "setup file for this wiki is not known" msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:292 +#: ../IkiWiki/Plugin/websetup.pm:288 msgid "main" msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:435 +#: ../IkiWiki/Plugin/websetup.pm:431 msgid "" "The configuration changes shown below require a wiki rebuild to take effect." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:439 +#: ../IkiWiki/Plugin/websetup.pm:435 msgid "" "For the configuration changes shown below to fully take effect, you may need " "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:476 +#: ../IkiWiki/Plugin/websetup.pm:472 #, perl-format msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" @@ -1017,7 +1017,7 @@ msgstr "" msgid "cannot determine id of untrusted committer %s" msgstr "" -#: ../IkiWiki/Receive.pm:86 +#: ../IkiWiki/Receive.pm:85 #, perl-format msgid "bad file name %s" msgstr "" @@ -1034,47 +1034,47 @@ msgid "" "allow this" msgstr "" -#: ../IkiWiki/Render.pm:311 +#: ../IkiWiki/Render.pm:316 #, perl-format msgid "skipping bad filename %s" msgstr "" -#: ../IkiWiki/Render.pm:327 +#: ../IkiWiki/Render.pm:332 #, perl-format msgid "%s has multiple possible source pages" msgstr "" -#: ../IkiWiki/Render.pm:369 +#: ../IkiWiki/Render.pm:372 #, perl-format msgid "querying %s for file creation and modification times.." msgstr "" -#: ../IkiWiki/Render.pm:431 +#: ../IkiWiki/Render.pm:446 #, perl-format msgid "removing obsolete %s" msgstr "" -#: ../IkiWiki/Render.pm:505 +#: ../IkiWiki/Render.pm:520 #, perl-format msgid "building %s, which links to %s" msgstr "" -#: ../IkiWiki/Render.pm:514 +#: ../IkiWiki/Render.pm:529 #, perl-format msgid "removing %s, no longer built by %s" msgstr "" -#: ../IkiWiki/Render.pm:597 ../IkiWiki/Render.pm:679 +#: ../IkiWiki/Render.pm:612 ../IkiWiki/Render.pm:694 #, perl-format msgid "building %s, which depends on %s" msgstr "" -#: ../IkiWiki/Render.pm:692 +#: ../IkiWiki/Render.pm:707 #, perl-format msgid "building %s, to update its backlinks" msgstr "" -#: ../IkiWiki/Render.pm:821 +#: ../IkiWiki/Render.pm:836 #, perl-format msgid "ikiwiki: cannot build %s" msgstr "" @@ -1179,31 +1179,31 @@ msgstr "" msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:606 +#: ../IkiWiki.pm:607 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1298 +#: ../IkiWiki.pm:1299 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1993 +#: ../IkiWiki.pm:1994 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2070 +#: ../IkiWiki.pm:2071 #, perl-format msgid "invalid sort type %s" msgstr "" -#: ../IkiWiki.pm:2091 +#: ../IkiWiki.pm:2092 #, perl-format msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki.pm:2227 +#: ../IkiWiki.pm:2228 #, perl-format msgid "cannot match pages: %s" msgstr "" diff --git a/t/bazaar.t b/t/bazaar.t index 0bdd883d5..3e54ec4dc 100755 --- a/t/bazaar.t +++ b/t/bazaar.t @@ -24,11 +24,19 @@ IkiWiki::checkconfig(); system "bzr init $config{srcdir}"; +use CGI::Session; +my $session=CGI::Session->new; +$session->param("name", "Joe User"); + # Web commit my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo", "Joe User"); +IkiWiki::rcs_commit( + file => "test1.mdwn", + message => "Added the first page", + token => "moo", + session => $session); my @changes; @changes = IkiWiki::rcs_recentchanges(3); @@ -66,7 +74,10 @@ ok($mtime >= time() - 20); writefile('test3.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test3.mdwn"); IkiWiki::rcs_rename("test3.mdwn", "test4.mdwn"); -IkiWiki::rcs_commit_staged("Added the 4th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged( + message => "Added the 4th page", + session => $session, +); @changes = IkiWiki::rcs_recentchanges(4); @@ -75,7 +86,10 @@ is($changes[0]{pages}[0]{"page"}, "test4"); ok(mkdir($config{srcdir}."/newdir")); IkiWiki::rcs_rename("test4.mdwn", "newdir/test5.mdwn"); -IkiWiki::rcs_commit_staged("Added the 5th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged( + message => "Added the 5th page", + session => $session, +); @changes = IkiWiki::rcs_recentchanges(4); @@ -83,6 +97,9 @@ is($#changes, 3); is($changes[0]{pages}[0]{"page"}, "newdir/test5"); IkiWiki::rcs_remove("newdir/test5.mdwn"); -IkiWiki::rcs_commit_staged("Remove the 5th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged( + message => "Remove the 5th page", + session => $session, +); system "rm -rf $dir"; diff --git a/t/cvs.t b/t/cvs.t index 2808973be..96359ab6e 100755 --- a/t/cvs.t +++ b/t/cvs.t @@ -46,7 +46,11 @@ system "cvs -d $cvsrepo co -d $config{srcdir} ikiwiki >/dev/null"; my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo"); +IkiWiki::rcs_commit( + files => "test1.mdwn", + message => "Added the first page", + token => "moo" +); my @changes; @changes = IkiWiki::rcs_recentchanges(3); diff --git a/t/git.t b/t/git.t index f1c24b359..ee778ebf0 100755 --- a/t/git.t +++ b/t/git.t @@ -38,7 +38,11 @@ is($changes[0]{pages}[0]{"page"}, ".gitignore"); my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo"); +IkiWiki::rcs_commit( + file => "test1.mdwn", + message => "Added the first page", + token => "moo", +); @changes = IkiWiki::rcs_recentchanges(3); @@ -68,7 +72,7 @@ is($changes[1]{pages}[0]{"page"}, "test1"); writefile('test3.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test3.mdwn"); IkiWiki::rcs_rename("test3.mdwn", "test4.mdwn"); -IkiWiki::rcs_commit_staged("Added the 4th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged(message => "Added the 4th page"); @changes = IkiWiki::rcs_recentchanges(4); @@ -77,7 +81,7 @@ is($changes[0]{pages}[0]{"page"}, "test4"); ok(mkdir($config{srcdir}."/newdir")); IkiWiki::rcs_rename("test4.mdwn", "newdir/test5.mdwn"); -IkiWiki::rcs_commit_staged("Added the 5th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged(message => "Added the 5th page"); @changes = IkiWiki::rcs_recentchanges(4); @@ -85,6 +89,6 @@ is($#changes, 3); is($changes[0]{pages}[0]{"page"}, "newdir/test5"); IkiWiki::rcs_remove("newdir/test5.mdwn"); -IkiWiki::rcs_commit_staged("Remove the 5th page", "moo", "Joe User"); +IkiWiki::rcs_commit_staged(message => "Remove the 5th page"); system "rm -rf $dir"; diff --git a/t/mercurial.t b/t/mercurial.t index 954b17526..b64ea8e56 100755 --- a/t/mercurial.t +++ b/t/mercurial.t @@ -22,13 +22,22 @@ $config{srcdir} = "$dir/repo"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); +use CGI::Session; +my $session=CGI::Session->new; +$session->param("name", "Joe User"); + system "hg init $config{srcdir}"; # Web commit my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo", "Joe User"); +IkiWiki::rcs_commit( + file => "test1.mdwn", + message => "Added the first page", + token => "moo", + session => $session, +); my @changes; @changes = IkiWiki::rcs_recentchanges(3); diff --git a/t/svn.t b/t/svn.t index 5223b4409..82b71b5fc 100755 --- a/t/svn.t +++ b/t/svn.t @@ -36,7 +36,11 @@ system "svn co file://$svnrepo/trunk $config{srcdir} >/dev/null"; my $test1 = readfile("t/test1.mdwn"); writefile('test1.mdwn', $config{srcdir}, $test1); IkiWiki::rcs_add("test1.mdwn"); -IkiWiki::rcs_commit("test1.mdwn", "Added the first page", "moo"); +IkiWiki::rcs_commit( + file => "test1.mdwn", + message => "Added the first page", + token => "moo", +); my @changes; @changes = IkiWiki::rcs_recentchanges(3); -- cgit v1.2.3 From d8e4b51a41a9507584d56946d0eae0e5cef6d6f5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 19:32:53 -0400 Subject: rcs_getctime and rcs_getmtime take relative filenames There was some confusion about whether the filename was relative to srcdir or not. Some test cases, and the bzr plugin assumed it was relative to the srcdir. Most everything else assumed it was absolute. Changed it to relative, for consistency with the rest of the rcs_ functions. --- IkiWiki/Plugin/cvs.pm | 2 +- IkiWiki/Plugin/darcs.pm | 9 +++------ IkiWiki/Plugin/git.pm | 3 --- IkiWiki/Plugin/mercurial.pm | 2 +- IkiWiki/Plugin/svn.pm | 6 +++--- IkiWiki/Render.pm | 4 ++-- debian/changelog | 2 ++ 7 files changed, 12 insertions(+), 16 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index c6687d780..1a432c052 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -459,7 +459,7 @@ sub rcs_diff ($) { } sub rcs_getctime ($) { - my $file=shift; + my $file=$config{srcdir}."/".shift(); my $cvs_log_infoline=qr/^date: (.+);\s+author/; diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index 0dfc8708d..0f63b8807 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -396,14 +396,11 @@ sub rcs_getctime ($) { eval q{use XML::Simple}; local $/=undef; - my $filer=substr($file, length($config{srcdir})); - $filer =~ s:^[/]+::; - my $child = open(LOG, "-|"); if (! $child) { exec("darcs", "changes", "--xml", "--reverse", - "--repodir", $config{srcdir}, $filer) - || error("'darcs changes $filer' failed to run"); + "--repodir", $config{srcdir}, $file) + || error("'darcs changes $file' failed to run"); } my $data; @@ -418,7 +415,7 @@ sub rcs_getctime ($) { my $datestr = $log->{patch}[0]->{local_date}; if (! defined $datestr) { - warn "failed to get ctime for $filer"; + warn "failed to get ctime for $file"; return 0; } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index b02fc118d..85368606e 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -658,9 +658,6 @@ sub findtimes ($$) { my $file=shift; my $id=shift; # 0 = mtime ; 1 = ctime - # Remove srcdir prefix - $file =~ s/^\Q$config{srcdir}\E\/?//; - if (! keys %time_cache) { my $date; foreach my $line (run_or_die('git', 'log', diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index edf915ae9..59dc63b4e 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -237,7 +237,7 @@ sub rcs_getctime ($) { my ($file) = @_; my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", - "--style", "default", $file); + "--style", "default", "$config{srcdir}/$file"); open (my $out, "-|", @cmdline); my @log = (mercurial_log($out)); diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index f1e608408..9cf82b5db 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -366,7 +366,7 @@ sub findtimes ($) { my $child = open(SVNLOG, "-|"); if (! $child) { - exec("svn", "log", $file) || error("svn log $file failed to run"); + exec("svn", "log", "$config{srcdir}/$file") || error("svn log failed to run"); } my ($cdate, $mdate); @@ -376,10 +376,10 @@ sub findtimes ($) { $mdate=$1 unless defined $mdate; } } - close SVNLOG || error "svn log $file exited $?"; + close SVNLOG || error "svn log exited $?"; if (! defined $cdate) { - error "failed to parse svn log for $file\n"; + error "failed to parse svn log for $file"; } eval q{use Date::Parse}; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index aae1f90b0..a653ab2da 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -374,7 +374,7 @@ sub find_new_files ($) { } eval { - my $ctime=rcs_getctime("$config{srcdir}/$file"); + my $ctime=rcs_getctime($file); if ($ctime > 0) { $pagectime{$page}=$ctime; } @@ -384,7 +384,7 @@ sub find_new_files ($) { } my $mtime; eval { - $mtime=rcs_getmtime("$config{srcdir}/$file"); + $mtime=rcs_getmtime($file); }; if ($@) { print STDERR $@; diff --git a/debian/changelog b/debian/changelog index f7452a070..88ed3a90b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * API: Add new optional field usershort to rcs_recentchanges. * API: rcs_commit and rcs_commit_staged are now passed named parameters. + * Fixed some confusion and bugginess about whether + rcs_getctime/rcs_getmtime were passed absolute or relative filenames. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 -- cgit v1.2.3 From b38b9327a8f11b642e5f51f7ee537043e25ccff9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 19:36:23 -0400 Subject: take username from email address as fallback --- IkiWiki/Plugin/openid.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index f4ba8db18..f19a559a9 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -187,12 +187,17 @@ sub auth ($$) { $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), ); } + my $username; foreach my $ext (@extensions) { foreach my $field (qw{value.email email}) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { $session->param(email => $ext->{$field}); + if (! defined $username && + $ext->{$field}=~/(.+)@.+/) { + $username = $1; + } last; } } @@ -200,11 +205,15 @@ sub auth ($$) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { - $session->param(username => $ext->{$field}); + $username=$ext->{$field}; last; } } } + if (defined $username) { + $username=~s/\s+/_/g; + $session->param(username => $username); + } } else { error("OpenID failure: ".$csr->err); -- cgit v1.2.3 From a4f381ace837a032bc202cc6b2a98e922d4b7cfc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 19:44:41 -0400 Subject: git: Record the username from openid in the git author email. (This avoids display of ugly google openids.) --- IkiWiki/Plugin/git.pm | 5 +++++ debian/changelog | 2 ++ doc/rcs.mdwn | 20 +++++++++++++------- doc/todo/Separate_OpenIDs_and_usernames.mdwn | 3 +++ 4 files changed, 23 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 85368606e..3e289e0c3 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -506,6 +506,11 @@ sub rcs_commit_staged (@) { if (defined $u) { $u=encode_utf8($u); $ENV{GIT_AUTHOR_NAME}=$u; + } + if (defined $params{session}->param("username")) { + $u=encode_utf8($params{session}->param("username")); + } + if (defined $u) { $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; } } diff --git a/debian/changelog b/debian/changelog index 88ed3a90b..dfa862e5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low parameters. * Fixed some confusion and bugginess about whether rcs_getctime/rcs_getmtime were passed absolute or relative filenames. + * git: Record the username from openid in the git author email. + (This avoids display of ugly google openids.) -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn index 248d93024..83c6910d0 100644 --- a/doc/rcs.mdwn +++ b/doc/rcs.mdwn @@ -10,13 +10,8 @@ generic that it can be adapted to work with many systems by writing a While all supported revision control systems work well enough for basic 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]]. `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. +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]] @@ -30,7 +25,18 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes `rcs_getmtime` |fast |slow |slow |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 +openid username |yes |no |no |no |no |no |no |no """]] +Notes: + +* 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]]. +* `rcs_getctime` and `rcs_getmtime` may be implemented in a fast way (ie, one log + lookup for all files), or very slowly (one lookup per file). +* Openid username support allows avoiding display of Google's ugly openids. + There is a page with [[details]] about how the different systems work with ikiwiki, for the curious. diff --git a/doc/todo/Separate_OpenIDs_and_usernames.mdwn b/doc/todo/Separate_OpenIDs_and_usernames.mdwn index fcdb49f6d..60b7b6c61 100644 --- a/doc/todo/Separate_OpenIDs_and_usernames.mdwn +++ b/doc/todo/Separate_OpenIDs_and_usernames.mdwn @@ -38,10 +38,13 @@ A slightly more complex next step would be to request sreg from the provider and > * Change `rcs_commit` and `rcs_commit_staged` to take a session object, > instead of just a userid. (For back-compat, if the parameter is > not an object, it's a userid.) Bump ikiwiki plugin interface version. +> (done) > * Modify all RCS plugins to include the session username somewhere > in the commit, and parse it back out in `rcs_recentchanges`. +> (done for git only so far) > * Modify recentchanges plugin to display the username instead of the > `openiduser`. +> (done) > * Modify comment plugin to put the session username in the comment > template instead of the `openiduser`. -- cgit v1.2.3 From 9a32451986c710d1f1ce71217c1f7ab3b84f72bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 20:12:26 -0400 Subject: finializing openid nickname support Renamed usershort => nickname. Note that this means existing user login sessions will not have the nickname recorded, and so it won't be used for those. --- IkiWiki/Plugin/comments.pm | 8 ++++++-- IkiWiki/Plugin/git.pm | 16 ++++++++++------ IkiWiki/Plugin/openid.pm | 14 +++++++------- IkiWiki/Plugin/recentchanges.pm | 2 +- debian/changelog | 10 +++++++--- doc/ikiwiki/directive/comment.mdwn | 2 ++ doc/plugins/write.mdwn | 2 +- 7 files changed, 34 insertions(+), 20 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 41c6948e8..d34951570 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -177,7 +177,7 @@ sub preprocess { if (defined $oiduser) { # looks like an OpenID $commentauthorurl = $commentuser; - $commentauthor = $oiduser; + $commentauthor = (defined $params{nickname} && length $params{nickname}) ? $params{nickname} : $oiduser; $commentopenid = $commentuser; } else { @@ -396,12 +396,16 @@ sub editcomment ($$) { my $content = "[[!comment format=$type\n"; - # FIXME: handling of double quotes probably wrong? if (defined $session->param('name')) { my $username = $session->param('name'); $username =~ s/"/"/g; $content .= " username=\"$username\"\n"; } + if (defined $session->param('nickname')) { + my $nickname = $session->param('nickname'); + $nickname =~ s/"/"/g; + $content .= " nickname=\"$nickname\"\n"; + } elsif (defined $session->remote_addr()) { my $ip = $session->remote_addr(); if ($ip =~ m/^([.0-9]+)$/) { diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 3e289e0c3..8d210cb5d 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -606,12 +606,16 @@ sub rcs_recentchanges ($) { push @messages, { line => $line }; } - my $user=$ci->{'author_name'}; - my $usershort=$ci->{'author_username'}; + my $user=$ci->{'author_username'}; my $web_commit = ($ci->{'author'} =~ /\@web>/); - - if ($usershort =~ /:\/\//) { - $usershort=undef; # url; not really short + my $nickname; + + # Set nickname only if a non-url author_username is available, + # and author_name is an url. + if ($user !~ /:\/\// && defined $ci->{'author_name'} && + $ci->{'author_name'} =~ /:\/\//) { + $nickname=$user; + $user=$ci->{'author_name'}; } # compatability code for old web commit messages @@ -626,7 +630,7 @@ sub rcs_recentchanges ($) { push @rets, { rev => $sha1, user => $user, - usershort => $usershort, + nickname => $nickname, committype => $web_commit ? "web" : "git", when => $when, message => [@messages], diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index f19a559a9..d393afd23 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -187,16 +187,16 @@ sub auth ($$) { $vident->signed_extension_fields('http://openid.net/srv/ax/1.0'), ); } - my $username; + my $nickname; foreach my $ext (@extensions) { foreach my $field (qw{value.email email}) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { $session->param(email => $ext->{$field}); - if (! defined $username && + if (! defined $nickname && $ext->{$field}=~/(.+)@.+/) { - $username = $1; + $nickname = $1; } last; } @@ -205,14 +205,14 @@ sub auth ($$) { if (exists $ext->{$field} && defined $ext->{$field} && length $ext->{$field}) { - $username=$ext->{$field}; + $nickname=$ext->{$field}; last; } } } - if (defined $username) { - $username=~s/\s+/_/g; - $session->param(username => $username); + if (defined $nickname) { + $nickname=~s/\s+/_/g; + $session->param(nickname => $nickname); } } else { diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 9f188cbff..758b98348 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -118,7 +118,7 @@ sub store ($$$) { my $oiduser=eval { IkiWiki::openiduser($change->{user}) }; if (defined $oiduser) { $change->{authorurl}=$change->{user}; - $change->{user}=defined $change->{usershort} ? $change->{usershort} : $oiduser; + $change->{user}=defined $change->{nickname} ? $change->{nickname} : $oiduser; } elsif (length $config{cgiurl}) { $change->{authorurl} = IkiWiki::cgiurl( diff --git a/debian/changelog b/debian/changelog index dfa862e5b..e41de638f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,16 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low - * API: Add new optional field usershort to rcs_recentchanges. + * Changes to avoid display of ugly google openids, by displaying + a username taken from openid. + * API: Add new optional field nickname to rcs_recentchanges. * API: rcs_commit and rcs_commit_staged are now passed named parameters. + * openid: Store nickname based on username or email provided from + openid provider. + * git: Record the nickname from openid in the git author email. + * comment: Record the username from openid in the comment page. * Fixed some confusion and bugginess about whether rcs_getctime/rcs_getmtime were passed absolute or relative filenames. - * git: Record the username from openid in the git author email. - (This avoids display of ugly google openids.) -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/doc/ikiwiki/directive/comment.mdwn b/doc/ikiwiki/directive/comment.mdwn index 693a92770..398130e2e 100644 --- a/doc/ikiwiki/directive/comment.mdwn +++ b/doc/ikiwiki/directive/comment.mdwn @@ -29,6 +29,8 @@ metadata of the comment. nearly any format, since it's parsed by [[!cpan TimeDate]] * `username` - Used to record the username (or OpenID) of a logged in commenter. +* `nickname` - Name to display for a logged in commenter. + (Optional; used for OpenIDs.) * `ip` - Can be used to record the IP address of a commenter, if they posted anonymously. * `claimedauthor` - Records the name that the user entered, diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index a2b954bd4..a921b9a02 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1108,7 +1108,7 @@ The data structure returned for each change is: { rev => # the RCSs id for this commit user => # user who made the change (may be an openid), - usershort => # short name of user (optional; not an openid), + nickname => # short name for user (optional; not an openid), committype => # either "web" or the name of the rcs, when => # time when the change was made, -- cgit v1.2.3 From 38bf2f6388d506e741395992617a900843e9ba0d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 20:26:09 -0400 Subject: bugfix --- IkiWiki/Plugin/git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 8d210cb5d..992c6226b 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -507,8 +507,8 @@ sub rcs_commit_staged (@) { $u=encode_utf8($u); $ENV{GIT_AUTHOR_NAME}=$u; } - if (defined $params{session}->param("username")) { - $u=encode_utf8($params{session}->param("username")); + if (defined $params{session}->param("nickname")) { + $u=encode_utf8($params{session}->param("nickname")); } if (defined $u) { $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; -- cgit v1.2.3 From d8d057c356e0244585aa0eac075b39958c6c3f37 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Jun 2010 21:29:47 -0400 Subject: chdir to srcdir in rcs_getctime --- IkiWiki/Plugin/cvs.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 1a432c052..4972efb58 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -459,7 +459,9 @@ sub rcs_diff ($) { } sub rcs_getctime ($) { - my $file=$config{srcdir}."/".shift(); + my $file=shift; + + local $CWD = $config{srcdir}; my $cvs_log_infoline=qr/^date: (.+);\s+author/; -- cgit v1.2.3