From fa59bfad847a9895a37803bc21fb28a27f0fc368 Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/lingo.t.l.chen" Date: Sat, 9 Jan 2010 13:56:39 +0000 Subject: --- doc/bugs/utf-8_bug_in_websetup.pm.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/utf-8_bug_in_websetup.pm.mdwn b/doc/bugs/utf-8_bug_in_websetup.pm.mdwn index efa2c9ffe..c3a5262cd 100644 --- a/doc/bugs/utf-8_bug_in_websetup.pm.mdwn +++ b/doc/bugs/utf-8_bug_in_websetup.pm.mdwn @@ -1,4 +1,4 @@ -[[!tag patch]] +[[!tag patch bugs]] I type chinese characters into the fields. After press "save setup" button the characters turn into gibberish. -- 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 'doc/bugs') 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 f072f3a9c57bc590b4fb754a7cf65b5f93684006 Mon Sep 17 00:00:00 2001 From: "http://apoca.myopenid.com/" Date: Mon, 18 Jan 2010 17:25:13 +0000 Subject: --- doc/bugs/removing_pages_with_utf8_characters.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/bugs/removing_pages_with_utf8_characters.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/removing_pages_with_utf8_characters.mdwn b/doc/bugs/removing_pages_with_utf8_characters.mdwn new file mode 100644 index 000000000..a962a328a --- /dev/null +++ b/doc/bugs/removing_pages_with_utf8_characters.mdwn @@ -0,0 +1,18 @@ +I have a page with the name "umläute". When I try to remove it, ikiwiki says: + +Error: ?umläute does not exist + +I wrote the following patch, which seems to work on my machine. I'm running on FreeBSD 6.3-RELEASE with ikiwiki-3.20100102.3 and perl-5.8.9_3. + + --- remove.pm.orig 2009-12-14 23:26:20.000000000 +0100 + +++ remove.pm 2010-01-18 17:49:39.000000000 +0100 + @@ -193,6 +193,7 @@ + # and that the user is allowed to edit(/remove) it. + my @files; + foreach my $page (@pages) { + + $page = Encode::decode_utf8($page); + check_canremove($page, $q, $session); + + # This untaint is safe because of the + + -- cgit v1.2.3 From 265b4f0576d5e6be61d80239db372430c52f31b7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 12:38:05 -0500 Subject: response --- doc/bugs/removing_pages_with_utf8_characters.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/removing_pages_with_utf8_characters.mdwn b/doc/bugs/removing_pages_with_utf8_characters.mdwn index a962a328a..77ec00575 100644 --- a/doc/bugs/removing_pages_with_utf8_characters.mdwn +++ b/doc/bugs/removing_pages_with_utf8_characters.mdwn @@ -2,6 +2,10 @@ I have a page with the name "umläute". When I try to remove it, ikiwiki says: Error: ?umläute does not exist +> I'm curious about the '?' in the "?umläute" message. Suggests that the +> filename starts with another strange character. Can I get a copy of a +> git repository or tarball containing this file? --[[Joey]] + I wrote the following patch, which seems to work on my machine. I'm running on FreeBSD 6.3-RELEASE with ikiwiki-3.20100102.3 and perl-5.8.9_3. --- remove.pm.orig 2009-12-14 23:26:20.000000000 +0100 @@ -16,3 +20,9 @@ I wrote the following patch, which seems to work on my machine. I'm running on F # This untaint is safe because of the +> The problem with this patch is that, in a recent fix to the same +> plugin, I made `@pages` come from `$form->field("page")`, and +> that, in turn is already run through `decode_form_utf8` just above the +> code you patched. So I need to understand why that is apparently not +> working for you. (It works fine for me, even when deleting a file named +> "umläute" --[[Joey]] -- cgit v1.2.3 From be523e7740339d7884dabfa915c7c2df8c60bf27 Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/schmonz" Date: Mon, 18 Jan 2010 19:13:00 +0000 Subject: response --- doc/bugs/anonok_vs._httpauth.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index e386a8d96..0a62164cb 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -54,3 +54,7 @@ and a whitelist of OpenIDs in `locked_pages`...) >>>>>> change. And then the Edit link for Discussion subpages could do >>>>>> as you suggest, adding one click for the httpauth user, who won't >>>>>> often need to edit those subpages. --[[schmonz]] + +>> On reflection, I've stopped being bothered by the +>> redirect-to-signin-page approach. (It only needs to happen once per +>> browser session, anyway.) Can we try that? --[[schmonz]] -- cgit v1.2.3 From 4a8389825ae0715ba68846881ddc8d25b3f9ccb8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 18:00:10 -0500 Subject: update --- doc/bugs/removing_pages_with_utf8_characters.mdwn | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/removing_pages_with_utf8_characters.mdwn b/doc/bugs/removing_pages_with_utf8_characters.mdwn index 77ec00575..2fa4efa8b 100644 --- a/doc/bugs/removing_pages_with_utf8_characters.mdwn +++ b/doc/bugs/removing_pages_with_utf8_characters.mdwn @@ -26,3 +26,24 @@ I wrote the following patch, which seems to work on my machine. I'm running on F > code you patched. So I need to understand why that is apparently not > working for you. (It works fine for me, even when deleting a file named > "umläute" --[[Joey]] + +---- + +> Update, having looked at the file in the src of the wiki that +> is causing trouble for remove, it is: `uml\303\203\302\244ute.mdwn` +> And that is not utf-8 encoded, which, represented the same +> would be: `uml\303\244ute.mdwn` +> +> I think it's doubly-utf-8 encoded, which perhaps explains why the above +> patch works around the problem (since the page name gets doubly-decoded +> with it). The patch doesn't fix related problems when using remove, etc. +> +> Apparently, on apoca's system, perl encodes filenames differently +> depending on locale settings. On mine, it does not. Ie, this perl +> program always creates a file named `uml\303\244ute`, no matter +> whether I run it with LANG="" or LANG="en_US.UTF-8": +> +> perl -e 'use IkiWiki; writefile("umläute", "./", "baz")' +> +> Remains to be seen if this is due to the older version of perl used +> there, or perhaps FreeBSD itself. --[[Joey]] -- cgit v1.2.3 From 30c5f62f741b8be4677b46b19a6c7ccb5963e101 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2010 20:41:12 -0500 Subject: update --- doc/bugs/removing_pages_with_utf8_characters.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/removing_pages_with_utf8_characters.mdwn b/doc/bugs/removing_pages_with_utf8_characters.mdwn index 2fa4efa8b..0d96aa75f 100644 --- a/doc/bugs/removing_pages_with_utf8_characters.mdwn +++ b/doc/bugs/removing_pages_with_utf8_characters.mdwn @@ -47,3 +47,5 @@ I wrote the following patch, which seems to work on my machine. I'm running on F > > Remains to be seen if this is due to the older version of perl used > there, or perhaps FreeBSD itself. --[[Joey]] +> +> Update: Perl 5.10 fixed the problem. --[[Joey]] -- cgit v1.2.3 From 34a64557cf5f4a913c07f04d021debdd5fb58b1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Feb 2010 13:46:12 -0500 Subject: scratch patch --- doc/bugs/anonok_vs._httpauth.mdwn | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index 0a62164cb..1c492139b 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -58,3 +58,45 @@ and a whitelist of OpenIDs in `locked_pages`...) >> On reflection, I've stopped being bothered by the >> redirect-to-signin-page approach. (It only needs to happen once per >> browser session, anyway.) Can we try that? --[[schmonz]] + +Here is an attempt. With this httpauth will only redirect to the +`cgiauth_url` when a page is edited, and it will defer to other plugins +like anonok first. I have not tested this. --[[Joey]] + +
+diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm
+index 127c321..c181164 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
+
-- cgit v1.2.3 From 1bb06210e956801d4b64641dbc84059ad36f797e Mon Sep 17 00:00:00 2001 From: "http://www.google.com/profiles/schmonz" Date: Sun, 7 Feb 2010 01:51:30 +0000 Subject: tested --- doc/bugs/anonok_vs._httpauth.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index 1c492139b..1940fdad8 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -100,3 +100,6 @@ index 127c321..c181164 100644 1 + +> With `anonok` enabled, this works for anonymous editing of an +> existing Discussion page. auth is still needed to create one. --[[schmonz]] -- cgit v1.2.3 From 26c68a0c7ae6dd7810a2c4277b6589e03e4e9c47 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 16:28:22 -0500 Subject: refresh patch; remaining problem --- doc/bugs/anonok_vs._httpauth.mdwn | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index 1940fdad8..d301b53fb 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -65,7 +65,7 @@ like anonok first. I have not tested this. --[[Joey]]
 diff --git a/IkiWiki/Plugin/httpauth.pm b/IkiWiki/Plugin/httpauth.pm
-index 127c321..c181164 100644
+index 127c321..a18f8ca 100644
 --- a/IkiWiki/Plugin/httpauth.pm
 +++ b/IkiWiki/Plugin/httpauth.pm
 @@ -9,6 +9,8 @@ use IkiWiki 3.00;
@@ -77,11 +77,13 @@ index 127c321..c181164 100644
  }
  
  sub getsetup () {
-@@ -33,10 +35,20 @@ sub auth ($$) {
+@@ -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 ($$$) {
@@ -90,16 +92,29 @@ index 127c321..c181164 100644
 +	my $session=shift;
 +
 +	if (! defined $cgi->remote_user() && defined $config{cgiauthurl}) {
- 		IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string());
- 		exit;
- 	}
++		return sub {
++			IkiWiki::redirect($cgi, $config{cgiauthurl}.'?'.$cgi->query_string());
++			exit;
++		};
++	}
 +	else {
 +		return undef;
-+	}
-}
+ 	}
+ }
  
- 1
 
> With `anonok` enabled, this works for anonymous editing of an > existing Discussion page. auth is still needed to create one. --[[schmonz]] + +>> Refreshed above patch to fix that. --[[Joey]] + +>> Remaining issue: Since both signinedit and httpauth have canedit hooks that +>> run "last", behavior will vary depending on which wins and really goes +>> last. So mixing this with openid or passwordauth won't work yet, though +>> it will work mixed with anonok. +>> +>> Seems like what needs to happen is for httpauth's canedit to run before +>> signinedit's, however it still needs to run relatively late; after eg, +>> anonok's hook. Better hook ordering needed. I knew we'd need it sooner +>> or later! --[[Joey]] -- cgit v1.2.3 From c47712b340153fca4015f8d0e344ced5b12a3e17 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 16:35:55 -0500 Subject: clarify --- doc/bugs/anonok_vs._httpauth.mdwn | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn index d301b53fb..b738e3b6c 100644 --- a/doc/bugs/anonok_vs._httpauth.mdwn +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -109,12 +109,8 @@ index 127c321..a18f8ca 100644 >> Refreshed above patch to fix that. --[[Joey]] ->> Remaining issue: Since both signinedit and httpauth have canedit hooks that ->> run "last", behavior will vary depending on which wins and really goes ->> last. So mixing this with openid or passwordauth won't work yet, though ->> it will work mixed with anonok. ->> ->> Seems like what needs to happen is for httpauth's canedit to run before ->> signinedit's, however it still needs to run relatively late; after eg, ->> anonok's hook. Better hook ordering needed. I knew we'd need it sooner ->> or later! --[[Joey]] +>> Remaining issue: This patch will work with anonok, but not openid or +>> passwordauth, both of which want to display a login page at the same +>> 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]] -- cgit v1.2.3 From 046095552ac231366d71a3c7a84bdc6d46662212 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2010 17:26:09 -0500 Subject: httpauth: When cgiauthurl is configured, httpauth can now be used alongside other authentication methods (like openid or anonok). Rather than always redirect to the cgiauthurl for authentication, there is now a button on the login form to use it. --- IkiWiki/Plugin/httpauth.pm | 35 +++++++++++++++++++++++++++++++---- IkiWiki/Plugin/openid.pm | 2 +- debian/changelog | 4 ++++ doc/bugs/anonok_vs._httpauth.mdwn | 2 ++ doc/plugins/httpauth.mdwn | 9 +++++---- 5 files changed, 43 insertions(+), 9 deletions(-) (limited to 'doc/bugs') 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 3200be56e5fc6c89115277f9f842a3f417f8d7db Mon Sep 17 00:00:00 2001 From: prosper Date: Fri, 19 Feb 2010 10:23:26 +0000 Subject: --- doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn b/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn new file mode 100644 index 000000000..8cc97a032 --- /dev/null +++ b/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn @@ -0,0 +1,7 @@ +It seems that rebuild a wiki (`ikiwiki --rebuild`) after changing the `underlaydir` config option doesn't remove the pages coming from the previous underlaydir. + +I've noticed this with the debian package version 3.20100102.3~bpo50+1. + +Perhaps it is possible to improve this or mention it in the manual page? + +--prosper -- cgit v1.2.3 From d01e7248bf4c9f6a7ec6920a0fe4cda4d776e171 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Feb 2010 13:33:48 -0500 Subject: response --- doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn b/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn index 8cc97a032..8613ef03c 100644 --- a/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn +++ b/doc/bugs/rebuild_after_changing_the_underlaydir_config_option.mdwn @@ -5,3 +5,8 @@ I've noticed this with the debian package version 3.20100102.3~bpo50+1. Perhaps it is possible to improve this or mention it in the manual page? --prosper + +> --rebuild causes ikiwiki to throw away all its info about what it built +> before, so it will never clean up pages that have been removed, by any +> means. Suggest you do a --refresh, possibly followed by a --rebuild +> if that is really necessary. --[[Joey]] -- cgit v1.2.3 From feeacaba028afe2e0b8835e2ebedc930de0f33a5 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 24 Feb 2010 15:12:40 +0000 Subject: --- ...by_pagename_and_not_title_when_show__61__title_is_used.mdwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn index f8e257daf..bc19e7d87 100644 --- a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn +++ b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn @@ -1,4 +1,4 @@ -The [[directive/map]] directive sorty by pagename. That looks kind of odd, when used together with show=title. I would expect it to sort by title then. +The [[ikiwiki/directive/map]] directive sort by pagename. That looks kind of odd, when used together with show=title. I would expect it to sort by title then. > This would be quite hard to fix. Map sorts the pages it displays by page > name, which has the happy effect of making "foo/bar" come after "foo"; @@ -6,3 +6,11 @@ The [[directive/map]] directive sorty by pagename. That looks kind of odd, when > it's located in. If sorting by title, that wouldn't hold. So, map > would have to be effectively totally rewritten, to build up each group > of child pages, and then re-sort those. --[[Joey]] + +>> Ok, you are right, that does would break the tree. This made me think that I do not +>> need to generate a tree for my particular use case just a list, so i thought i could use [[ikiwiki/directive/inline]] instead. +>> This created two new issues: +>> +>> 1. inline also does sort by pagename even when explicitly told to sort by title. +>> +>> 2. I cannot get inline to create a list when the htmltidy plugin is switched on. I have a template which is enclosed in an li tag, and i put the ul tag around the inline manually, but htmltidy breaks this. --martin -- cgit v1.2.3 From 983ecb0915b27f33e14e4b2e20090df69419f374 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 26 Feb 2010 06:37:42 +0000 Subject: made a suggestion --- ...ap_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn index bc19e7d87..de178d415 100644 --- a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn +++ b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn @@ -14,3 +14,5 @@ The [[ikiwiki/directive/map]] directive sort by pagename. That looks kind of odd >> 1. inline also does sort by pagename even when explicitly told to sort by title. >> >> 2. I cannot get inline to create a list when the htmltidy plugin is switched on. I have a template which is enclosed in an li tag, and i put the ul tag around the inline manually, but htmltidy breaks this. --martin + +>>>> You might want to check if the [[plugins/contrib/report]] plugin solves your problem. It can sort by title, among other things. --[[KathrynAndersen]] -- cgit v1.2.3 From b3df992552b2a608fd46740252b8fd76bf3c09bb Mon Sep 17 00:00:00 2001 From: "http://cdombroski.myopenid.com/" Date: Tue, 2 Mar 2010 02:19:51 +0000 Subject: --- doc/bugs/External_links_with_Creole.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/bugs/External_links_with_Creole.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/External_links_with_Creole.mdwn b/doc/bugs/External_links_with_Creole.mdwn new file mode 100644 index 000000000..3d800b04e --- /dev/null +++ b/doc/bugs/External_links_with_Creole.mdwn @@ -0,0 +1,3 @@ +When using Creole for markup, creating an external link appears to be impossible. Neither \[[Outside URL|http://example.com]] nor <> nor \[Outside URL]\(http://example.com) work. The first gets rendered as a broken WikiLink, the second get eaten and the last is not parsed in anyway so you end up with that exact text in your page. + +I'd have made this as a Creole page as a practical demonstration, but that doesn't seem possible here. Here's a page with an example: -- cgit v1.2.3 From d469a410eaad03553cb5ef41a69c772c6d50bf76 Mon Sep 17 00:00:00 2001 From: "http://cdombroski.myopenid.com/" Date: Tue, 2 Mar 2010 15:47:23 +0000 Subject: Bug: 404 plugin & lighttpd --- doc/bugs/404_plugin_and_lighttpd.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/bugs/404_plugin_and_lighttpd.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/404_plugin_and_lighttpd.mdwn b/doc/bugs/404_plugin_and_lighttpd.mdwn new file mode 100644 index 000000000..e60fd209a --- /dev/null +++ b/doc/bugs/404_plugin_and_lighttpd.mdwn @@ -0,0 +1,5 @@ +Lighttpd apparently sets REDIRECT_STATUS=200 for the server.error-handler-404 page. This breaks the 404 plugin which checks this variable for 404 before processing the URI. It also doesn't seem to set REDIRECT_URL. + +I was able to fix my server to check the REQUEST_URI for ikiwiki.cgi and to continue processing if it was not found, passing $ENV{SEVER_NAME} . $ENV{REQUEST_URI} as the first parameter to cgi_page_from_404. However, my perl is terrible and I just made it work rather than figuring out exactly what to do to get it to work on both lighttpd and apache. + +This is with lighttpd 1.4.19 on Debian. -- cgit v1.2.3 From 8aae08aafda8be4d17dd45bd04318b40e276878a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 2 Mar 2010 19:56:53 +0000 Subject: --- doc/bugs/404_plugin_and_lighttpd.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/404_plugin_and_lighttpd.mdwn b/doc/bugs/404_plugin_and_lighttpd.mdwn index e60fd209a..29ca107dc 100644 --- a/doc/bugs/404_plugin_and_lighttpd.mdwn +++ b/doc/bugs/404_plugin_and_lighttpd.mdwn @@ -3,3 +3,11 @@ Lighttpd apparently sets REDIRECT_STATUS=200 for the server.error-handler-404 pa I was able to fix my server to check the REQUEST_URI for ikiwiki.cgi and to continue processing if it was not found, passing $ENV{SEVER_NAME} . $ENV{REQUEST_URI} as the first parameter to cgi_page_from_404. However, my perl is terrible and I just made it work rather than figuring out exactly what to do to get it to work on both lighttpd and apache. This is with lighttpd 1.4.19 on Debian. + +> /cgi-bin/ikiwiki.cgi?do=goto also provides redirection in the same way, +> if that's any help? You might need to set the lighttpd 404 handler to +> that, then compose REDIRECT_URL from other variables if necessary. +> +> I originally wrote the plugin for Apache; [[weakish]] contributed the +> lighttpd docs and might know more about how to make it work there. +> --[[smcv]] -- cgit v1.2.3 From 4a7fb67ee6c32b1d66e19f345998b98b169100f0 Mon Sep 17 00:00:00 2001 From: "http://cdombroski.myopenid.com/" Date: Wed, 3 Mar 2010 00:14:47 +0000 Subject: Posting my change to the 404 module --- doc/bugs/404_plugin_and_lighttpd.mdwn | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/404_plugin_and_lighttpd.mdwn b/doc/bugs/404_plugin_and_lighttpd.mdwn index 29ca107dc..ffbad8add 100644 --- a/doc/bugs/404_plugin_and_lighttpd.mdwn +++ b/doc/bugs/404_plugin_and_lighttpd.mdwn @@ -11,3 +11,25 @@ This is with lighttpd 1.4.19 on Debian. > I originally wrote the plugin for Apache; [[weakish]] contributed the > lighttpd docs and might know more about how to make it work there. > --[[smcv]] + +>> As I said, I got it working for me, but somebody who knows perl should probably look at it with the aim of making it work for everyone. +>> I considered having lighttpd construct a proper url for the 404 redirect itself, but I don't know if it can do something like that or not. +>> For what it's worth, here's the change I made to the module: + + sub cgi ($) { + my $cgi=shift; + if ($ENV{REQUEST_URI} !~ /ikiwiki\.cgi/) { + my $page = cgi_page_from_404( + Encode::decode_utf8($ENV{SERVER_NAME} . $ENV{REQUEST_URI}), + $config{url}, $config{usedirs}); + IkiWiki::Plugin::goto::cgi_goto($cgi, $page); + } + + # if (exists $ENV{REDIRECT_STATUS} && + # $ENV{REDIRECT_STATUS} eq '404') { + # my $page = cgi_page_from_404( + # Encode::decode_utf8($ENV{REDIRECT_URL}), + # $config{url}, $config{usedirs}); + # IkiWiki::Plugin::goto::cgi_goto($cgi, $page); + # } + } -- cgit v1.2.3 From 9e603d2640758d8b4c0420f2984ffe21bd78c7d6 Mon Sep 17 00:00:00 2001 From: capitaine Date: Tue, 9 Mar 2010 05:30:53 +0000 Subject: --- doc/bugs/bestlink_returns_deleted_pages.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/bestlink_returns_deleted_pages.mdwn b/doc/bugs/bestlink_returns_deleted_pages.mdwn index 874f18ead..d3c5c8012 100644 --- a/doc/bugs/bestlink_returns_deleted_pages.mdwn +++ b/doc/bugs/bestlink_returns_deleted_pages.mdwn @@ -28,7 +28,7 @@ won't it make sense for bestlink() to check %pagesources first? --[[harishcm]] > maybe by keeping a copy of the old backlinks info, then that fix could be > applied here too. --[[Joey]] ->> Cool that was fast! Well at least half the bug is solved :) For now I'll +>> Cool that was fast! Well at least half the college essay bug is solved :) For now I'll >> probably try using a workaround if using bestlink within the needsbuild >> or scan hooks. Maybe by testing if pagemtime equals zero. --[[harishcm]] @@ -48,8 +48,8 @@ won't it make sense for bestlink() to check %pagesources first? --[[harishcm]] use IkiWiki 3.00; sub import { - hook(type => "getsetup", id => "bestlinkbug", call => \&getsetup); - hook(type => "needsbuild", id => "bestlinkbug", call => \&needsbuild); + hook(type => "getsetup", id => "bestlinkbug", call => &getsetup); + hook(type => "needsbuild", id => "bestlinkbug", call => &needsbuild); } sub getsetup () { -- cgit v1.2.3 From 312b7d05f82045f400931c8e110efb7d76b69eed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Mar 2010 00:40:51 -0500 Subject: Revert spam --- doc/bugs.mdwn | 2 +- doc/bugs/bestlink_returns_deleted_pages.mdwn | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index f44cfdca2..f634b6e78 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -1,5 +1,5 @@ If you've found a bug in ikiwiki, post about it here. [[TODO]] items go -elsewhere. Link college essay items to [[bugs/done]] when done. +elsewhere. Link items to [[bugs/done]] when done. Also see the [Debian bugs](http://bugs.debian.org/ikiwiki). diff --git a/doc/bugs/bestlink_returns_deleted_pages.mdwn b/doc/bugs/bestlink_returns_deleted_pages.mdwn index d3c5c8012..874f18ead 100644 --- a/doc/bugs/bestlink_returns_deleted_pages.mdwn +++ b/doc/bugs/bestlink_returns_deleted_pages.mdwn @@ -28,7 +28,7 @@ won't it make sense for bestlink() to check %pagesources first? --[[harishcm]] > maybe by keeping a copy of the old backlinks info, then that fix could be > applied here too. --[[Joey]] ->> Cool that was fast! Well at least half the college essay bug is solved :) For now I'll +>> Cool that was fast! Well at least half the bug is solved :) For now I'll >> probably try using a workaround if using bestlink within the needsbuild >> or scan hooks. Maybe by testing if pagemtime equals zero. --[[harishcm]] @@ -48,8 +48,8 @@ won't it make sense for bestlink() to check %pagesources first? --[[harishcm]] use IkiWiki 3.00; sub import { - hook(type => "getsetup", id => "bestlinkbug", call => &getsetup); - hook(type => "needsbuild", id => "bestlinkbug", call => &needsbuild); + hook(type => "getsetup", id => "bestlinkbug", call => \&getsetup); + hook(type => "needsbuild", id => "bestlinkbug", call => \&needsbuild); } sub getsetup () { -- cgit v1.2.3 From 9f82e93fca0da9c325ebf907d7dab00bd5baa3b1 Mon Sep 17 00:00:00 2001 From: dkowis Date: Wed, 10 Mar 2010 19:13:50 +0000 Subject: --- doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn new file mode 100644 index 000000000..4c819816e --- /dev/null +++ b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn @@ -0,0 +1,16 @@ +In the template for ikiwiki's recent changes page + + /usr/share/ikiwiki/templates/change.tmpl + +there is a missing tag after the + + + +This results in the recentchanges/ page being invalid and rendering quite horrifyingly in Internet Exploder. + +[I'm running](http://wiki.shlrm.org) (linked so you can see the one I'm running if you need to) the latest version of ikiwiki, and I note that it's broken on [ikiwiki.info](http://validator.w3.org/check?uri=http%3A%2F%2Fikiwiki.info%2Frecentchanges%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.767) too :) + +[This one on debian](https://www.icanttype.org/recentchanges/) is somehow [valid](http://validator.w3.org/check?uri=https%3A%2F%2Fwww.icanttype.org%2F%2Frecentchanges%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.767), although it's using the same template. Perhaps there's an additional scrubbing going on his end. + +Thanks, +David -- cgit v1.2.3 From 1c03cf9ba2aaa4ac6d28eb1d13c0015809fad2c1 Mon Sep 17 00:00:00 2001 From: dkowis Date: Wed, 10 Mar 2010 19:27:26 +0000 Subject: noted that I fixed the template on my box --- doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn index 4c819816e..007d763b5 100644 --- a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn +++ b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn @@ -14,3 +14,5 @@ This results in the recentchanges/ page being invalid and rendering quite horrif Thanks, David + +PS: I have fixed the template by hand on my server, so it will validate, however ikiwiki.info will not. -- cgit v1.2.3 From e4ed8a51c1eb7bd80f416dcc59231a13e3d1255e Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 11 Mar 2010 18:20:10 +0000 Subject: fix in a branch --- doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn index 007d763b5..536af3473 100644 --- a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn +++ b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn @@ -16,3 +16,9 @@ Thanks, David PS: I have fixed the template by hand on my server, so it will validate, however ikiwiki.info will not. + +> [[!template id="gitbranch" branch=smcv/trivia author="[[smcv]]"]] [[!tag patch]] +> Enabling either [[plugins/htmltidy]] or [[plugins/htmlbalance]] will automatically fix unbalanced +> markup like this; using [[plugins/comments]] without having one or other of those is a bad idea +> from the point of view of avoiding comment forgery, which is probably why icanttype.org works +> correctly. Anyway, I've fixed this in a branch: Joey, care to review smcv/trivia? --[[smcv]] -- cgit v1.2.3 From f259f33a0ad4858ce33f458148f1733351b91d92 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Mar 2010 15:49:48 -0500 Subject: Fix missing span on recentchanges page template. --- debian/changelog | 1 + doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn | 2 ++ 2 files changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/debian/changelog b/debian/changelog index c58e612db..6b5671e3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ikiwiki (3.20100303) UNRELEASED; urgency=low while not moderating other users. * moderatedcomments: The moderate_users setting is deprecated. Instead, set moderate_pagespec to "!admin()" or "user(*)" instead. + * Fix missing span on recentchanges page template. -- Joey Hess Tue, 09 Mar 2010 19:46:35 -0500 diff --git a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn index 536af3473..5c322991a 100644 --- a/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn +++ b/doc/bugs/templateForRecentChangesMissingCloseSpan.mdwn @@ -22,3 +22,5 @@ PS: I have fixed the template by hand on my server, so it will validate, however > markup like this; using [[plugins/comments]] without having one or other of those is a bad idea > from the point of view of avoiding comment forgery, which is probably why icanttype.org works > correctly. Anyway, I've fixed this in a branch: Joey, care to review smcv/trivia? --[[smcv]] + +[[done]], thanks guys --[[Joey]] -- cgit v1.2.3 From 0c3f59d33aa6af6c327d863a4110337ac9cae898 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Mar 2010 16:16:47 -0500 Subject: move bug report to bugs and close --- ...eption:_Unknown_function___96__this__39___.mdwn | 60 ++++++++++++++++++++++ ...eption:_Unknown_function___96__this__39___.mdwn | 58 --------------------- 2 files changed, 60 insertions(+), 58 deletions(-) create mode 100644 doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn delete mode 100644 doc/forum/Exception:_Unknown_function___96__this__39___.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn b/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn new file mode 100644 index 000000000..9eac8eae5 --- /dev/null +++ b/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn @@ -0,0 +1,60 @@ +I'm very excited to try out ikiwiki, since it should fit my purposes extremely well, but I'm having trouble with the search plugin. I'm pretty sure that right after I installed ikiwiki and needed dependencies, the search plugin was working fine. However, now when I try to use search, I get "Exception: Unknown function `this'" error on a blank page. I'm not sure how I should go about debugging this issue - my server's (I use Lighttpd 1.4.22) error log has no mention of the exception and there's nothing in /var/log/syslog either. + +What might be causing this exception and how I might go about debugging exceptions? + +> Appears to be coming from your xapian omega cgi binary. If you +> run `strings /usr/lib/cgi-bin/omega/omega` you can see it has +> "Exception: " in it, and I have found some similar (but not identical) +> error messages from xapian in a web search. +> +> I don´t know what to suggest, other than upgrade/downgrade/reinstall +> xapian-omega, and contacting the xapian developers for debugging. +> You could try rebuilding your wiki in case it is somehow +> caused by a problem with the xapian database. Failing everything, you +> could switch to [[google_search_plugin|plugins/google]]. --[[Joey]] + +>> Thanks, Joey. With your help I was able to figure out what was wrong. It's a fun little bug (or feature): the title of my wiki had string `$this` in title and that's what was causing the omega binary to choke. My wiki's title was inserted without escaping into the query template used by omega. Omega treated `$this` in the title as a function name and threw an exception because no such function was defined. To avoid this behavior, I used an html entity in the title, so `$this` became `$this`. I don't think that the wiki title should be inserted into the template without escaping - it can produce an error that's not trivial to debug. If users want to modify the html in the title, they should be editing respective templates, not typing html in the wiki title input. What do you think? --[[dkobozev]] + +>>> Sounds like a bug in omega, and one that probably would affect other +>>> users of omega too. Ikiwiki could work around it by pre-escaping +>>> data before passing it to xapian. I have not quite managed to reproduce it though; +>>> tried setting a page title to '$this' and 'foo $this'. +>>> That's with version 1.0.18 of omega. +>>> --[[Joey]] + +>>>> I tried it with both omega 1.0.13 and omega 1.0.18 and the issue is present in both. If I view the contents of {$srcdir}/.ikiwiki/xapian/templates/query, I can see that the wiki title is inserted verbatim and there are calls to `$setmap`, `$set` and `$def` etc in the template. --[[dkobozev]] + +>>>>> I don't see how that's relevant. It would help if you showed me +>>>>> exactly something that could be inserted into a page to cause the +>>>>> problem. --[[Joey]] + +>>>>>> Correct me if I'm wrong: ikiwiki generates an Omega template from its own templates, such as searchquery.tmpl and puts it into {$srcdir}/.ikiwiki/xapian/templates/query. Omega has its own template syntax, where function names are prefixed with dollar signs (`$`). So, when I call my wiki `$foobar`, ikiwiki generates an Omega template that looks like this snippet: + +
+ + +
+ $setmap{prefix,title,S} + $setmap{prefix,link,XLINK} + $set{thousand,$.}$set{decimal,.}$setmap{BN,,Any Country,uk,England,fr,France} + ${ + $def{PREV, + $if{$ne{$topdoc,0},, + } + +>>>>>> 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]] + +[[done]] diff --git a/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn b/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn deleted file mode 100644 index 035247100..000000000 --- a/doc/forum/Exception:_Unknown_function___96__this__39___.mdwn +++ /dev/null @@ -1,58 +0,0 @@ -I'm very excited to try out ikiwiki, since it should fit my purposes extremely well, but I'm having trouble with the search plugin. I'm pretty sure that right after I installed ikiwiki and needed dependencies, the search plugin was working fine. However, now when I try to use search, I get "Exception: Unknown function `this'" error on a blank page. I'm not sure how I should go about debugging this issue - my server's (I use Lighttpd 1.4.22) error log has no mention of the exception and there's nothing in /var/log/syslog either. - -What might be causing this exception and how I might go about debugging exceptions? - -> Appears to be coming from your xapian omega cgi binary. If you -> run `strings /usr/lib/cgi-bin/omega/omega` you can see it has -> "Exception: " in it, and I have found some similar (but not identical) -> error messages from xapian in a web search. -> -> I don´t know what to suggest, other than upgrade/downgrade/reinstall -> xapian-omega, and contacting the xapian developers for debugging. -> You could try rebuilding your wiki in case it is somehow -> caused by a problem with the xapian database. Failing everything, you -> could switch to [[google_search_plugin|plugins/google]]. --[[Joey]] - ->> Thanks, Joey. With your help I was able to figure out what was wrong. It's a fun little bug (or feature): the title of my wiki had string `$this` in title and that's what was causing the omega binary to choke. My wiki's title was inserted without escaping into the query template used by omega. Omega treated `$this` in the title as a function name and threw an exception because no such function was defined. To avoid this behavior, I used an html entity in the title, so `$this` became `$this`. I don't think that the wiki title should be inserted into the template without escaping - it can produce an error that's not trivial to debug. If users want to modify the html in the title, they should be editing respective templates, not typing html in the wiki title input. What do you think? --[[dkobozev]] - ->>> Sounds like a bug in omega, and one that probably would affect other ->>> users of omega too. Ikiwiki could work around it by pre-escaping ->>> data before passing it to xapian. I have not quite managed to reproduce it though; ->>> tried setting a page title to '$this' and 'foo $this'. ->>> That's with version 1.0.18 of omega. ->>> --[[Joey]] - ->>>> I tried it with both omega 1.0.13 and omega 1.0.18 and the issue is present in both. If I view the contents of {$srcdir}/.ikiwiki/xapian/templates/query, I can see that the wiki title is inserted verbatim and there are calls to `$setmap`, `$set` and `$def` etc in the template. --[[dkobozev]] - ->>>>> I don't see how that's relevant. It would help if you showed me ->>>>> exactly something that could be inserted into a page to cause the ->>>>> problem. --[[Joey]] - ->>>>>> Correct me if I'm wrong: ikiwiki generates an Omega template from its own templates, such as searchquery.tmpl and puts it into {$srcdir}/.ikiwiki/xapian/templates/query. Omega has its own template syntax, where function names are prefixed with dollar signs (`$`). So, when I call my wiki `$foobar`, ikiwiki generates an Omega template that looks like this snippet: - -
- - -
- $setmap{prefix,title,S} - $setmap{prefix,link,XLINK} - $set{thousand,$.}$set{decimal,.}$setmap{BN,,Any Country,uk,England,fr,France} - ${ - $def{PREV, - $if{$ne{$topdoc,0},, - } - ->>>>>> 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 7bca48f5ce8233cada3a4d87a4c93c1fed8aae80 Mon Sep 17 00:00:00 2001 From: "https://launchpad.net/~ojwb" Date: Sun, 14 Mar 2010 04:56:13 +0000 Subject: --- doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn b/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn index 9eac8eae5..189ba740f 100644 --- a/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn +++ b/doc/bugs/Exception:_Unknown_function___96__this__39___.mdwn @@ -57,4 +57,14 @@ What might be causing this exception and how I might go about debugging exceptio >>>>>>> misunderstanding. I've put in a complete fix for this problem. >>>>>>> if this was in [[bugs]], I'd close it. :) --[[Joey]] +>>>>>>>> Rather than escaping `$` as an HTML entity, it would be more natural +>>>>>>>> to escape it as `$$` (since you are escaping it for Omega, not for +>>>>>>>> the web browser. +>>>>>>>> +>>>>>>>> Also if ikiwiki can put arbitrary text inside the parameters of an +>>>>>>>> OmegaScript command, you should also escape `{`, `}` and `,` as +>>>>>>>> `$(`, `$)` and `$.`. It's only necessary to do so inside the +>>>>>>>> parameters of a command, but it will work and be easier to escape +>>>>>>>> them in any substituted text. --OllyBetts + [[done]] -- cgit v1.2.3 From a78212be3364887b5ff9f9902cfb65eb211b269b Mon Sep 17 00:00:00 2001 From: nil Date: Thu, 18 Mar 2010 07:21:09 +0000 Subject: --- .../post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..1594036dc --- /dev/null +++ b/doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn @@ -0,0 +1,14 @@ +Thinking that any c compiler would do the job, I tried to use tcc with ikiwiki, as explicitely allowed by the Debian package dependencies. + +I installed `tcc` and `libc6-dev` (for `libcrt1`). The wrapper compilation was OK, but the wrapper fails to run correctly and dies with + + usage: ikiwiki [options] source dest + ikiwiki --setup configfile + +Everything works fine with gcc. + +versions: Debian etch+backports + + + + -- cgit v1.2.3 From 7b7d1cfcb75451bf9f8fc7efb3814c47deef0059 Mon Sep 17 00:00:00 2001 From: nil Date: Thu, 18 Mar 2010 07:56:15 +0000 Subject: distro confusion --- doc/bugs/post-update_hook_can__39__t_be_compiled_with_tcc.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') 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 1594036dc..4226c026a 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 @@ -7,7 +7,7 @@ I installed `tcc` and `libc6-dev` (for `libcrt1`). The wrapper compilation was O Everything works fine with gcc. -versions: Debian etch+backports +versions: Debian lenny + backports -- 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 'doc/bugs') 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 4fd05df4d4cd64905c13ceb4c9d8821f4f26d0bc Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 24 Mar 2010 03:04:16 +0000 Subject: cross-reference --- ...ap_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn index de178d415..d12414d55 100644 --- a/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn +++ b/doc/bugs/map_sorts_by_pagename_and_not_title_when_show__61__title_is_used.mdwn @@ -16,3 +16,5 @@ The [[ikiwiki/directive/map]] directive sort by pagename. That looks kind of odd >> 2. I cannot get inline to create a list when the htmltidy plugin is switched on. I have a template which is enclosed in an li tag, and i put the ul tag around the inline manually, but htmltidy breaks this. --martin >>>> You might want to check if the [[plugins/contrib/report]] plugin solves your problem. It can sort by title, among other things. --[[KathrynAndersen]] + +>> See also: [[todo/sort_parameter_for_map_plugin_and_directive]] --[[smcv]] -- cgit v1.2.3 From dc966032129e07b9a6002a97bc9e6b86c712b4d2 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 25 Mar 2010 03:35:14 +0000 Subject: bug and fix --- doc/bugs/filecheck_failing_to_find_files.mdwn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/bugs/filecheck_failing_to_find_files.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn new file mode 100644 index 000000000..95ea5c763 --- /dev/null +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -0,0 +1,23 @@ +Using the attachment plugin, when filecheck was checking the mime-type of the attachment before allowing the attachment to be removed, it was returning with an error saying that the mime-type of the file was "unknown" (when the mime-type definitely was known!) + +It turns out that the filecheck plugin couldn't find the file, because it was merely using the $pagesources hash, rather than finding the absolute path of the file in question. + +The following patch fixes the problem: + + diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm + index 01d4909..1cec0cf 100644 + --- a/IkiWiki/Plugin/filecheck.pm + +++ b/IkiWiki/Plugin/filecheck.pm + @@ -118,6 +118,10 @@ sub match_mimetype ($$;@) { + if (! defined $file) { + return IkiWiki::ErrorReason->new("no file specified"); + } + + if (! -e $file) { + + # get the absolute path of the file if you can't find it + + $file = IkiWiki::srcfile($file); + + } + + # Use ::magic to get the mime type, the idea is to only trust + # data obtained by examining the actual file contents. + +[[!tag patch]] -- cgit v1.2.3 From c757cfa64f56fc17b2c3e4b2c36279f3fcf0f812 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 25 Mar 2010 03:38:14 +0000 Subject: I'm not sure if I'm supposed to tag this as patch, so I removed the tag. --- doc/bugs/filecheck_failing_to_find_files.mdwn | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index 95ea5c763..49de3d435 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -19,5 +19,3 @@ The following patch fixes the problem: # Use ::magic to get the mime type, the idea is to only trust # data obtained by examining the actual file contents. - -[[!tag patch]] -- cgit v1.2.3 From 1030d23a2ca1be2680a6fac8366f880a1d1760c6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Mar 2010 00:11:39 -0400 Subject: response --- doc/bugs/filecheck_failing_to_find_files.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index 49de3d435..e41793ee8 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -2,6 +2,9 @@ Using the attachment plugin, when filecheck was checking the mime-type of the at It turns out that the filecheck plugin couldn't find the file, because it was merely using the $pagesources hash, rather than finding the absolute path of the file in question. +> I don't understand why the file was not in `%pagesources`. Do you? +> --[[Joey]] + The following patch fixes the problem: diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm -- cgit v1.2.3 From 46f8f72793e23b56d3deb1ed0ed6b1a0fbd56ad6 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 25 Mar 2010 04:43:16 +0000 Subject: response --- doc/bugs/filecheck_failing_to_find_files.mdwn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index e41793ee8..be6cdbb20 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -3,7 +3,12 @@ Using the attachment plugin, when filecheck was checking the mime-type of the at It turns out that the filecheck plugin couldn't find the file, because it was merely using the $pagesources hash, rather than finding the absolute path of the file in question. > I don't understand why the file was not in `%pagesources`. Do you? -> --[[Joey]] +> --[[Joey]] + +>> The file *was* in `%pagesources`, but what returns from that is the filename relative to the `srcdir` directory; for example, `foo/bar.gif`. +>> When File::MimeInfo::Magic::magic is given that, it can't find the file. +>> 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]] The following patch fixes the problem: -- 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 'doc/bugs') 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 b68aa11732a1782886793e426f06652656c155cb Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 26 Mar 2010 01:40:32 +0000 Subject: oh dear not fixed after all --- doc/bugs/filecheck_failing_to_find_files.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index e896f2129..33975f05c 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -13,7 +13,13 @@ It turns out that the filecheck plugin couldn't find the file, because it was me >>> 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]] +>>> filecheck have the problem. --[[Joey]] + +>>>> Alas, not fixed. It seems I was mistaken in some of my assumptions. +>>>> It still happens when attempting to remove attachments. +>>>> With your fix, the `IkiWiki::srcfile` function is only called when the filename is not passed in, but it appears that in the case of removing attachments, the filename IS passed in, but it is the relative filename as mentioned above. Thus, the file is still not found, and the mime-type comes back as unknown. +>>>> The reason my patch worked is because, rather than checking whether a filename was passed in before applying IkiWiki::srcfile to the filename, it checks whether the file can be found, and if it cannot be found, then it applies IkiWiki::srcfile to the filename. +>>>> --[[KathrynAndersen]] The following patch fixes the problem: -- cgit v1.2.3 From fb39dc5f5f3e0dc4b5006b2cf7c85ce0e895ebfa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Mar 2010 23:40:38 -0400 Subject: patch --- doc/bugs/filecheck_failing_to_find_files.mdwn | 53 +++++++++++++++++++-------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index 33975f05c..3209c8f53 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -21,20 +21,41 @@ It turns out that the filecheck plugin couldn't find the file, because it was me >>>> The reason my patch worked is because, rather than checking whether a filename was passed in before applying IkiWiki::srcfile to the filename, it checks whether the file can be found, and if it cannot be found, then it applies IkiWiki::srcfile to the filename. >>>> --[[KathrynAndersen]] -The following patch fixes the problem: +>>>>> Can you test if this patch fixes that? --[[Joey]] - diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm - index 01d4909..1cec0cf 100644 - --- a/IkiWiki/Plugin/filecheck.pm - +++ b/IkiWiki/Plugin/filecheck.pm - @@ -118,6 +118,10 @@ sub match_mimetype ($$;@) { - if (! defined $file) { - return IkiWiki::ErrorReason->new("no file specified"); - } - + if (! -e $file) { - + # get the absolute path of the file if you can't find it - + $file = IkiWiki::srcfile($file); - + } - - # Use ::magic to get the mime type, the idea is to only trust - # data obtained by examining the actual file contents. +
+diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
+index f59d026..0fc180f 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 3908443..1a9da63 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");
+ 		}
+ 	}
+
-- cgit v1.2.3 From 62306d85f998b5bbd64d213e8c591809dbc07cb8 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 26 Mar 2010 04:06:31 +0000 Subject: It works! --- doc/bugs/filecheck_failing_to_find_files.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index 3209c8f53..f8d8e83e6 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -21,7 +21,9 @@ It turns out that the filecheck plugin couldn't find the file, because it was me >>>> The reason my patch worked is because, rather than checking whether a filename was passed in before applying IkiWiki::srcfile to the filename, it checks whether the file can be found, and if it cannot be found, then it applies IkiWiki::srcfile to the filename. >>>> --[[KathrynAndersen]] ->>>>> Can you test if this patch fixes that? --[[Joey]] +>>>>> Can you test if this patch fixes that? --[[Joey]] + +>>>>>> Yes, it works! --[[KathrynAndersen]]
 diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
-- 
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 'doc/bugs')

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 1093c7e4b2ec5f3b4052ed5c1b5530560864a920 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 26 Mar 2010 00:57:46 -0400
Subject: new bug

---
 doc/bugs/depends_simple_mixup.mdwn | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 doc/bugs/depends_simple_mixup.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn
new file mode 100644
index 000000000..506bef904
--- /dev/null
+++ b/doc/bugs/depends_simple_mixup.mdwn
@@ -0,0 +1,18 @@
+The [[bugs]] page, at least before I commit this, has a bug at the top that
+has been modified to link to done, and ikiwiki's dependency calculations
+failed to notice and update the bugs page. Looking at the indexdb, I saw
+that the page was not included in the `depends_simple` of the bugs page. 
+
+I was able to replicate the problem locally by starting off with the page
+not marked done (when it did appear in the bugs page `depends_simple`
+(appropriatly as a link dependency, since a change to the page removing the
+link would make it match)), then removing the done link. 
+
+At that point, it vanished from `depends_simple`. Presumably because
+the main (pagespec) depends for the bugs page now matched it, as a content
+dependency. But, it seems to me it should still be listed in
+`depends_simple` here. This, I think, is the cause of the bug.
+
+Then re-add the done link, and the dependency calc code breaks down,
+not noticing that bugs dependeded on the page and needs to be updated.
+--[[Joey]]
-- 
cgit v1.2.3


From 4cb464d6e52344b8a0dfd29e82ede78aef1385d3 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 26 Mar 2010 01:05:22 -0400
Subject: typo

---
 doc/bugs/depends_simple_mixup.mdwn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'doc/bugs')

diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn
index 506bef904..c2845240d 100644
--- a/doc/bugs/depends_simple_mixup.mdwn
+++ b/doc/bugs/depends_simple_mixup.mdwn
@@ -4,7 +4,7 @@ failed to notice and update the bugs page. Looking at the indexdb, I saw
 that the page was not included in the `depends_simple` of the bugs page. 
 
 I was able to replicate the problem locally by starting off with the page
-not marked done (when it did appear in the bugs page `depends_simple`
+marked done (when it did appear in the bugs page `depends_simple`
 (appropriatly as a link dependency, since a change to the page removing the
 link would make it match)), then removing the done link. 
 
-- 
cgit v1.2.3


From 0d524ad672333fd0bafa64e81e261fd297c25580 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 26 Mar 2010 01:38:53 -0400
Subject: Fix incorrect influence info returned by a failing link() pagespec,
 that could lead to bad dependency handling in certian situations.

---
 IkiWiki.pm                         | 4 ++--
 debian/changelog                   | 2 ++
 doc/bugs/depends_simple_mixup.mdwn | 5 +++++
 t/pagespec_match.t                 | 8 +++++++-
 4 files changed, 16 insertions(+), 3 deletions(-)

(limited to 'doc/bugs')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 022bfe3bd..927d62940 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2215,7 +2215,7 @@ sub match_link ($$;@) {
 	my $from=exists $params{location} ? $params{location} : '';
 
 	my $links = $IkiWiki::links{$page};
-	return IkiWiki::FailReason->new("$page has no links", "" => 1)
+	return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
 		unless $links && @{$links};
 	my $bestlink = IkiWiki::bestlink($from, $link);
 	foreach my $p (@{$links}) {
@@ -2232,7 +2232,7 @@ sub match_link ($$;@) {
 				if match_glob($p_rel, $link, %params);
 		}
 	}
-	return IkiWiki::FailReason->new("$page does not link to $link", "" => 1);
+	return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1);
 }
 
 sub match_backlink ($$;@) {
diff --git a/debian/changelog b/debian/changelog
index da1ab890e..b9a105552 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low
   * Add --set-yaml switch for setting more complex config file options.
   * filecheck: Fix bugs that prevented the pagespecs from matching when
     not called by attachment plugin.
+  * Fix incorrect influence info returned by a failing link() pagespec,
+    that could lead to bad dependency handling in certian situations.
 
  -- Joey Hess   Sat, 13 Mar 2010 14:48:10 -0500
 
diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn
index c2845240d..2603ff04c 100644
--- a/doc/bugs/depends_simple_mixup.mdwn
+++ b/doc/bugs/depends_simple_mixup.mdwn
@@ -15,4 +15,9 @@ dependency. But, it seems to me it should still be listed in
 
 Then re-add the done link, and the dependency calc code breaks down,
 not noticing that bugs dependeded on the page and needs to be updated.
+
+Ok.. Turns out this was not a problem with the actual influences
+calculation or dependency calculation code. Whew! `match_link`
+just didn't set the influence correctly when failing. [[fixed|done]]
+
 --[[Joey]]
diff --git a/t/pagespec_match.t b/t/pagespec_match.t
index 8b0be4e8a..ade9bca5a 100755
--- a/t/pagespec_match.t
+++ b/t/pagespec_match.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 72;
+use Test::More tests => 75;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -54,6 +54,7 @@ $config{userdir}="";
 $links{foo}=[qw{bar baz}];
 $links{bar}=[];
 $links{baz}=[];
+$links{meh}=[];
 $links{"bugs/foo"}=[qw{bugs/done}];
 $links{"bugs/done"}=[];
 $links{"bugs/bar"}=[qw{done}];
@@ -82,6 +83,7 @@ ok(! pagespec_match("bar", ""), "empty pagespec should match nothing");
 ok(! pagespec_match("bar", "    	"), "blank pagespec should match nothing");
 ok(pagespec_match("ook", "link(blog/tags/foo)"), "link internal absolute success");
 ok(pagespec_match("ook", "link(/blog/tags/foo)"), "link explicit absolute success");
+ok(pagespec_match("meh", "!link(done)"), "negated failing match is a success");
 
 $IkiWiki::pagectime{foo}=1154532692; # Wed Aug  2 11:26 EDT 2006
 $IkiWiki::pagectime{bar}=1154532695; # after
@@ -122,3 +124,7 @@ $i=pagespec_match("foo", "link(baz) and created_after(bar)")->influences;
 is(join(",", sort keys %$i), 'bar,foo', "influences add up over OR");
 $i=pagespec_match("foo", "!link(baz) and !created_after(bar)")->influences;
 is(join(",", sort keys %$i), 'bar,foo', "influences unaffected by negation");
+$i=pagespec_match("foo", "!link(baz) and !created_after(bar)")->influences;
+is(join(",", sort keys %$i), 'bar,foo', "influences unaffected by negation");
+$i=pagespec_match("meh", "!link(done)")->influences;
+is(join(",", sort keys %$i), 'meh', "a negated, failing link test is successful, so the page is a link influence");
-- 
cgit v1.2.3


From 0dec80ee0cb9a2ac9dd4287645d02e5a216f2d0b Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 26 Mar 2010 01:48:37 -0400
Subject: close, unreproducible

---
 ...n_recentchange_entry_for_a_change_removing_an_invalid_pagespec.mdwn | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/barfs_on_recentchange_entry_for_a_change_removing_an_invalid_pagespec.mdwn b/doc/bugs/barfs_on_recentchange_entry_for_a_change_removing_an_invalid_pagespec.mdwn
index 42e6b9e27..c3cbff43e 100644
--- a/doc/bugs/barfs_on_recentchange_entry_for_a_change_removing_an_invalid_pagespec.mdwn
+++ b/doc/bugs/barfs_on_recentchange_entry_for_a_change_removing_an_invalid_pagespec.mdwn
@@ -39,3 +39,6 @@ a year ago in September 2007.
 > ikiwiki. (Doesn't quite seem to be version 2.53.x either) Try with a current
 > version, and see if you can send me a source tree that can reproduce the
 > problem? --[[Joey]]
+
+Did not hear back, so calling this [[done]], unless I hear differently.
+--[[Joey]]
-- 
cgit v1.2.3


From 22b9582cddfcb0ee073c99f8867537f67d79fc38 Mon Sep 17 00:00:00 2001
From: "http://users.itk.ppke.hu/~cstamas/openid/"
 
Date: Fri, 26 Mar 2010 08:57:20 +0000
Subject: init page bugreport

---
 ...-transition_does_not_set_perl_moduels_path_properly.mdwn | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
new file mode 100644
index 000000000..7f8045164
--- /dev/null
+++ b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
@@ -0,0 +1,13 @@
+When installing ikiwiki the perl module path is setup correctly
+
+    use lib '/usr/local/ikiwiki-3.20100312/share/perl/5.10.0';
+
+This is not true for ikiwiki-transition:
+
+    $ PATH=/usr/local/ikiwiki-3.20100312/bin ikiwiki-transition prefix_directives ikiwiki.setup
+    Can't locate IkiWiki.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/ikiwiki-3.20100312/bin/ikiwiki-transition line 4.
+    BEGIN failed--compilation aborted at /usr/local/ikiwiki-3.20100312/bin/ikiwiki-transition line 4.
+
+The missing line should be added.
+
+Thanks!
-- 
cgit v1.2.3


From 99b402cd622d38cb8337498d8fdb4f135e8be03c Mon Sep 17 00:00:00 2001
From: "http://users.itk.ppke.hu/~cstamas/openid/"
 
Date: Fri, 26 Mar 2010 08:58:41 +0000
Subject: line break for better view

---
 .../ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'doc/bugs')

diff --git a/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
index 7f8045164..5dd4bc780 100644
--- a/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
+++ b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
@@ -5,7 +5,9 @@ When installing ikiwiki the perl module path is setup correctly
 This is not true for ikiwiki-transition:
 
     $ PATH=/usr/local/ikiwiki-3.20100312/bin ikiwiki-transition prefix_directives ikiwiki.setup
-    Can't locate IkiWiki.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/ikiwiki-3.20100312/bin/ikiwiki-transition line 4.
+    Can't locate IkiWiki.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0
+     /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .)
+     at /usr/local/ikiwiki-3.20100312/bin/ikiwiki-transition line 4.
     BEGIN failed--compilation aborted at /usr/local/ikiwiki-3.20100312/bin/ikiwiki-transition line 4.
 
 The missing line should be added.
-- 
cgit v1.2.3


From d29419ab0bd181beda6971bf622c3ba8bdd2fd8c Mon Sep 17 00:00:00 2001
From: "http://users.itk.ppke.hu/~cstamas/openid/"
 
Date: Fri, 26 Mar 2010 09:43:50 +0000
Subject: me too - thanks

---
 doc/bugs/Error:_Your_login_session_has_expired._.mdwn | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Error:_Your_login_session_has_expired._.mdwn b/doc/bugs/Error:_Your_login_session_has_expired._.mdwn
index 046d6e10d..b993cd8e7 100644
--- a/doc/bugs/Error:_Your_login_session_has_expired._.mdwn
+++ b/doc/bugs/Error:_Your_login_session_has_expired._.mdwn
@@ -41,4 +41,6 @@ Whilst trying to edit http://hugh.vm.bytemark.co.uk/ikiwiki.cgi via OpenID. Any
 
 Thanks for you excellent analysis. The bug was due to old pre-3.0 **templates** laying about. After deleting them, ikiwiki defaults to its own templates. Clever. :-)
 
+Great, this saved me big time! It is a google 1st hit. I had the same with accidentally using old templates. Thanks! --[[cstamas]]
+
 [[bugs/done]]
-- 
cgit v1.2.3


From 1273f1de52998cf54afb3445fd8c616bce53e698 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Fri, 26 Mar 2010 13:11:02 -0400
Subject: Add preprocessed 'use lib' line to ikiwiki-transition and
 ikiwiki-calendar if necessary for unusual install.

---
 .gitignore                                         |   3 +-
 Makefile.PL                                        |  16 +-
 debian/changelog                                   |   2 +
 ...on_does_not_set_perl_moduels_path_properly.mdwn |   2 +
 ikiwiki-calendar                                   |  57 ----
 ikiwiki-calendar.in                                |  58 ++++
 ikiwiki-transition                                 | 348 --------------------
 ikiwiki-transition.in                              | 349 +++++++++++++++++++++
 ikiwiki.spec                                       |   2 +-
 9 files changed, 423 insertions(+), 414 deletions(-)
 delete mode 100755 ikiwiki-calendar
 create mode 100755 ikiwiki-calendar.in
 delete mode 100755 ikiwiki-transition
 create mode 100755 ikiwiki-transition.in

(limited to 'doc/bugs')

diff --git a/.gitignore b/.gitignore
index 8de36e2c8..e9ab152b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,9 +5,10 @@ blib/*
 doc/.ikiwiki/*
 html/*
 ikiwiki.out
+ikiwiki-transition.out
+ikiwiki-calendar.out
 pm_to_blib
 *.man
-build-stamp
 po/po2wiki_stamp
 po/underlays/*/*.mdwn
 po/underlays/basewiki/*/*.mdwn
diff --git a/Makefile.PL b/Makefile.PL
index 52421a711..5a9028b51 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -28,15 +28,16 @@ W3M_CGI_BIN?=$(PREFIX)/lib/w3m/cgi-bin
 
 tflag=$(shell if [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; then printf -- "-T"; fi)
 extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:NYTProf"; fi)
+outprogs=ikiwiki.out ikiwiki-transition.out ikiwiki-calendar.out
 
-ikiwiki.out: ikiwiki.in
-	./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
-	chmod +x ikiwiki.out
+%.out: %.in
+	./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < $< > $@
+	chmod +x $@
 
 ikiwiki.setup: ikiwiki.out
 	HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup
 
-extra_build: ikiwiki.out ikiwiki.setup docwiki
+extra_build: $(outprogs) ikiwiki.setup docwiki
 	./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
 	./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
 	./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
@@ -52,7 +53,7 @@ docwiki: ikiwiki.out
 
 extra_clean:
 	$(PERL) -I. $(extramodules) $(tflag) ikiwiki.in -libdir . -setup docwiki.setup -clean
-	rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc
+	rm -f *.man $(outprogs) ikiwiki.setup plugins/*.pyc
 	$(MAKE) -C po clean
 
 underlay_install:
@@ -115,8 +116,9 @@ extra_install: underlay_install
 	install ikiwiki-w3m.cgi $(DESTDIR)$(W3M_CGI_BIN)
 
 	install -d $(DESTDIR)$(PREFIX)/bin
-	install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
-	install ikiwiki-makerepo ikiwiki-transition ikiwiki-update-wikilist ikiwiki-calendar $(DESTDIR)$(PREFIX)/bin/
+	for prog in $(outprogs); do \
+		install $$prog $(DESTDIR)$(PREFIX)/bin/$$(shell echo $$prog | sed 's/\.out//'); \
+	done
 
 	$(MAKE) -C po install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
 	
diff --git a/debian/changelog b/debian/changelog
index b9a105552..57406c6d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low
     not called by attachment plugin.
   * Fix incorrect influence info returned by a failing link() pagespec,
     that could lead to bad dependency handling in certian situations.
+  * Add preprocessed 'use lib' line to ikiwiki-transition and ikiwiki-calendar
+    if necessary for unusual install.
 
  -- Joey Hess   Sat, 13 Mar 2010 14:48:10 -0500
 
diff --git a/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
index 5dd4bc780..b3e87b529 100644
--- a/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
+++ b/doc/bugs/ikiwiki-transition_does_not_set_perl_moduels_path_properly.mdwn
@@ -13,3 +13,5 @@ This is not true for ikiwiki-transition:
 The missing line should be added.
 
 Thanks!
+
+[[done]] --[[Joey]] 
diff --git a/ikiwiki-calendar b/ikiwiki-calendar
deleted file mode 100755
index a9548d6ec..000000000
--- a/ikiwiki-calendar
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use IkiWiki;
-use IkiWiki::Setup;
-use Getopt::Long;
-
-sub usage () {
-	die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [year]"), "\n";
-}
-
-my $force=0;
-GetOptions(
-	"force" => \$force,
-) || usage();
-my $setup=shift		|| usage();
-my $pagespec=shift	|| "*";
-my $startyear=shift	|| 1900+(localtime(time))[5];
-my $endyear=shift	|| $startyear;
-
-%config=IkiWiki::defaultconfig();
-IkiWiki::Setup::load($setup);
-IkiWiki::loadplugins();
-IkiWiki::checkconfig();
-
-my $archivebase = 'archives';
-$archivebase = $config{archivebase} if defined $config{archivebase};
-
-sub writearchive ($$;$) {
-	my $template=template(shift);
-	my $year=shift;
-	my $month=shift;
-
-	my $page=defined $month ? "$year/$month" : $year;
-
-	my $pagefile=newpagefile("$archivebase/$page", $config{default_pageext});
-	$template->param(pagespec => $pagespec);
-	$template->param(year => $year);
-	$template->param(month => $month) if defined $month;
-
-	if ($force || ! -e "$config{srcdir}/$pagefile") {
-		writefile($pagefile, $config{srcdir}, $template->output);
-		IkiWiki::rcs_add($pagefile) if $config{rcs};
-	}
-}
-
-foreach my $y ($startyear..$endyear) {
-	writearchive("calendaryear.tmpl", $y);
-	foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) {
-		writearchive("calendarmonth.tmpl", $y, $m);
-	}
-}
-
-IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef)
-	if $config{rcs};
-
-system("ikiwiki", "-setup", $setup, "-refresh");
diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in
new file mode 100755
index 000000000..9738ea5f7
--- /dev/null
+++ b/ikiwiki-calendar.in
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use IkiWiki;
+use IkiWiki::Setup;
+use Getopt::Long;
+
+sub usage () {
+	die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [year]"), "\n";
+}
+
+my $force=0;
+GetOptions(
+	"force" => \$force,
+) || usage();
+my $setup=shift		|| usage();
+my $pagespec=shift	|| "*";
+my $startyear=shift	|| 1900+(localtime(time))[5];
+my $endyear=shift	|| $startyear;
+
+%config=IkiWiki::defaultconfig();
+IkiWiki::Setup::load($setup);
+IkiWiki::loadplugins();
+IkiWiki::checkconfig();
+
+my $archivebase = 'archives';
+$archivebase = $config{archivebase} if defined $config{archivebase};
+
+sub writearchive ($$;$) {
+	my $template=template(shift);
+	my $year=shift;
+	my $month=shift;
+
+	my $page=defined $month ? "$year/$month" : $year;
+
+	my $pagefile=newpagefile("$archivebase/$page", $config{default_pageext});
+	$template->param(pagespec => $pagespec);
+	$template->param(year => $year);
+	$template->param(month => $month) if defined $month;
+
+	if ($force || ! -e "$config{srcdir}/$pagefile") {
+		writefile($pagefile, $config{srcdir}, $template->output);
+		IkiWiki::rcs_add($pagefile) if $config{rcs};
+	}
+}
+
+foreach my $y ($startyear..$endyear) {
+	writearchive("calendaryear.tmpl", $y);
+	foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) {
+		writearchive("calendarmonth.tmpl", $y, $m);
+	}
+}
+
+IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef)
+	if $config{rcs};
+
+system("ikiwiki", "-setup", $setup, "-refresh");
diff --git a/ikiwiki-transition b/ikiwiki-transition
deleted file mode 100755
index 1bebb1176..000000000
--- a/ikiwiki-transition
+++ /dev/null
@@ -1,348 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use IkiWiki;
-use HTML::Entities;
-
-my $regex = qr{
-	(\\?)		# 1: escape?
-	\[\[(!?)	# directive open; 2: optional prefix
-	([-\w]+)	# 3: command
-	(		# 4: the parameters (including initial whitespace)
-	\s+
-		(?:
-			(?:[-\w]+=)?		# named parameter key?
-			(?:
-				""".*?"""	# triple-quoted value
-				|
-				"[^"]+"		# single-quoted value
-				|
-				[^\s\]]+	# unquoted value
-			)
-			\s*			# whitespace or end
-						# of directive
-		)
-	*)		# 0 or more parameters
-	\]\]		# directive closed
-}sx;
-
-sub handle_directive {
-	my $escape = shift;
-	my $prefix = shift;
-	my $directive = shift;
-	my $args = shift;
-
-	if (length $escape) {
-		return "${escape}[[${prefix}${directive}${args}]]"
-	}
-	if ($directive =~ m/^(if|more|table|template|toggleable)$/) {
-		$args =~ s{$regex}{handle_directive($1, $2, $3, $4)}eg;
-	}
-	return "[[!${directive}${args}]]"
-}
-
-sub prefix_directives {
-	loadsetup(shift);
-
-	IkiWiki::loadplugins();
-	IkiWiki::checkconfig();
-	IkiWiki::loadindex();
-
-	if (! %pagesources) {
-		error "ikiwiki has not built this wiki yet, cannot transition";
-	}
-
-	foreach my $page (values %pagesources) {
-		next unless defined pagetype($page) &&
-		            -f $config{srcdir}."/".$page;
-		my $content=readfile($config{srcdir}."/".$page);
-		my $oldcontent=$content;
-		$content=~s{$regex}{handle_directive($1, $2, $3, $4)}eg;
-		if ($oldcontent ne $content) {
-			writefile($page, $config{srcdir}, $content);
-		}
-	}
-}
-
-sub indexdb {
-	setstatedir(shift);
-
-	# Note: No lockwiki here because ikiwiki already locks it
-	# before calling this.	
-	if (! IkiWiki::oldloadindex()) {
-		die "failed to load index\n";
-	}
-	if (! IkiWiki::saveindex()) {
-		die "failed to save indexdb\n"
-	}
-	if (! IkiWiki::loadindex()) {
-		die "transition failed, cannot load new indexdb\n";
-	}
-	if (! unlink("$config{wikistatedir}/index")) {
-		die "unlink failed: $!\n";
-	}
-}
-
-sub hashpassword {
-	setstatedir(shift);
-
-	eval q{use IkiWiki::UserInfo};
-	eval q{use Authen::Passphrase::BlowfishCrypt};
-	if ($@) {
-		error("ikiwiki-transition hashpassword: failed to load Authen::Passphrase, passwords not hashed");
-	}
-
-	IkiWiki::lockwiki();
-	IkiWiki::loadplugin("passwordauth");
-	my $userinfo = IkiWiki::userinfo_retrieve();
-	foreach my $user (keys %{$userinfo}) {
-		if (ref $userinfo->{$user} &&
-		    exists $userinfo->{$user}->{password} &&
-		    length $userinfo->{$user}->{password} &&
-		    ! exists $userinfo->{$user}->{cryptpassword}) {
-			IkiWiki::Plugin::passwordauth::setpassword($user, $userinfo->{$user}->{password});
-		}
-	}
-}
-
-sub aggregateinternal {
-	loadsetup(shift);
-	require IkiWiki::Plugin::aggregate;
-	IkiWiki::checkconfig();
-	IkiWiki::Plugin::aggregate::migrate_to_internal();
-}
-
-sub setupformat {
-	my $setup=shift;
-
-	loadsetup($setup);
-	IkiWiki::checkconfig();
-	
-	# unpack old-format wrappers setting into new fields
-	my $cgi_seen=0;
-	my $rcs_seen=0;
-	foreach my $wrapper (@{$config{wrappers}}) {
-		if ($wrapper->{cgi}) {
-			if ($cgi_seen) {
-				die "don't know what to do with second cgi wrapper ".$wrapper->{wrapper}."\n";
-			}
-			$cgi_seen++;
-			print "setting cgi_wrapper to ".$wrapper->{wrapper}."\n";
-			$config{cgi_wrapper}=$wrapper->{wrapper};
-			$config{cgi_wrappermode}=$wrapper->{wrappermode}
-				if exists $wrapper->{wrappermode};
-		}
-		elsif ($config{rcs}) {
-			if ($rcs_seen) {
-				die "don't know what to do with second rcs wrapper ".$wrapper->{wrapper}."\n";
-			}
-			$rcs_seen++;
-			print "setting $config{rcs}_wrapper to ".$wrapper->{wrapper}."\n";
-			$config{$config{rcs}."_wrapper"}=$wrapper->{wrapper};
-			$config{$config{rcs}."_wrappermode"}=$wrapper->{wrappermode}
-				if exists $wrapper->{wrappermode};
-		}
-		else {
-			die "don't know what to do with wrapper ".$wrapper->{wrapper}."\n";
-		}
-	}
-
-	IkiWiki::Setup::dump($setup);
-}
-
-sub moveprefs {
-	my $setup=shift;
-
-	loadsetup($setup);
-	IkiWiki::checkconfig();
-
-	eval q{use IkiWiki::UserInfo};
-	error $@ if $@;
-
-	foreach my $field (qw{allowed_attachments locked_pages}) {
-		my $orig=$config{$field};
-		foreach my $admin (@{$config{adminuser}}) {
-			my $a=IkiWiki::userinfo_get($admin, $field);
-			if (defined $a && length $a &&
-			    # might already have been moved
-			    (! defined $orig || $a ne $orig)) {
-			    	if (defined $config{$field} &&
-				    length $config{$field}) {
-					$config{$field}=IkiWiki::pagespec_merge($config{$field}, $a);
-				}
-				else {
-					$config{$field}=$a;
-				}
-			}
-		}
-	}
-
-	my %banned=map { $_ => 1 } @{$config{banned_users}}, IkiWiki::get_banned_users();
-	$config{banned_users}=[sort keys %banned];
-
-	IkiWiki::Setup::dump($setup);
-}
-
-sub deduplinks {
-	loadsetup(shift);
-	IkiWiki::loadplugins();
-	IkiWiki::checkconfig();
-	IkiWiki::loadindex();
-	foreach my $page (keys %links) {
-		my %l;
-		$l{$_}=1 foreach @{$links{$page}};
-		$links{$page}=[keys %l]
-	}
-	IkiWiki::saveindex();
-}
-
-sub setstatedir {
-	my $dirorsetup=shift;
-
-	if (! defined $dirorsetup) {
-		usage();		
-	}
-
-	if (-d $dirorsetup) {
-		$config{wikistatedir}=$dirorsetup."/.ikiwiki";
-	}
-	elsif (-f $dirorsetup) {
-		loadsetup($dirorsetup);
-	}
-	else {
-		error("ikiwiki-transition: $dirorsetup does not exist");
-	}
-
-	if (! -d $config{wikistatedir}) {
-		error("ikiwiki-transition: $config{wikistatedir} does not exist");
-	}
-}
-	
-sub loadsetup {
-	my $setup=shift;
-	if (! defined $setup) {
-		usage();
-	}
-
-	require IkiWiki::Setup;
-
-	%config = IkiWiki::defaultconfig();
-	IkiWiki::Setup::load($setup);
-}
-
-sub usage {
-	print STDERR "Usage: ikiwiki-transition type ...\n";
-	print STDERR "Currently supported transition subcommands:\n";
-	print STDERR "\tprefix_directives setupfile ...\n";
-	print STDERR "\taggregateinternal setupfile\n";
-	print STDERR "\tsetupformat setupfile\n";
-	print STDERR "\tmoveprefs setupfile\n";
-	print STDERR "\thashpassword setupfile|srcdir\n";
-	print STDERR "\tindexdb setupfile|srcdir\n";
-	print STDERR "\tdeduplinks setupfile\n";
-	exit 1;
-}
-
-usage() unless @ARGV;
-
-my $mode=shift;
-if ($mode eq 'prefix_directives') {
-	prefix_directives(@ARGV);
-}
-elsif ($mode eq 'hashpassword') {
-	hashpassword(@ARGV);
-}
-elsif ($mode eq 'indexdb') {
-	indexdb(@ARGV);
-}
-elsif ($mode eq 'aggregateinternal') {
-	aggregateinternal(@ARGV);
-}
-elsif ($mode eq 'setupformat') {
-	setupformat(@ARGV);
-}
-elsif ($mode eq 'moveprefs') {
-	moveprefs(@ARGV);
-}
-elsif ($mode eq 'deduplinks') {
-	deduplinks(@ARGV);
-}
-else {
-	usage();
-}
-
-package IkiWiki;
-
-# A slightly modified version of the old loadindex function.
-sub oldloadindex {
-	%oldrenderedfiles=%pagectime=();
-	if (! $config{rebuild}) {
-		%pagesources=%pagemtime=%oldlinks=%links=%depends=
-			%destsources=%renderedfiles=%pagecase=%pagestate=();
-	}
-	open (my $in, "<", "$config{wikistatedir}/index") || return;
-	while (<$in>) {
-		chomp;
-		my %items;
-		$items{link}=[];
-		$items{dest}=[];
-		foreach my $i (split(/ /, $_)) {
-			my ($item, $val)=split(/=/, $i, 2);
-			push @{$items{$item}}, decode_entities($val);
-		}
-
-		next unless exists $items{src}; # skip bad lines for now
-
-		my $page=pagename($items{src}[0]);
-		if (! $config{rebuild}) {
-			$pagesources{$page}=$items{src}[0];
-			$pagemtime{$page}=$items{mtime}[0];
-			$oldlinks{$page}=[@{$items{link}}];
-			$links{$page}=[@{$items{link}}];
-			$depends{$page}={ $items{depends}[0] => $IkiWiki::DEPEND_CONTENT } if exists $items{depends};
-			$destsources{$_}=$page foreach @{$items{dest}};
-			$renderedfiles{$page}=[@{$items{dest}}];
-			$pagecase{lc $page}=$page;
-			foreach my $k (grep /_/, keys %items) {
-				my ($id, $key)=split(/_/, $k, 2);
-				$pagestate{$page}{decode_entities($id)}{decode_entities($key)}=$items{$k}[0];
-			}
-		}
-		$oldrenderedfiles{$page}=[@{$items{dest}}];
-		$pagectime{$page}=$items{ctime}[0];
-	}
-
-	# saveindex relies on %hooks being populated, else it won't save
-	# the page state owned by a given hook. But no plugins are loaded
-	# by this program, so populate %hooks with all hook ids that
-	# currently have page state.
-	foreach my $page (keys %pagemtime) {
-		foreach my $id (keys %{$pagestate{$page}}) {
-			$hooks{_dummy}{$id}=1;
-		}
-	}
-	
-	return close($in);
-}
-
-# Used to be in IkiWiki/UserInfo, but only used here now.
-sub get_banned_users () {
-	my @ret;
-	my $userinfo=userinfo_retrieve();
-	foreach my $user (keys %{$userinfo}) {
-		push @ret, $user if $userinfo->{$user}->{banned};
-	}
-	return @ret;
-}
-
-# Used to be in IkiWiki, but only used here (to migrate admin prefs into the
-# setup file) now.
-sub pagespec_merge ($$) {
-	my $a=shift;
-	my $b=shift;
-
-	return $a if $a eq $b;
-	return "($a) or ($b)";
-}
-
-1
diff --git a/ikiwiki-transition.in b/ikiwiki-transition.in
new file mode 100755
index 000000000..e3be645cc
--- /dev/null
+++ b/ikiwiki-transition.in
@@ -0,0 +1,349 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use lib '.'; # For use in nonstandard directory, munged by Makefile.
+use IkiWiki;
+use HTML::Entities;
+
+my $regex = qr{
+	(\\?)		# 1: escape?
+	\[\[(!?)	# directive open; 2: optional prefix
+	([-\w]+)	# 3: command
+	(		# 4: the parameters (including initial whitespace)
+	\s+
+		(?:
+			(?:[-\w]+=)?		# named parameter key?
+			(?:
+				""".*?"""	# triple-quoted value
+				|
+				"[^"]+"		# single-quoted value
+				|
+				[^\s\]]+	# unquoted value
+			)
+			\s*			# whitespace or end
+						# of directive
+		)
+	*)		# 0 or more parameters
+	\]\]		# directive closed
+}sx;
+
+sub handle_directive {
+	my $escape = shift;
+	my $prefix = shift;
+	my $directive = shift;
+	my $args = shift;
+
+	if (length $escape) {
+		return "${escape}[[${prefix}${directive}${args}]]"
+	}
+	if ($directive =~ m/^(if|more|table|template|toggleable)$/) {
+		$args =~ s{$regex}{handle_directive($1, $2, $3, $4)}eg;
+	}
+	return "[[!${directive}${args}]]"
+}
+
+sub prefix_directives {
+	loadsetup(shift);
+
+	IkiWiki::loadplugins();
+	IkiWiki::checkconfig();
+	IkiWiki::loadindex();
+
+	if (! %pagesources) {
+		error "ikiwiki has not built this wiki yet, cannot transition";
+	}
+
+	foreach my $page (values %pagesources) {
+		next unless defined pagetype($page) &&
+		            -f $config{srcdir}."/".$page;
+		my $content=readfile($config{srcdir}."/".$page);
+		my $oldcontent=$content;
+		$content=~s{$regex}{handle_directive($1, $2, $3, $4)}eg;
+		if ($oldcontent ne $content) {
+			writefile($page, $config{srcdir}, $content);
+		}
+	}
+}
+
+sub indexdb {
+	setstatedir(shift);
+
+	# Note: No lockwiki here because ikiwiki already locks it
+	# before calling this.	
+	if (! IkiWiki::oldloadindex()) {
+		die "failed to load index\n";
+	}
+	if (! IkiWiki::saveindex()) {
+		die "failed to save indexdb\n"
+	}
+	if (! IkiWiki::loadindex()) {
+		die "transition failed, cannot load new indexdb\n";
+	}
+	if (! unlink("$config{wikistatedir}/index")) {
+		die "unlink failed: $!\n";
+	}
+}
+
+sub hashpassword {
+	setstatedir(shift);
+
+	eval q{use IkiWiki::UserInfo};
+	eval q{use Authen::Passphrase::BlowfishCrypt};
+	if ($@) {
+		error("ikiwiki-transition hashpassword: failed to load Authen::Passphrase, passwords not hashed");
+	}
+
+	IkiWiki::lockwiki();
+	IkiWiki::loadplugin("passwordauth");
+	my $userinfo = IkiWiki::userinfo_retrieve();
+	foreach my $user (keys %{$userinfo}) {
+		if (ref $userinfo->{$user} &&
+		    exists $userinfo->{$user}->{password} &&
+		    length $userinfo->{$user}->{password} &&
+		    ! exists $userinfo->{$user}->{cryptpassword}) {
+			IkiWiki::Plugin::passwordauth::setpassword($user, $userinfo->{$user}->{password});
+		}
+	}
+}
+
+sub aggregateinternal {
+	loadsetup(shift);
+	require IkiWiki::Plugin::aggregate;
+	IkiWiki::checkconfig();
+	IkiWiki::Plugin::aggregate::migrate_to_internal();
+}
+
+sub setupformat {
+	my $setup=shift;
+
+	loadsetup($setup);
+	IkiWiki::checkconfig();
+	
+	# unpack old-format wrappers setting into new fields
+	my $cgi_seen=0;
+	my $rcs_seen=0;
+	foreach my $wrapper (@{$config{wrappers}}) {
+		if ($wrapper->{cgi}) {
+			if ($cgi_seen) {
+				die "don't know what to do with second cgi wrapper ".$wrapper->{wrapper}."\n";
+			}
+			$cgi_seen++;
+			print "setting cgi_wrapper to ".$wrapper->{wrapper}."\n";
+			$config{cgi_wrapper}=$wrapper->{wrapper};
+			$config{cgi_wrappermode}=$wrapper->{wrappermode}
+				if exists $wrapper->{wrappermode};
+		}
+		elsif ($config{rcs}) {
+			if ($rcs_seen) {
+				die "don't know what to do with second rcs wrapper ".$wrapper->{wrapper}."\n";
+			}
+			$rcs_seen++;
+			print "setting $config{rcs}_wrapper to ".$wrapper->{wrapper}."\n";
+			$config{$config{rcs}."_wrapper"}=$wrapper->{wrapper};
+			$config{$config{rcs}."_wrappermode"}=$wrapper->{wrappermode}
+				if exists $wrapper->{wrappermode};
+		}
+		else {
+			die "don't know what to do with wrapper ".$wrapper->{wrapper}."\n";
+		}
+	}
+
+	IkiWiki::Setup::dump($setup);
+}
+
+sub moveprefs {
+	my $setup=shift;
+
+	loadsetup($setup);
+	IkiWiki::checkconfig();
+
+	eval q{use IkiWiki::UserInfo};
+	error $@ if $@;
+
+	foreach my $field (qw{allowed_attachments locked_pages}) {
+		my $orig=$config{$field};
+		foreach my $admin (@{$config{adminuser}}) {
+			my $a=IkiWiki::userinfo_get($admin, $field);
+			if (defined $a && length $a &&
+			    # might already have been moved
+			    (! defined $orig || $a ne $orig)) {
+			    	if (defined $config{$field} &&
+				    length $config{$field}) {
+					$config{$field}=IkiWiki::pagespec_merge($config{$field}, $a);
+				}
+				else {
+					$config{$field}=$a;
+				}
+			}
+		}
+	}
+
+	my %banned=map { $_ => 1 } @{$config{banned_users}}, IkiWiki::get_banned_users();
+	$config{banned_users}=[sort keys %banned];
+
+	IkiWiki::Setup::dump($setup);
+}
+
+sub deduplinks {
+	loadsetup(shift);
+	IkiWiki::loadplugins();
+	IkiWiki::checkconfig();
+	IkiWiki::loadindex();
+	foreach my $page (keys %links) {
+		my %l;
+		$l{$_}=1 foreach @{$links{$page}};
+		$links{$page}=[keys %l]
+	}
+	IkiWiki::saveindex();
+}
+
+sub setstatedir {
+	my $dirorsetup=shift;
+
+	if (! defined $dirorsetup) {
+		usage();		
+	}
+
+	if (-d $dirorsetup) {
+		$config{wikistatedir}=$dirorsetup."/.ikiwiki";
+	}
+	elsif (-f $dirorsetup) {
+		loadsetup($dirorsetup);
+	}
+	else {
+		error("ikiwiki-transition: $dirorsetup does not exist");
+	}
+
+	if (! -d $config{wikistatedir}) {
+		error("ikiwiki-transition: $config{wikistatedir} does not exist");
+	}
+}
+	
+sub loadsetup {
+	my $setup=shift;
+	if (! defined $setup) {
+		usage();
+	}
+
+	require IkiWiki::Setup;
+
+	%config = IkiWiki::defaultconfig();
+	IkiWiki::Setup::load($setup);
+}
+
+sub usage {
+	print STDERR "Usage: ikiwiki-transition type ...\n";
+	print STDERR "Currently supported transition subcommands:\n";
+	print STDERR "\tprefix_directives setupfile ...\n";
+	print STDERR "\taggregateinternal setupfile\n";
+	print STDERR "\tsetupformat setupfile\n";
+	print STDERR "\tmoveprefs setupfile\n";
+	print STDERR "\thashpassword setupfile|srcdir\n";
+	print STDERR "\tindexdb setupfile|srcdir\n";
+	print STDERR "\tdeduplinks setupfile\n";
+	exit 1;
+}
+
+usage() unless @ARGV;
+
+my $mode=shift;
+if ($mode eq 'prefix_directives') {
+	prefix_directives(@ARGV);
+}
+elsif ($mode eq 'hashpassword') {
+	hashpassword(@ARGV);
+}
+elsif ($mode eq 'indexdb') {
+	indexdb(@ARGV);
+}
+elsif ($mode eq 'aggregateinternal') {
+	aggregateinternal(@ARGV);
+}
+elsif ($mode eq 'setupformat') {
+	setupformat(@ARGV);
+}
+elsif ($mode eq 'moveprefs') {
+	moveprefs(@ARGV);
+}
+elsif ($mode eq 'deduplinks') {
+	deduplinks(@ARGV);
+}
+else {
+	usage();
+}
+
+package IkiWiki;
+
+# A slightly modified version of the old loadindex function.
+sub oldloadindex {
+	%oldrenderedfiles=%pagectime=();
+	if (! $config{rebuild}) {
+		%pagesources=%pagemtime=%oldlinks=%links=%depends=
+			%destsources=%renderedfiles=%pagecase=%pagestate=();
+	}
+	open (my $in, "<", "$config{wikistatedir}/index") || return;
+	while (<$in>) {
+		chomp;
+		my %items;
+		$items{link}=[];
+		$items{dest}=[];
+		foreach my $i (split(/ /, $_)) {
+			my ($item, $val)=split(/=/, $i, 2);
+			push @{$items{$item}}, decode_entities($val);
+		}
+
+		next unless exists $items{src}; # skip bad lines for now
+
+		my $page=pagename($items{src}[0]);
+		if (! $config{rebuild}) {
+			$pagesources{$page}=$items{src}[0];
+			$pagemtime{$page}=$items{mtime}[0];
+			$oldlinks{$page}=[@{$items{link}}];
+			$links{$page}=[@{$items{link}}];
+			$depends{$page}={ $items{depends}[0] => $IkiWiki::DEPEND_CONTENT } if exists $items{depends};
+			$destsources{$_}=$page foreach @{$items{dest}};
+			$renderedfiles{$page}=[@{$items{dest}}];
+			$pagecase{lc $page}=$page;
+			foreach my $k (grep /_/, keys %items) {
+				my ($id, $key)=split(/_/, $k, 2);
+				$pagestate{$page}{decode_entities($id)}{decode_entities($key)}=$items{$k}[0];
+			}
+		}
+		$oldrenderedfiles{$page}=[@{$items{dest}}];
+		$pagectime{$page}=$items{ctime}[0];
+	}
+
+	# saveindex relies on %hooks being populated, else it won't save
+	# the page state owned by a given hook. But no plugins are loaded
+	# by this program, so populate %hooks with all hook ids that
+	# currently have page state.
+	foreach my $page (keys %pagemtime) {
+		foreach my $id (keys %{$pagestate{$page}}) {
+			$hooks{_dummy}{$id}=1;
+		}
+	}
+	
+	return close($in);
+}
+
+# Used to be in IkiWiki/UserInfo, but only used here now.
+sub get_banned_users () {
+	my @ret;
+	my $userinfo=userinfo_retrieve();
+	foreach my $user (keys %{$userinfo}) {
+		push @ret, $user if $userinfo->{$user}->{banned};
+	}
+	return @ret;
+}
+
+# Used to be in IkiWiki, but only used here (to migrate admin prefs into the
+# setup file) now.
+sub pagespec_merge ($$) {
+	my $a=shift;
+	my $b=shift;
+
+	return $a if $a eq $b;
+	return "($a) or ($b)";
+}
+
+1
diff --git a/ikiwiki.spec b/ikiwiki.spec
index 2bb87724d..532a91885 100644
--- a/ikiwiki.spec
+++ b/ikiwiki.spec
@@ -1,5 +1,5 @@
 Name:           ikiwiki
-Version: 3.20100312
+Version: 3.20100324
 Release:        1%{?dist}
 Summary:        A wiki compiler
 
-- 
cgit v1.2.3


From e1eee27fc59dd6126e80ef21e4cc44191119902c Mon Sep 17 00:00:00 2001
From: "http://hendry.iki.fi/" 
Date: Sun, 28 Mar 2010 20:01:41 +0000
Subject:

---
 doc/bugs/Comments_dissapeared.mdwn | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 doc/bugs/Comments_dissapeared.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn
new file mode 100644
index 000000000..f71a442b8
--- /dev/null
+++ b/doc/bugs/Comments_dissapeared.mdwn
@@ -0,0 +1,9 @@
+Although I have comments enabled and I have been using them successfully for ages now, I've come to notice that they have stopped working in the last week or two.
+
+I am running version 3.20100312 with the following configuration:
+
+
+
+In my (HTML5 modified page.tmpl) it doesn't seem to enter the "TMPL_IF COMMENTS" block anymore. I tried the stock page.tmpl and they didn't seem to work either, so the variable name hasn't changed has it?
+
+Any other ideas? With thanks,
-- 
cgit v1.2.3


From a1f50f6a31d4e9f7acd6f8d445e5fb39edba5138 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 17:37:42 -0400
Subject: response

---
 doc/bugs/Comments_dissapeared.mdwn | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn
index f71a442b8..b737d9bef 100644
--- a/doc/bugs/Comments_dissapeared.mdwn
+++ b/doc/bugs/Comments_dissapeared.mdwn
@@ -7,3 +7,9 @@ I am running version 3.20100312 with the following configuration:
 In my (HTML5 modified page.tmpl) it doesn't seem to enter the "TMPL_IF COMMENTS" block anymore. I tried the stock page.tmpl and they didn't seem to work either, so the variable name hasn't changed has it?
 
 Any other ideas? With thanks,
+
+	comments_pagespec => 'archives/* and !*/Discussion',
+
+> Your setup file only allows comments to pages under archives. That 
+> seems unlikely to be right, so I guess it is causing your problem.
+> --[[Joey]] 
-- 
cgit v1.2.3


From 7e9d1932a2b90d5092315c18603cf495da28d6da Mon Sep 17 00:00:00 2001
From: "http://schors.livejournal.com/" 
Date: Sun, 28 Mar 2010 22:01:53 +0000
Subject:

---
 doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
new file mode 100644
index 000000000..6ad7975eb
--- /dev/null
+++ b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
@@ -0,0 +1,2 @@
+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
-- 
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 'doc/bugs')

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 6d04e182c4f4f44da37725444a540851fd36ba13 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 18:36:37 -0400
Subject: formatting

---
 doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'doc/bugs')

diff --git a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
index c2355d6aa..ac82541a3 100644
--- a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
+++ b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
@@ -1,5 +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
+> `#include ` fixed with nasty ifdefs to handle tcc w/o
 > breaking everything else. ||done]] --[[Joey]] 
-- 
cgit v1.2.3


From 15164671ceeed70f25cbfe53d81143eb5b13c863 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 18:37:00 -0400
Subject: formatting

---
 doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'doc/bugs')

diff --git a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
index ac82541a3..f38c86e03 100644
--- a/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
+++ b/doc/bugs/clearenv_not_present_at_FreeBSD_.mdwn
@@ -2,4 +2,4 @@ When build wrapper on FreeBSD system, is error occured with clearenv reference.
 P.S. new git instalation, FreeBSD 7.x
 
 > `#include ` fixed with nasty ifdefs to handle tcc w/o
-> breaking everything else. ||done]] --[[Joey]] 
+> breaking everything else. [[done]] --[[Joey]] 
-- 
cgit v1.2.3


From 1de069338de86dd6e785d9771140b2b687100451 Mon Sep 17 00:00:00 2001
From: "http://schors.livejournal.com/" 
Date: Sun, 28 Mar 2010 22:43:24 +0000
Subject:

---
 doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn b/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn
new file mode 100644
index 000000000..61964539d
--- /dev/null
+++ b/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn
@@ -0,0 +1,5 @@
+If i intsall perl modules in my custom directory, cgi wrapper can't find them. I found clearing enviroment variables in code  of wrapper. But information about custom directories put to perl with PERL5LIB variable.
+
+Workaround: add newenviron variable PERL5LIB
+
+My additional question - what wrapper do? I'am russian hosting provider. I am interesting with ikiwiki.
-- 
cgit v1.2.3


From 02e6ec9dd2c5e1e260a1f18406942059fe3d2064 Mon Sep 17 00:00:00 2001
From: "http://schors.livejournal.com/" 
Date: Sun, 28 Mar 2010 22:47:17 +0000
Subject:

---
 doc/bugs/clearenv_not_present_at_FreeBSD_/discussion.mdwn | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 doc/bugs/clearenv_not_present_at_FreeBSD_/discussion.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/clearenv_not_present_at_FreeBSD_/discussion.mdwn b/doc/bugs/clearenv_not_present_at_FreeBSD_/discussion.mdwn
new file mode 100644
index 000000000..713198b61
--- /dev/null
+++ b/doc/bugs/clearenv_not_present_at_FreeBSD_/discussion.mdwn
@@ -0,0 +1 @@
+Mmmm... i see. But it not setup under FreeBSD without magic manual passes.
-- 
cgit v1.2.3


From 911533655186f7c43ac229a4cdbc5be3e7f80d49 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 28 Mar 2010 18:49:15 -0400
Subject: response

---
 README                                                 |  2 +-
 doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

(limited to 'doc/bugs')

diff --git a/README b/README
index a4dc0d641..7efc59a51 100644
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ All other documentation is in the ikiwiki documentation wiki, which is also
 available online at 
 
 
-A few special variables you can set while using the Makefile:
+A few special variables you can set while using the Makefile.PL:
 
   PROFILE=1 turns on profiling for the build of the doc wiki.
   (Uses Devel::NYTProf)
diff --git a/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn b/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn
index 61964539d..9804d86c5 100644
--- a/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn
+++ b/doc/bugs/wrapper_can__39__t_find_the_perl_modules.mdwn
@@ -3,3 +3,14 @@ If i intsall perl modules in my custom directory, cgi wrapper can't find them. I
 Workaround: add newenviron variable PERL5LIB
 
 My additional question - what wrapper do? I'am russian hosting provider. I am interesting with ikiwiki.
+
+> The wrapper allows ikiwiki to run as the user who owns the wiki, which
+> is generally not the same as the user that runs the web server.
+> (It also handles some other things, like some locking.)
+> 
+> As a suid program, the wrapper cannot safely let environment variables
+> pass through.
+> 
+> If you want to install ikiwiki's perl modules in a nonstandard location,
+> you can set `INSTALL_BASE` when running `Makefile.PL`. ikiwiki will then
+> be built to look in that location. --[[Joey]]  [[!tag done]]
-- 
cgit v1.2.3


From ae4e9b25b714b02ed7003a21da781fccf9475f38 Mon Sep 17 00:00:00 2001
From: "http://hendry.iki.fi/" 
Date: Mon, 29 Mar 2010 08:15:43 +0000
Subject:

---
 doc/bugs/Comments_dissapeared.mdwn | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn
index b737d9bef..ad1638236 100644
--- a/doc/bugs/Comments_dissapeared.mdwn
+++ b/doc/bugs/Comments_dissapeared.mdwn
@@ -13,3 +13,8 @@ Any other ideas? With thanks,
 > Your setup file only allows comments to pages under archives. That 
 > seems unlikely to be right, so I guess it is causing your problem.
 > --[[Joey]] 
+
+That's the only place where I want comments. 
+Has the pagespec changed? Is it `archives/*/*` or something like that?
+
+It worked just fine with this configuration. I swear I have not modified it. :) -- [[Kai Hendry]]
-- 
cgit v1.2.3


From b2890b4e8ff0dc0e0fbaed1ffd9848c48dedf611 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Mon, 29 Mar 2010 15:25:34 -0400
Subject: response

---
 doc/bugs/Comments_dissapeared.mdwn | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn
index ad1638236..ac297028c 100644
--- a/doc/bugs/Comments_dissapeared.mdwn
+++ b/doc/bugs/Comments_dissapeared.mdwn
@@ -18,3 +18,13 @@ That's the only place where I want comments. 
 Has the pagespec changed? Is it `archives/*/*` or something like that?
 
 It worked just fine with this configuration. I swear I have not modified it. :) -- [[Kai Hendry]]
+
+> No changes that I can think of. 'archives/*' will match *all* pages under
+> archives. Anyway, I can see in your site's rss feed that comments are
+> enabled for posts, since they have comments tags there. And
+> in fact I see comments on eg
+> .
+> 
+> So I suspect you have simply not rebuilt your wiki after making some
+> change that fixed the comments, and so only newer pages are getting them.
+> --[[Joey]]
-- 
cgit v1.2.3


From 35fcc2ec8f1d3a3048d99a568df645607a99fbf1 Mon Sep 17 00:00:00 2001
From: "http://edrex.myopenid.com/" 
Date: Wed, 31 Mar 2010 00:21:58 +0000
Subject:

---
 doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
new file mode 100644
index 000000000..6f742ff70
--- /dev/null
+++ b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
@@ -0,0 +1,4 @@
+[[!table format=dsv delimiter="\t" data="""
+1	2
+2	4
+"""]]
-- 
cgit v1.2.3


From 66ecf1dba5d0aca59affd30029fe14ad5e3efc94 Mon Sep 17 00:00:00 2001
From: "http://edrex.myopenid.com/" 
Date: Wed, 31 Mar 2010 00:24:22 +0000
Subject:

---
 doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
index 6f742ff70..b407255aa 100644
--- a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
+++ b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
@@ -1,3 +1,5 @@
+Table directive should support tab-delimited data, especially important since this is the format you will get if copy/pasting from an HTML table or spreadsheet (Gnumeric, OO Calc, Excel). Test case which fails:
+
 [[!table format=dsv delimiter="\t" data="""
 1	2
 2	4
-- 
cgit v1.2.3


From 7f63763a30e774e9a10bd1416f157dd2b3e2e69b Mon Sep 17 00:00:00 2001
From: "http://smcv.pseudorandom.co.uk/" 
Date: Wed, 31 Mar 2010 02:07:52 +0000
Subject: they do work, with the right syntax (C backslash escapes aren't
 interpreted)

---
 doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
index b407255aa..278826ea0 100644
--- a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
+++ b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
@@ -4,3 +4,17 @@ Table directive should support tab-delimited data, especially important since th
 1	2
 2	4
 """]]
+
+> They do work, but C-style backslash escapes aren't recognised,
+> so the syntax `delimiter="\t"` (as in your test case) looks
+> for the literal string `\t`. Replacing `\t` with a literal
+> tab character makes it work - here's a test (I changed the data
+> to make the table layout more obvious):
+>
+> [[!table format=dsv delimiter="	" data="""
+left	2
+2	right
+alpha	beta
+"""]]
+>
+> So, I think this can be considered [[not_a_bug|done]]? --[[smcv]]
-- 
cgit v1.2.3


From 3c9cd4f156018aea3d10dbf02be529e85c05eb66 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Thu, 1 Apr 2010 18:13:38 +0100
Subject: Explain tab-delimited tables a bit better

---
 doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn | 2 ++
 doc/ikiwiki/directive/table.mdwn                   | 5 +++++
 2 files changed, 7 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
index 278826ea0..39d57a4fe 100644
--- a/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
+++ b/doc/bugs/Tab_delimited_tables_don__39__t_work.mdwn
@@ -18,3 +18,5 @@ alpha	beta
 """]]
 >
 > So, I think this can be considered [[not_a_bug|done]]? --[[smcv]]
+
+>> I've clarified the documentation. --[[smcv]]
diff --git a/doc/ikiwiki/directive/table.mdwn b/doc/ikiwiki/directive/table.mdwn
index 2dac97724..a6692f92c 100644
--- a/doc/ikiwiki/directive/table.mdwn
+++ b/doc/ikiwiki/directive/table.mdwn
@@ -42,4 +42,9 @@ cells. For example:
   as the table header. Set it to "no" to make a table without a header, or
   "column" to make the first column be the header.
 
+For tab-delimited tables (often obtained by copying and pasting from HTML
+or a spreadsheet), `delimiter` must be set to a literal tab character. These
+are difficult to type in most web browsers - copying and pasting one from
+the table data is likely to be the easiest way.
+
 [[!meta robots="noindex, follow"]]
-- 
cgit v1.2.3


From c1a42e76bc6667bfb2882a12d53c25d9f952ca82 Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Fri, 2 Apr 2010 00:28:02 +0100
Subject: implement typed links; add tagged_is_strict config option

---
 IkiWiki.pm                                         | 58 ++++++++++++++++++----
 IkiWiki/Plugin/tag.pm                              | 36 +++++++++-----
 IkiWiki/Render.pm                                  | 33 ++++++++++++
 .../tagged__40____41___matching_wikilinks.mdwn     |  3 ++
 doc/ikiwiki/pagespec.mdwn                          |  3 ++
 doc/plugins/tag.mdwn                               |  5 ++
 doc/plugins/write.mdwn                             | 21 +++++++-
 t/index.t                                          | 17 +++++--
 t/tag.t                                            | 45 +++++++++++++++++
 9 files changed, 193 insertions(+), 28 deletions(-)
 create mode 100755 t/tag.t

(limited to 'doc/bugs')

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 6739ba56c..25e9247b2 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -14,7 +14,7 @@ use open qw{:utf8 :std};
 use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
 	    %pagestate %wikistate %renderedfiles %oldrenderedfiles
 	    %pagesources %destsources %depends %depends_simple %hooks
-	    %forcerebuild %loaded_plugins};
+	    %forcerebuild %loaded_plugins %typedlinks %oldtypedlinks};
 
 use Exporter q{import};
 our @EXPORT = qw(hook debug error template htmlpage deptype
@@ -24,7 +24,7 @@ our @EXPORT = qw(hook debug error template htmlpage deptype
 		 add_underlay pagetitle titlepage linkpage newpagefile
 		 inject add_link
                  %config %links %pagestate %wikistate %renderedfiles
-                 %pagesources %destsources);
+                 %pagesources %destsources %typedlinks);
 our $VERSION = 3.00; # plugin interface version, next is ikiwiki version
 our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE
 our $installdir='/usr'; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE
@@ -1503,7 +1503,7 @@ sub loadindex () {
 	if (! $config{rebuild}) {
 		%pagesources=%pagemtime=%oldlinks=%links=%depends=
 		%destsources=%renderedfiles=%pagecase=%pagestate=
-		%depends_simple=();
+		%depends_simple=%typedlinks=%oldtypedlinks=();
 	}
 	my $in;
 	if (! open ($in, "<", "$config{wikistatedir}/indexdb")) {
@@ -1569,6 +1569,14 @@ sub loadindex () {
 			if (exists $d->{state}) {
 				$pagestate{$page}=$d->{state};
 			}
+			if (exists $d->{typedlinks}) {
+				$typedlinks{$page}=$d->{typedlinks};
+
+				while (my ($type, $links) = each %{$typedlinks{$page}}) {
+					next unless %$links;
+					$oldtypedlinks{$page}{$type} = {%$links};
+				}
+			}
 		}
 		$oldrenderedfiles{$page}=[@{$d->{dest}}];
 	}
@@ -1617,6 +1625,10 @@ sub saveindex () {
 			$index{page}{$src}{depends_simple} = $depends_simple{$page};
 		}
 
+		if (exists $typedlinks{$page} && %{$typedlinks{$page}}) {
+			$index{page}{$src}{typedlinks} = $typedlinks{$page};
+		}
+
 		if (exists $pagestate{$page}) {
 			foreach my $id (@hookids) {
 				foreach my $key (keys %{$pagestate{$page}{$id}}) {
@@ -1926,12 +1938,17 @@ sub inject {
 	use warnings;
 }
 
-sub add_link ($$) {
+sub add_link ($$;$) {
 	my $page=shift;
 	my $link=shift;
+	my $type=shift;
 
 	push @{$links{$page}}, $link
 		unless grep { $_ eq $link } @{$links{$page}};
+
+	if (defined $type) {
+		$typedlinks{$page}{$type}{$link} = 1;
+	}
 }
 
 sub pagespec_translate ($) {
@@ -2212,6 +2229,11 @@ sub match_link ($$;@) {
 
 	$link=derel($link, $params{location});
 	my $from=exists $params{location} ? $params{location} : '';
+	my $linktype=$params{linktype};
+	my $qualifier='';
+	if (defined $linktype) {
+		$qualifier=" with type $linktype";
+	}
 
 	my $links = $IkiWiki::links{$page};
 	return IkiWiki::FailReason->new("$page has no links", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
@@ -2219,19 +2241,33 @@ sub match_link ($$;@) {
 	my $bestlink = IkiWiki::bestlink($from, $link);
 	foreach my $p (@{$links}) {
 		if (length $bestlink) {
-			return IkiWiki::SuccessReason->new("$page links to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
-				if $bestlink eq IkiWiki::bestlink($page, $p);
+			if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && $bestlink eq IkiWiki::bestlink($page, $p)) {
+				return IkiWiki::SuccessReason->new("$page links to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
+			}
 		}
 		else {
-			return IkiWiki::SuccessReason->new("$page links to page $p matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
-				if match_glob($p, $link, %params);
+			if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && match_glob($p, $link, %params)) {
+				return IkiWiki::SuccessReason->new("$page links to page $p$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
+			}
 			my ($p_rel)=$p=~/^\/?(.*)/;
 			$link=~s/^\///;
-			return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
-				if match_glob($p_rel, $link, %params);
+			if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p_rel}) && match_glob($p_rel, $link, %params)) {
+				return IkiWiki::SuccessReason->new("$page links to page $p_rel$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1)
+			}
 		}
 	}
-	return IkiWiki::FailReason->new("$page does not link to $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1);
+	return IkiWiki::FailReason->new("$page does not link to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1);
+}
+
+sub match_typedlink($$;@) {
+	my $page = shift;
+	my $args = shift;
+
+	if ($args =~ /^(\w+)\s+(.*)$/) {
+		return match_link($page, $2, @_, linktype => $1);
+	}
+
+	return IkiWiki::ErrorReason->new("typedlink expects e.g. 'tag *' but got: $args");
 }
 
 sub match_backlink ($$;@) {
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index cdcfaf536..af4bff1bc 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -6,8 +6,6 @@ use warnings;
 use strict;
 use IkiWiki 3.00;
 
-my %tags;
-
 sub import {
 	hook(type => "getopt", id => "tag", call => \&getopt);
 	hook(type => "getsetup", id => "tag", call => \&getsetup);
@@ -36,6 +34,13 @@ sub getsetup () {
 			safe => 1,
 			rebuild => 1,
 		},
+		tagged_is_strict => {
+			type => "boolean",
+			default => 0,
+			description => "if 1, tagged() doesn't match normal WikiLinks to tag pages",
+			safe => 1,
+			rebuild => 1,
+		},
 }
 
 sub tagpage ($) {
@@ -71,9 +76,8 @@ sub preprocess_tag (@) {
 
 	foreach my $tag (keys %params) {
 		$tag=linkpage($tag);
-		$tags{$page}{$tag}=1;
 		# hidden WikiLink
-		add_link($page, tagpage($tag));
+		add_link($page, tagpage($tag), 'tag');
 	}
 		
 	return "";
@@ -87,15 +91,13 @@ sub preprocess_taglink (@) {
 	return join(" ", map {
 		if (/(.*)\|(.*)/) {
 			my $tag=linkpage($2);
-			$tags{$params{page}}{$tag}=1;
-			add_link($params{page}, tagpage($tag));
+			add_link($params{page}, tagpage($tag), 'tag');
 			return taglink($params{page}, $params{destpage}, $tag,
 				linktext => pagetitle($1));
 		}
 		else {
 			my $tag=linkpage($_);
-			$tags{$params{page}}{$tag}=1;
-			add_link($params{page}, tagpage($tag));
+			add_link($params{page}, tagpage($tag), 'tag');
 			return taglink($params{page}, $params{destpage}, $tag);
 		}
 	}
@@ -110,17 +112,19 @@ sub pagetemplate (@) {
 	my $destpage=$params{destpage};
 	my $template=$params{template};
 
+	my $tags = $typedlinks{$page}{tag};
+
 	$template->param(tags => [
 		map { 
 			link => taglink($page, $destpage, $_, rel => "tag")
-		}, sort keys %{$tags{$page}}
-	]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags");
+		}, sort keys %$tags
+	]) if defined $tags && %$tags && $template->query(name => "tags");
 
 	if ($template->query(name => "categories")) {
 		# It's an rss/atom template. Add any categories.
-		if (exists $tags{$page} && %{$tags{$page}}) {
+		if (defined $tags && %$tags) {
 			$template->param(categories => [map { category => $_ },
-				sort keys %{$tags{$page}}]);
+				sort keys %$tags]);
 		}
 	}
 }
@@ -130,7 +134,13 @@ package IkiWiki::PageSpec;
 sub match_tagged ($$;@) {
 	my $page = shift;
 	my $glob = shift;
-	return match_link($page, IkiWiki::Plugin::tag::tagpage($glob));
+
+	if ($IkiWiki::config{tagged_is_strict}) {
+		return match_link($page, IkiWiki::Plugin::tag::tagpage($glob), linktype => 'tag');
+	}
+	else {
+		return match_link($page, IkiWiki::Plugin::tag::tagpage($glob));
+	}
 }
 
 1
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index abafb0887..5810fc974 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -167,6 +167,7 @@ sub scan ($) {
 		else {
 			$links{$page}=[];
 		}
+		delete $typedlinks{$page};
 
 		run_hooks(scan => sub {
 			shift->(
@@ -398,6 +399,7 @@ sub find_del_files ($) {
 				push @del, $pagesources{$page};
 			}
 			$links{$page}=[];
+			delete $typedlinks{$page};
 			$renderedfiles{$page}=[];
 			$pagemtime{$page}=0;
 		}
@@ -499,6 +501,29 @@ sub remove_unrendered () {
 	}
 }
 
+sub link_types_changed ($$) {
+	# each is of the form { type => { link => 1 } }
+	my $new = shift;
+	my $old = shift;
+
+	return 0 if !defined $new && !defined $old;
+	return 1 if !defined $new || !defined $old;
+
+	while (my ($type, $links) = each %$new) {
+		foreach my $link (keys %$links) {
+			return 1 unless exists $old{$type}{$link};
+		}
+	}
+
+	while (my ($type, $links) = each %$old) {
+		foreach my $link (keys %$links) {
+			return 1 unless exists $new{$type}{$link};
+		}
+	}
+
+	return 0;
+}
+
 sub calculate_changed_links ($$$) {
 	my ($changed, $del, $oldlink_targets)=@_;
 
@@ -525,6 +550,14 @@ sub calculate_changed_links ($$$) {
 			}
 			$linkchangers{lc($page)}=1;
 		}
+
+		# we currently assume that changing the type of a link doesn't
+		# change backlinks
+		if (!exists $linkchangers{lc($page)}) {
+			if (link_types_changed($typedlinks{$page}, $oldlinktypes{$page})) {
+				$linkchangers{lc($page)}=1;
+			}
+		}
 	}
 
 	return \%backlinkchanged, \%linkchangers;
diff --git a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn
index e7e4af7c3..9037d6c02 100644
--- a/doc/bugs/tagged__40____41___matching_wikilinks.mdwn
+++ b/doc/bugs/tagged__40____41___matching_wikilinks.mdwn
@@ -28,6 +28,9 @@ rationale on this, or what am I doing wrong, and how to achieve what I want?
 >> is valid. [[todo/matching_different_kinds_of_links]] is probably
 >> how it will eventually be solved. --[[Joey]] 
 
+>>> [[Done]]: you can now set the `tagged_is_strict` config option to `1`
+>>> if you don't want `tagged` to match other wikilinks. --[[smcv]]
+
 > And this is an illustration why a clean work-around (without changing the software) is not possible: while thinking about [[todo/matching_different_kinds_of_links]], I thought one could work around the problem by simply explicitly including the kind of the relation into the link target (like the tagbase in tags), and by having a separate page without the "tagbase" to link to when one wants simply to refer to the tag without tagging. But this won't work: one has to at least once refer to the real tag page if one wants to talk about it, and this reference will count as tagging (unwanted). --Ivan Z.
 
 > But well, perhaps there is a workaround without introducing different kinds of links. One could modify the [[tag plugin|plugins/tag]] so that it adds 2 links to a page: for tagging -- `tagbase/TAG`, and for navigation -- `tagdescription/TAG` (displayed at the bottom). Then the `tagdescription/TAG` page would hold whatever list one wishes (with `tagged(TAG)` in the pagespec), and whenever one wants to merely refer to the tag, one should link to `tagdescription/TAG`--this link won't count as tagging. So, `tagbase/TAG` would become completely auxiliary (internal) link targets for ikiwiki, the users would edit or link to only `tagdescription/TAG`. --Ivan Z.
diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn
index 5c191f23f..ca6693024 100644
--- a/doc/ikiwiki/pagespec.mdwn
+++ b/doc/ikiwiki/pagespec.mdwn
@@ -52,6 +52,9 @@ Some more elaborate limits can be added to what matches using these functions:
   specified IP address.
 * "`postcomment(glob)`" - matches only when comments are being 
   posted to a page matching the specified glob
+* "`typedlink(type glob)`" - matches pages that link to a given page (or glob)
+  with a given link type. Plugins can create links with a specific type:
+  for instance, the tag plugin creates links of type `tag`.
 
 For example, to match all pages in a blog that link to the page about music
 and were written in 2005:
diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn
index 8ff70a069..8cd79da41 100644
--- a/doc/plugins/tag.mdwn
+++ b/doc/plugins/tag.mdwn
@@ -8,6 +8,11 @@ These directives allow tagging pages.
 It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to
 match pages that are tagged with a specific tag.
 
+If the `tagged_is_strict` config option is set, `tagged()` will only match
+tags explicitly set with [[ikiwiki/directive/tag]] or
+[[ikiwiki/directive/taglink]]; if not (the default), it will also match
+any other [[WikiLinks|ikiwiki/WikiLink]] to the tag page.
+
 [[!if test="enabled(tag)" then="""
 This wiki has the tag plugin enabled, so you'll see a note below that this
 page is tagged with the "tags" tag.
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index 96a2aa16d..fe7cf0183 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -633,6 +633,22 @@ reference. Do not modify this hash directly; call `add_link()`.
 
 	$links{"foo"} = ["bar", "baz"];
 
+### `%typedlinks`
+
+The `%typedlinks` hash records links of specific types. Do not modify this
+hash directly; call `add_link()`. The keys are page names, and the values
+are hash references. In each page's hash reference, the keys are link types
+defined by plugins, and the values are hash references with link targets
+as keys, and 1 as a dummy value, something like this:
+
+	$typedlinks{"foo"} = {
+		tag => { short_word => 1, metasyntactic_variable => 1 },
+		next_page => { bar => 1 },
+	};
+
+Ordinary [[WikiLinks|ikiwiki/WikiLink]] appear in `%links`, but not in
+`%typedlinks`.
+
 ### `%pagesources`
 
 The `%pagesources` has can be used to look up the source filename
@@ -939,11 +955,14 @@ Optionally, a third parameter can be passed, to specify the preferred
 filename of the page. For example, `targetpage("foo", "rss", "feed")`
 will yield something like `foo/feed.rss`.
 
-### `add_link($$)`
+### `add_link($$;$)`
 
 This adds a link to `%links`, ensuring that duplicate links are not
 added. Pass it the page that contains the link, and the link text.
 
+An optional third parameter sets the link type (`undef` produces an ordinary
+[[ikiwiki/WikiLink]]).
+
 ## Miscellaneous
 
 ### Internal use pages
diff --git a/t/index.t b/t/index.t
index 2f23524a7..44273059d 100755
--- a/t/index.t
+++ b/t/index.t
@@ -4,7 +4,7 @@ use strict;
 use IkiWiki;
 
 package IkiWiki; # use internal variables
-use Test::More tests => 27;
+use Test::More tests => 31;
 
 $config{wikistatedir}="/tmp/ikiwiki-test.$$";
 system "rm -rf $config{wikistatedir}";
@@ -31,6 +31,7 @@ $renderedfiles{"bar"}=["bar.html", "bar.rss", "sparkline-foo.gif"];
 $renderedfiles{"bar.png"}=["bar.png"];
 $links{"Foo"}=["bar.png"];
 $links{"bar"}=["Foo", "new-page"];
+$typedlinks{"bar"}={tag => {"Foo" => 1}};
 $links{"bar.png"}=[];
 $depends{"Foo"}={};
 $depends{"bar"}={"foo*" => 1};
@@ -45,7 +46,7 @@ ok(-s "$config{wikistatedir}/indexdb", "index file created");
 
 # Clear state.
 %oldrenderedfiles=%pagectime=();
-%pagesources=%pagemtime=%oldlinks=%links=%depends=
+%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks=
 %destsources=%renderedfiles=%pagecase=%pagestate=();
 
 ok(loadindex(), "load index");
@@ -104,10 +105,16 @@ is_deeply(\%destsources, {
 	"sparkline-foo.gif" => "bar",
 	"bar.png" => "bar.png",
 }, "%destsources generated correctly");
+is_deeply(\%typedlinks, {
+	bar => {tag => {"Foo" => 1}},
+}, "%typedlinks loaded correctly");
+is_deeply(\%oldtypedlinks, {
+	bar => {tag => {"Foo" => 1}},
+}, "%oldtypedlinks loaded correctly");
 
 # Clear state.
 %oldrenderedfiles=%pagectime=();
-%pagesources=%pagemtime=%oldlinks=%links=%depends=
+%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks=
 %destsources=%renderedfiles=%pagecase=%pagestate=();
 
 # When state is loaded for a wiki rebuild, only ctime and oldrenderedfiles
@@ -140,5 +147,9 @@ is_deeply(\%pagecase, {
 }, "%pagecase generated correctly");
 is_deeply(\%destsources, {
 }, "%destsources generated correctly");
+is_deeply(\%typedlinks, {
+}, "%typedlinks cleared correctly");
+is_deeply(\%oldtypedlinks, {
+}, "%oldtypedlinks cleared correctly");
 
 system "rm -rf $config{wikistatedir}";
diff --git a/t/tag.t b/t/tag.t
new file mode 100755
index 000000000..3383fd475
--- /dev/null
+++ b/t/tag.t
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+package IkiWiki;
+
+use warnings;
+use strict;
+use Test::More tests => 10;
+
+BEGIN { use_ok("IkiWiki"); }
+BEGIN { use_ok("IkiWiki::Plugin::tag"); }
+
+ok(! system("rm -rf t/tmp; mkdir t/tmp"));
+
+$config{userdir} = "users";
+$config{tagbase} = "tags";
+$config{tagged_is_strict} = 1;
+
+%oldrenderedfiles=%pagectime=();
+%pagesources=%pagemtime=%oldlinks=%links=%depends=%typedlinks=%oldtypedlinks=
+%destsources=%renderedfiles=%pagecase=%pagestate=();
+
+foreach my $page (qw(tags/numbers tags/letters one two alpha beta)) {
+	$pagesources{$page} = "$page.mdwn";
+	$pagemtime{$page} = $pagectime{$page} = 1000000;
+}
+
+$links{one}=[qw(tags/numbers alpha tags/letters)];
+$links{two}=[qw(tags/numbers)];
+$links{alpha}=[qw(tags/letters one)];
+$links{beta}=[qw(tags/letters)];
+$typedlinks{one}={tag => {"tags/numbers" => 1 }};
+$typedlinks{two}={tag => {"tags/numbers" => 1 }};
+$typedlinks{alpha}={tag => {"tags/letters" => 1 }};
+$typedlinks{beta}={tag => {"tags/letters" => 1 }};
+
+ok(pagespec_match("one", "tagged(numbers)"));
+ok(!pagespec_match("two", "tagged(alpha)"));
+ok(pagespec_match("one", "link(tags/numbers)"));
+ok(pagespec_match("one", "link(alpha)"));
+
+ok(pagespec_match("one", "typedlink(tag tags/numbers)"));
+ok(!pagespec_match("one", "typedlink(tag tags/letters)"));
+# invalid syntax
+ok(pagespec_match("one", "typedlink(tag)")->isa("IkiWiki::ErrorReason"));
+
+1;
-- 
cgit v1.2.3


From ef6344144051ed70649ccbff01bcc4fce927ee2f Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Sun, 4 Apr 2010 00:24:27 +0100
Subject: Remove tagged_is_strict option, and just behave as though it was
 enabled

Jon was worried about the backwards-compatibility break involved in making
tagged() not match non-tag links, but Joey seems less concerned about it.
---
 IkiWiki/Plugin/tag.pm                               | 17 +----------------
 doc/bugs/tagged__40____41___matching_wikilinks.mdwn |  3 +--
 doc/plugins/tag.mdwn                                |  5 -----
 t/tag.t                                             |  1 -
 4 files changed, 2 insertions(+), 24 deletions(-)

(limited to 'doc/bugs')

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 3e2a78840a22c376e40dccd358e94533313596e8 Mon Sep 17 00:00:00 2001
From: "http://liw.fi/" 
Date: Sun, 4 Apr 2010 09:12:23 +0000
Subject:

---
 doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn

(limited to 'doc/bugs')

diff --git a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
new file mode 100644
index 000000000..bd0900670
--- /dev/null
+++ b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
@@ -0,0 +1,3 @@
+Version 2.0 of bzr seems to break the bzr plugin.
+
+I traced this to the bzr_log method in the plugin, and patching that seems to fix it. The plugin just needs to parse the input little bit differently.
-- 
cgit v1.2.3


From 3190e3be93a97ccf0f1c2a4a2d4a27cd1326263b Mon Sep 17 00:00:00 2001
From: "http://liw.fi/" 
Date: Sun, 4 Apr 2010 09:13:01 +0000
Subject:

---
 doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn | 1 +
 1 file changed, 1 insertion(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
index bd0900670..2fd25df9c 100644
--- a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
+++ b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
@@ -1,3 +1,4 @@
 Version 2.0 of bzr seems to break the bzr plugin.
 
 I traced this to the bzr_log method in the plugin, and patching that seems to fix it. The plugin just needs to parse the input little bit differently.
+--liw
-- 
cgit v1.2.3


From 6b746ed72ba5fc49451f832f6ced9a7c26cce8f7 Mon Sep 17 00:00:00 2001
From: "http://liw.fi/" 
Date: Sun, 4 Apr 2010 09:23:05 +0000
Subject:

---
 doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn | 79 +++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
index 2fd25df9c..bda07d15b 100644
--- a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
+++ b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
@@ -2,3 +2,82 @@ Version 2.0 of bzr seems to break the bzr plugin.
 
 I traced this to the bzr_log method in the plugin, and patching that seems to fix it. The plugin just needs to parse the input little bit differently.
 --liw
+
+    From fb897114124e627fd3acf5af8e784c9a77419a81 Mon Sep 17 00:00:00 2001
+    From: Lars Wirzenius 
+    Date: Sun, 4 Apr 2010 21:05:07 +1200
+    Subject: [PATCH] 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 files changed, 16 insertions(+), 7 deletions(-)
+
+    diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
+    index 1ffdc23..e813331 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;
+    -- 
+    1.7.0
-- 
cgit v1.2.3


From 3a02cfca99922e8e15b55962d534629b777e463f Mon Sep 17 00:00:00 2001
From: "http://hendry.iki.fi/" 
Date: Sun, 4 Apr 2010 13:00:52 +0000
Subject:

---
 doc/bugs/Comments_dissapeared.mdwn | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn
index ac297028c..7ff1a012f 100644
--- a/doc/bugs/Comments_dissapeared.mdwn
+++ b/doc/bugs/Comments_dissapeared.mdwn
@@ -28,3 +28,8 @@ It worked just fine with this configuration. I swear I have not modified it. :)
 > So I suspect you have simply not rebuilt your wiki after making some
 > change that fixed the comments, and so only newer pages are getting them.
 > --[[Joey]]
+
+I have tried rebuilding on my squeeze system and still comments don't appear. Any clues how to debug this?
+
+
+I was worried is was due to a time skew problem I was experiencing on my VPS in the last month, though the time is right now and still comments do not appear on blog posts like 
-- 
cgit v1.2.3


From 6876c5a588a55df212cde24d7eabaa76b67ac292 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Sun, 4 Apr 2010 12:28:12 -0400
Subject: close bug, comment

---
 doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'doc/bugs')

diff --git a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
index bda07d15b..39500af20 100644
--- a/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
+++ b/doc/bugs/bzr_2.0_breaks_bzr_plugin.mdwn
@@ -3,6 +3,10 @@ Version 2.0 of bzr seems to break the bzr plugin.
 I traced this to the bzr_log method in the plugin, and patching that seems to fix it. The plugin just needs to parse the input little bit differently.
 --liw
 
+> Patch applied, [[done]] (but, it would be good if it could be tested with
+> an older bzr, and it's a pity bzr's human-targeted log has to be parsed,
+> I assume there is no machine-targeted version?) --[[Joey]] 
+
     From fb897114124e627fd3acf5af8e784c9a77419a81 Mon Sep 17 00:00:00 2001
     From: Lars Wirzenius 
     Date: Sun, 4 Apr 2010 21:05:07 +1200
-- 
cgit v1.2.3


From f8457f9a902e880e0240ba7f5180c22999f0e713 Mon Sep 17 00:00:00 2001
From: Joey Hess 
Date: Mon, 5 Apr 2010 17:18:30 -0400
Subject: fix bug that left stray 

tags Both markdown and tidy add paragraph tags around text, that needs to be stripped when the text is a short, one line fragment that is being inserted into a larger page. tidy also adds several newlines to the end, and this broke removal of the paragraph tags. --- IkiWiki.pm | 7 +++---- doc/bugs/stray___60____47__p__62___tags.mdwn | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki.pm b/IkiWiki.pm index 6739ba56c..0cbc84788 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1164,7 +1164,7 @@ sub htmlize ($$$$) { my $content=shift; my $oneline = $content !~ /\n/; - + if (exists $hooks{htmlize}{$type}) { $content=$hooks{htmlize}{$type}{call}->( page => $page, @@ -1185,10 +1185,9 @@ sub htmlize ($$$$) { if ($oneline) { # hack to get rid of enclosing junk added by markdown - # and other htmlizers + # and other htmlizers/sanitizers $content=~s/^

//i; - $content=~s/<\/p>$//i; - chomp $content; + $content=~s/<\/p>\n*$//i; } return $content; diff --git a/doc/bugs/stray___60____47__p__62___tags.mdwn b/doc/bugs/stray___60____47__p__62___tags.mdwn index 6e508ffda..99d6fe09f 100644 --- a/doc/bugs/stray___60____47__p__62___tags.mdwn +++ b/doc/bugs/stray___60____47__p__62___tags.mdwn @@ -13,3 +13,5 @@ I believe that this snippet in `IkiWiki.pm` might be the reason for the imbalanc } The fact that HTML in a `\[[!meta title]]` is added but then escaped might indicate that some other bug is involved. + +> [[done]] --[[Joey]] -- cgit v1.2.3 From 26bf69d17aff4c74dd6c368712091d8c1fc977a6 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 6 Apr 2010 00:49:38 +0000 Subject: as seen on IRC --- ...but_not_all_meta_fields_are_stored_escaped.mdwn | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn new file mode 100644 index 000000000..d79318dd8 --- /dev/null +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -0,0 +1,32 @@ +[[!template id=gitbranch branch=smcv/unescaped-meta author="[[Simon_McVittie|smcv]]"]] +(Warning: this branch has not been tested thoroughly.) + +While discussing the [[plugins/meta]] plugin on IRC, Joey pointed out that +it stores most meta fields unescaped, but 'title', 'guid' and 'description' +are special-cased and stored escaped (with numeric XML/HTML entities). This +is to avoid emitting markup in the of a HTML page, or in an RSS/Atom +feed, neither of which are subject to the [[plugins/htmlscrubber]]. + +However, having the meta fields "partially escaped" like this is somewhat +error-prone. Joey suggested that perhaps everything should be stored +unescaped, and the escaping should be done on output; this branch +implements that. + +Points of extra subtlety: + +* The title given to the [[plugins/search]] plugin was previously HTML; + now it's plain text, potentially containing markup characters. I suspect + that that's what Xapian wants anyway (which is why I didn't change it), + but I could be wrong... + +* Page descriptions in the HTML `<head>` were previously double-escaped: + the description was stored escaped with numeric entities, then that was + output with a second layer of escaping! In this branch, I just emit + the page description escaped once, as was presumably the intention. + +* It's safe to apply this change to a wiki and neglect to rebuild it + (assuming I implemented it correctly!), but until the wiki is rebuilt, + titles, descriptions and GUIDs for unchanged pages will appear + double-escaped on any page that inlines them in `quick=yes` mode, and + is rebuilt for some other reason. The failure mode is too much escaping + rather than too little, so it shouldn't be a security problem. -- cgit v1.2.3 From 0ed94696c0a449b425bc319297d39060ee24dcf2 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" <http://smcv.pseudorandom.co.uk/@web> Date: Tue, 6 Apr 2010 00:50:51 +0000 Subject: pages talking about escaping should really be escaped correctly --- doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn index d79318dd8..cbfcfd6b7 100644 --- a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -4,7 +4,7 @@ While discussing the [[plugins/meta]] plugin on IRC, Joey pointed out that it stores most meta fields unescaped, but 'title', 'guid' and 'description' are special-cased and stored escaped (with numeric XML/HTML entities). This -is to avoid emitting markup in the <title> of a HTML page, or in an RSS/Atom +is to avoid emitting markup in the `<title>` of a HTML page, or in an RSS/Atom feed, neither of which are subject to the [[plugins/htmlscrubber]]. However, having the meta fields "partially escaped" like this is somewhat -- cgit v1.2.3 From 315bcf866c490ae2041cef59f960e8021d52e840 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" <http://smcv.pseudorandom.co.uk/@web> Date: Tue, 6 Apr 2010 00:51:27 +0000 Subject: tag as patch --- doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/bugs') diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn index cbfcfd6b7..6a934d4eb 100644 --- a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -1,4 +1,5 @@ [[!template id=gitbranch branch=smcv/unescaped-meta author="[[Simon_McVittie|smcv]]"]] +[[!tag patch]] (Warning: this branch has not been tested thoroughly.) While discussing the [[plugins/meta]] plugin on IRC, Joey pointed out that -- cgit v1.2.3 From 1f112d570ef235416c4001605e15980b2f628da4 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" <http://smcv.pseudorandom.co.uk/@web> Date: Tue, 6 Apr 2010 00:55:54 +0000 Subject: if applied, reverting this would be problematic --- doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn index 6a934d4eb..8e1ca42e0 100644 --- a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -31,3 +31,9 @@ Points of extra subtlety: double-escaped on any page that inlines them in `quick=yes` mode, and is rebuilt for some other reason. The failure mode is too much escaping rather than too little, so it shouldn't be a security problem. + +* Reverting this change, if applied, is more dangerous; until the wiki is + rebuilt, any titles, descriptions and GUIDs on unchanged pages that + contained markup could appear unescaped on any page that inlines them + in `quick=yes` mode, and is rebuilt for some other reason. The failure + mode here would be too little escaping, i.e. cross-site scripting. -- cgit v1.2.3 From 1c1c76c53e1d0e713e470bb6542c5cc3cef20ad2 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@gnu.kitenet.net> Date: Fri, 9 Apr 2010 12:25:10 -0400 Subject: close bug, was fixed in 3.20100403 --- ...ox_doesn__39__t_want_to_load_updated_pages_at_ikiwiki.info.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/firefox_doesn__39__t_want_to_load_updated_pages_at_ikiwiki.info.mdwn b/doc/bugs/firefox_doesn__39__t_want_to_load_updated_pages_at_ikiwiki.info.mdwn index 46e77a265..558eb90c8 100644 --- a/doc/bugs/firefox_doesn__39__t_want_to_load_updated_pages_at_ikiwiki.info.mdwn +++ b/doc/bugs/firefox_doesn__39__t_want_to_load_updated_pages_at_ikiwiki.info.mdwn @@ -5,3 +5,10 @@ Only explicitly pressing "reload" helps. Is it a bug? I haven't been noticing such problems usually on other sites. --Ivan Z. This remains to be true now, with Epiphany 2.26.3 (Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.1.4pre) Gecko/20080528 Epiphany/2.22 Firefox/3.5). --Ivan Z. + +> In the most recent ikiwiki release, I added a Cache-Control hack +> explicitly to work around firefox's broken over-caching. +> +> (When I tested epiphany and chromium, neither had firefox's problem.) +> +> [[!tag done]] -- cgit v1.2.3 From d2c36a6f4b8b4bf30d59c430893a88352ac208fc Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@gnu.kitenet.net> Date: Sat, 10 Apr 2010 15:29:31 -0400 Subject: close --- doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn index 8e1ca42e0..587771ba4 100644 --- a/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn +++ b/doc/bugs/some_but_not_all_meta_fields_are_stored_escaped.mdwn @@ -20,6 +20,9 @@ Points of extra subtlety: that that's what Xapian wants anyway (which is why I didn't change it), but I could be wrong... + > AFAICS, this if anything, fixes a bug, xapian definitely expects + > unescaped text here. --[[Joey]] + * Page descriptions in the HTML `<head>` were previously double-escaped: the description was stored escaped with numeric entities, then that was output with a second layer of escaping! In this branch, I just emit @@ -37,3 +40,5 @@ Points of extra subtlety: contained markup could appear unescaped on any page that inlines them in `quick=yes` mode, and is rebuilt for some other reason. The failure mode here would be too little escaping, i.e. cross-site scripting. + +[[!tag done]] -- cgit v1.2.3 From 5d2df9651fee83cf17acde48ba12442104311492 Mon Sep 17 00:00:00 2001 From: "http://oblomov.myopenid.com/" <http://oblomov.myopenid.com/@web> Date: Wed, 21 Apr 2010 08:17:03 +0000 Subject: Missing links with no CGI --- doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn new file mode 100644 index 000000000..d9f3d518f --- /dev/null +++ b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn @@ -0,0 +1,5 @@ +When the CGI URL is not defined, links to missing pages appear as plain, unstyled text. I think the 'createlink' span should always wrap this text, even when the actual question mark linking to the CGI for the create action is missing. This ensures consistent styling regardless of whether the CGI is available or not (and is thus useful for example when the same wiki has clones with the CGI link and clones without). + +A proposed patch is available [on my ikiwiki clone](http://git.oblomov.eu/ikiwiki/patch/290d1b498f00f63e6d41218ddb76d87e68ed5081) + +[[!tag patch cgi]] -- cgit v1.2.3 From 5c855b2bcab82e4075d49713d53869857a4e9385 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 12:50:43 -0400 Subject: applied --- doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn index d9f3d518f..73213209a 100644 --- a/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn +++ b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn @@ -2,4 +2,4 @@ When the CGI URL is not defined, links to missing pages appear as plain, unstyle A proposed patch is available [on my ikiwiki clone](http://git.oblomov.eu/ikiwiki/patch/290d1b498f00f63e6d41218ddb76d87e68ed5081) -[[!tag patch cgi]] +[[!tag patch cgi done]] -- cgit v1.2.3 From e72973afdb3b08b1755295e348e223a7c51cf702 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" <http://hendry.iki.fi/@web> Date: Wed, 21 Apr 2010 19:07:32 +0000 Subject: debugging --- doc/bugs/Comments_dissapeared.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn index 7ff1a012f..c7403f0f1 100644 --- a/doc/bugs/Comments_dissapeared.mdwn +++ b/doc/bugs/Comments_dissapeared.mdwn @@ -33,3 +33,15 @@ I have tried rebuilding on my squeeze system and still comments don't appear. An <http://natalian.org/comments/> I was worried is was due to a time skew problem I was experiencing on my VPS in the last month, though the time is right now and still comments do not appear on blog posts like <http://natalian.org/archives/2010/03/25/BBC_News_complaints/> + +# Getting closer + + hendry@webconverger templates$ for i in *.tmpl; do ./test-template.perl $i || echo $i has an error; done + HTML::Template->new() : At least one <TMPL_IF> or <TMPL_UNLESS> not terminated at end of file! at /usr/share/perl5/HTML/Template.pm line 2351. + page.tmpl has an error + hendry@webconverger templates$ cat test-template.perl + #!/usr/bin/perl + use HTML::Template; + my $htc = HTML::Template->new(filename => "$ARGV[0]"); + +I think the problem was before that it was `<TMPL_IF COMMENTS>` and now it is `<TMPL_IF NAME="COMMENTS">` ? -- cgit v1.2.3 From 9ed523d762afd74c3004a07fc8ee12daa9354813 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" <http://hendry.iki.fi/@web> Date: Wed, 21 Apr 2010 19:21:38 +0000 Subject: --- doc/bugs/Comments_dissapeared.mdwn | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn index c7403f0f1..830c3519f 100644 --- a/doc/bugs/Comments_dissapeared.mdwn +++ b/doc/bugs/Comments_dissapeared.mdwn @@ -34,14 +34,28 @@ I have tried rebuilding on my squeeze system and still comments don't appear. An I was worried is was due to a time skew problem I was experiencing on my VPS in the last month, though the time is right now and still comments do not appear on blog posts like <http://natalian.org/archives/2010/03/25/BBC_News_complaints/> -# Getting closer +# Debugging templates - hendry@webconverger templates$ for i in *.tmpl; do ./test-template.perl $i || echo $i has an error; done - HTML::Template->new() : At least one <TMPL_IF> or <TMPL_UNLESS> not terminated at end of file! at /usr/share/perl5/HTML/Template.pm line 2351. - page.tmpl has an error - hendry@webconverger templates$ cat test-template.perl +`sudo apt-get install libhtml-template-compiled-perl` + + hendry@webconverger templates$ cat test-template.perl #!/usr/bin/perl - use HTML::Template; - my $htc = HTML::Template->new(filename => "$ARGV[0]"); + use HTML::Template::Compiled; + local $HTML::Template::Compiled::DEBUG = 1; + my $htc = HTML::Template::Compiled->new( + filename => "$ARGV[0]", + ); + eval { + print $htc->output; + }; + if ($@) { + # reports as text + my $msg = $htc->debug_code; + # reports as a html table + my $msg_html = $htc->debug_code('html'); + } + hendry@webconverger templates$ ./test-template.perl page.tmpl + Missing closing tag for 'IF' atend of page.tmpl line 159 + I think the problem was before that it was `<TMPL_IF COMMENTS>` and now it is `<TMPL_IF NAME="COMMENTS">` ? -- cgit v1.2.3 From 86e73e42e835821984fdf6dc5671dae06cec5f90 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" <http://hendry.iki.fi/@web> Date: Wed, 21 Apr 2010 19:48:31 +0000 Subject: --- doc/bugs/Comments_dissapeared.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Comments_dissapeared.mdwn b/doc/bugs/Comments_dissapeared.mdwn index 830c3519f..787f18c98 100644 --- a/doc/bugs/Comments_dissapeared.mdwn +++ b/doc/bugs/Comments_dissapeared.mdwn @@ -59,3 +59,11 @@ I was worried is was due to a time skew problem I was experiencing on my VPS in I think the problem was before that it was `<TMPL_IF COMMENTS>` and now it is `<TMPL_IF NAME="COMMENTS">` ? + + + +# Solved + +A merge with the templates in master with my [html5](http://git.webconverger.org/?p=ikiwiki;a=shortlog;h=refs/heads/html5) branch looks like it has solved the problem. Also see [[bugs/html5_support]]. + +[[bugs/done]] -- cgit v1.2.3 From 6c5f315970b0e7a8473e9a1151229459781192a8 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 21:38:58 -0400 Subject: argh. head exploding. --- doc/bugs/depends_simple_mixup.mdwn | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index 2603ff04c..2ebd53e85 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -18,6 +18,42 @@ not noticing that bugs dependeded on the page and needs to be updated. Ok.. Turns out this was not a problem with the actual influences calculation or dependency calculation code. Whew! `match_link` -just didn't set the influence correctly when failing. [[fixed|done]] +just didn't set the influence correctly when failing. fixed --[[Joey]] + +--- + +Update: Reopening this because the fix for it rather sucks. + +I made `match_link` return on failure an influence of +type DEPEND_LINKS. So, a tag page that inlines `tagged(foo)` +gets a `depends_simple` built up that contains link dependencies for +*every* page in the wiki. A very bloaty way to represent the dependency! + +Per [[dependency_types]], `link(done)` only needs to list in +`depends_simple` the pages that currently match. If a page is modified +to add the link, the regular dependency calculation code notices that +a new page matches. If a page that had the link is modified to remove it, +the `depends_simple` lets ikiwiki remember that the now non-matching page +matched before. + +Where that fell down was `!link(done)`. A page matching that was not added +to `depends_simple`, because the `link(done)` did not match it. If the page +is modified to add the link, the regular dependency calculation code +didn't notice, since the pagespec no longer matched. + +In this case, `depends_simple` needs to contain all pages +that do *not* match `link_done)`, but before my change, it contained +all pages that *do* match. After my change, it contained all pages. + +So, seems what is needed is a way for influence info to be manipulated by +the boolean operations that are applied. One way would be to have two +sets of influences be returned, one for successful matches, and one for +failed matches. Normally, these would be the same. For successful +`match_link`, the successful influence would be the page. +For failed `match_link`, the failed influence would be the page. + +Then, when NOTting a `*Reason`, swap the two sets of influences. +When ANDing/ORing, combine the individual sets. Querying the object for +influences should return only the successful influences. -- cgit v1.2.3 From 8cf6b7abf87818f9063b6ef672f20125de75249c Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 21:42:18 -0400 Subject: link fix --- doc/bugs/depends_simple_mixup.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index 2ebd53e85..4fe69a90a 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -31,7 +31,7 @@ type DEPEND_LINKS. So, a tag page that inlines `tagged(foo)` gets a `depends_simple` built up that contains link dependencies for *every* page in the wiki. A very bloaty way to represent the dependency! -Per [[dependency_types]], `link(done)` only needs to list in +Per [[todo/dependency_types]], `link(done)` only needs to list in `depends_simple` the pages that currently match. If a page is modified to add the link, the regular dependency calculation code notices that a new page matches. If a page that had the link is modified to remove it, -- cgit v1.2.3 From 09ff797682fd89380a4a71564ec02649af99851e Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 21:55:12 -0400 Subject: more wrongness --- doc/bugs/depends_simple_mixup.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index 4fe69a90a..472de6349 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -57,3 +57,8 @@ For failed `match_link`, the failed influence would be the page. Then, when NOTting a `*Reason`, swap the two sets of influences. When ANDing/ORing, combine the individual sets. Querying the object for influences should return only the successful influences. + +In light of this, commit f2b3d1341447cbf29189ab490daae418fbe5d02d seems +thuroughly wrong. So, what about influence info for other matches +like `!author(foo)` etc? Currently, none is returned, but it should +be a content influence. What about backlink influence data? -- cgit v1.2.3 From 13325317a32529e02769baa5e61e6c401c675b27 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 22:04:03 -0400 Subject: backlink influence data seems ok --- doc/bugs/depends_simple_mixup.mdwn | 2 +- t/pagespec_match_list.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index 472de6349..e7b48f802 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -61,4 +61,4 @@ influences should return only the successful influences. In light of this, commit f2b3d1341447cbf29189ab490daae418fbe5d02d seems thuroughly wrong. So, what about influence info for other matches like `!author(foo)` etc? Currently, none is returned, but it should -be a content influence. What about backlink influence data? +be a content influence. (Backlink influence data is ok.) diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index 05dc012fe..ee5d60f88 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 94; +use Test::More tests => 107; BEGIN { use_ok("IkiWiki"); } @@ -80,7 +80,7 @@ foreach my $spec ("* and link(bar)", "* or link(bar)") { } # a pagespec with backlinks() will add as an influence the page with the links -foreach my $spec ("bar or (backlink(foo) and !*.png)", "backlink(foo)") { +foreach my $spec ("bar or (backlink(foo) and !*.png)", "backlink(foo)", "!backlink(foo)") { pagespec_match_list("foo2", $spec, deptype => deptype("presence")); ok($IkiWiki::depends{foo2}{$spec} & $IkiWiki::DEPEND_PRESENCE); ok(! ($IkiWiki::depends{foo2}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_LINKS))); -- cgit v1.2.3 From c98414e192285b2607ee9fcb27f0e8e00db5fb26 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 21 Apr 2010 23:08:54 -0400 Subject: added a test case for this bug Further analysis suggests fixing this might not be as dreadful as I first thought! --- doc/bugs/depends_simple_mixup.mdwn | 24 ++++++++++++++++++++++-- t/pagespec_match_list.t | 20 +++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index e7b48f802..79bfa8bdc 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -44,9 +44,11 @@ is modified to add the link, the regular dependency calculation code didn't notice, since the pagespec no longer matched. In this case, `depends_simple` needs to contain all pages -that do *not* match `link_done)`, but before my change, it contained +that do *not* match `link(done)`, but before my change, it contained all pages that *do* match. After my change, it contained all pages. +---- + So, seems what is needed is a way for influence info to be manipulated by the boolean operations that are applied. One way would be to have two sets of influences be returned, one for successful matches, and one for @@ -58,7 +60,25 @@ Then, when NOTting a `*Reason`, swap the two sets of influences. When ANDing/ORing, combine the individual sets. Querying the object for influences should return only the successful influences. -In light of this, commit f2b3d1341447cbf29189ab490daae418fbe5d02d seems +---- + +Would it be possible to avoid the complication of maintianing two sets of +influence info? + +Well, notice that the influence of `pagespec_match($page, "link(done)")` +is $page. Iff the match succeeds. + +Also, the influence of `pagespec_match($page, "!link(done)")` is +$page. Iff the (overall) match succeeds. + +Does that hold for all cases? If so, the code that populates +`depends_simple` could just test if the pagespec was successful, and +if not, avoid adding $page influences, while still adding any other, +non-$page influences. + +---- + +Hmm, commit f2b3d1341447cbf29189ab490daae418fbe5d02d seems thuroughly wrong. So, what about influence info for other matches like `!author(foo)` etc? Currently, none is returned, but it should be a content influence. (Backlink influence data is ok.) diff --git a/t/pagespec_match_list.t b/t/pagespec_match_list.t index ee5d60f88..27546e6ca 100755 --- a/t/pagespec_match_list.t +++ b/t/pagespec_match_list.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 107; +use Test::More tests => 115; BEGIN { use_ok("IkiWiki"); } @@ -27,6 +27,8 @@ IkiWiki::checkconfig(); $IkiWiki::pagectime{foo} = 2; $IkiWiki::pagectime{foo2} = 2; $IkiWiki::pagectime{foo3} = 1; +$IkiWiki::pagectime{foo4} = 1; +$IkiWiki::pagectime{foo5} = 1; $IkiWiki::pagectime{bar} = 3; $IkiWiki::pagectime{"post/1"} = 6; $IkiWiki::pagectime{"post/2"} = 6; @@ -69,12 +71,28 @@ foreach my $spec ("* and link(bar)", "* or link(bar)") { ok($IkiWiki::depends{foo2}{$spec} & $IkiWiki::DEPEND_PRESENCE); ok(! ($IkiWiki::depends{foo2}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_LINKS))); ok($IkiWiki::depends_simple{foo2}{foo2} == $IkiWiki::DEPEND_LINKS); + ok($IkiWiki::depends_simple{foo2}{foo} != $IkiWiki::DEPEND_LINKS); %IkiWiki::depends_simple=(); %IkiWiki::depends=(); pagespec_match_list("foo3", $spec, deptype => deptype("links")); ok($IkiWiki::depends{foo3}{$spec} & $IkiWiki::DEPEND_LINKS); ok(! ($IkiWiki::depends{foo3}{$spec} & ($IkiWiki::DEPEND_CONTENT | $IkiWiki::DEPEND_PRESENCE))); ok($IkiWiki::depends_simple{foo3}{foo3} == $IkiWiki::DEPEND_LINKS); + ok($IkiWiki::depends_simple{foo3}{foo} != $IkiWiki::DEPEND_LINKS); + %IkiWiki::depends_simple=(); + %IkiWiki::depends=(); +} +# Above we tested that a link pagespec is influenced +# by the pages that currently contain the link. + +# Oppositely, a pagespec that tests for pages that do not have a link +# is not influenced by pages that currently contain the link, but +# is instead influenced by pages that currently do not (but that +# could be changed to have it). +foreach my $spec ("* and !link(bar)", "* and !(!(!link(bar)))") { + pagespec_match_list("foo2", $spec); + ok($IkiWiki::depends_simple{foo2}{foo2} != $IkiWiki::DEPEND_LINKS); + ok($IkiWiki::depends_simple{foo2}{foo} == $IkiWiki::DEPEND_LINKS); %IkiWiki::depends_simple=(); %IkiWiki::depends=(); } -- cgit v1.2.3 From 2b175d7c1fe997277800c0d501332e96de475c6d Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Thu, 22 Apr 2010 00:12:15 -0400 Subject: improved fix for depends_simple_mixup Avoid adding the page matched against as an influence for currently failing pagespec matches, while still adding any other influences. This avoids bloating depends_simple with lots of bogus influences when matching eg, "!link(done)". It's only necessary for the page being tested to be an influence of that if the page matches. --- IkiWiki.pm | 14 +++++++++++++- doc/bugs/depends_simple_mixup.mdwn | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki.pm b/IkiWiki.pm index 0791e1e75..509f9ba2e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1818,10 +1818,12 @@ sub add_depends ($$;$) { foreach my $p (keys %pagesources) { my $r=$sub->($p, location => $page); my $i=$r->influences; + my $static=$r->influences_static; foreach my $k (keys %$i) { + next unless $r || $static || $k eq $page; $depends_simple{$page}{lc $k} |= $i->{$k}; } - last if $r->influences_static; + last if $static; } $depends{$page}{$pagespec} |= $deptype; @@ -2136,6 +2138,9 @@ sub pagespec_match_list ($$;@) { my $r=$sub->($p, %params, location => $page); error(sprintf(gettext("cannot match pages: %s"), $r)) if $r->isa("IkiWiki::ErrorReason"); + unless ($r) { + $r->remove_influence($p); + } $accum |= $r; if ($r) { push @matches, $p; @@ -2232,6 +2237,13 @@ sub merge_influences { } } +sub remove_influence { + my $this=shift; + my $torm=shift; + + delete $this->[1]{$torm}; +} + package IkiWiki::ErrorReason; our @ISA = 'IkiWiki::FailReason'; diff --git a/doc/bugs/depends_simple_mixup.mdwn b/doc/bugs/depends_simple_mixup.mdwn index 79bfa8bdc..a5910d02e 100644 --- a/doc/bugs/depends_simple_mixup.mdwn +++ b/doc/bugs/depends_simple_mixup.mdwn @@ -81,4 +81,8 @@ non-$page influences. Hmm, commit f2b3d1341447cbf29189ab490daae418fbe5d02d seems thuroughly wrong. So, what about influence info for other matches like `!author(foo)` etc? Currently, none is returned, but it should -be a content influence. (Backlink influence data is ok.) +be a content influence. (Backlink influence data seems ok.) + +---- + +[[done]] again! -- cgit v1.2.3 From 898fc1095563412400484d5378ad82b334414b36 Mon Sep 17 00:00:00 2001 From: blipvert <blipvert@web> Date: Fri, 23 Apr 2010 02:36:27 +0000 Subject: --- ...ails_oddly_when_older_ikiwiki_is_installed.mdwn | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn b/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn new file mode 100644 index 000000000..b11972165 --- /dev/null +++ b/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn @@ -0,0 +1,26 @@ +I got this failure when trying to build ikiwiki version 3.20100403: + + $ perl Makefile.PL INSTALL_BASE=/opt/ikiwiki PREFIX= + Writing Makefile for IkiWiki + $ make + +*...snip...* + + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki.in > ikiwiki.out + chmod +x ikiwiki.out + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-transition.in > ikiwiki-transition.out + chmod +x ikiwiki-transition.out + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-calendar.in > ikiwiki-calendar.out + chmod +x ikiwiki-calendar.out + HOME=/home/me /usr/bin/perl -Iblib/lib ikiwiki.out -libdir . -dumpsetup ikiwiki.setup + Use of uninitialized value $IkiWiki::Setup::config{"setuptype"} in concatenation (.) or string at IkiWiki/Setup.pm line 53. + Can't locate IkiWiki/Setup/.pm in @INC (@INC contains: . /opt/ikiwiki/lib/perl5/i486-linux-gnu-thread-multi /opt/ikiwiki/lib/perl5 blib/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 35) line 3. + + make: *** [ikiwiki.setup] Error 2 + +Note that I had been trying to upgrade with an installed ikiwiki 3.20091114 +already in place under /opt/ikiwiki. The build does not fail for me +if I first remove the old ikiwiki installation, nor does it fail with +3.20100403 or newer installed at /opt/ikiwiki. Hence this is not +really a critical bug, although it's somewhat perplexing to me why it +ought to make a difference. -- cgit v1.2.3 From a2feb7d477a57a4e7feb1334e7ff4abc4067b1d3 Mon Sep 17 00:00:00 2001 From: blipvert <blipvert@web> Date: Fri, 23 Apr 2010 02:40:36 +0000 Subject: rename bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn to bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn --- ...ails_oddly_when_older_ikiwiki_is_installed.mdwn | 26 ++++++++++++++++++++++ ...ails_oddly_when_older_ikiwiki_is_installed.mdwn | 26 ---------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn delete mode 100644 doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn b/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn new file mode 100644 index 000000000..b11972165 --- /dev/null +++ b/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn @@ -0,0 +1,26 @@ +I got this failure when trying to build ikiwiki version 3.20100403: + + $ perl Makefile.PL INSTALL_BASE=/opt/ikiwiki PREFIX= + Writing Makefile for IkiWiki + $ make + +*...snip...* + + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki.in > ikiwiki.out + chmod +x ikiwiki.out + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-transition.in > ikiwiki-transition.out + chmod +x ikiwiki-transition.out + ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-calendar.in > ikiwiki-calendar.out + chmod +x ikiwiki-calendar.out + HOME=/home/me /usr/bin/perl -Iblib/lib ikiwiki.out -libdir . -dumpsetup ikiwiki.setup + Use of uninitialized value $IkiWiki::Setup::config{"setuptype"} in concatenation (.) or string at IkiWiki/Setup.pm line 53. + Can't locate IkiWiki/Setup/.pm in @INC (@INC contains: . /opt/ikiwiki/lib/perl5/i486-linux-gnu-thread-multi /opt/ikiwiki/lib/perl5 blib/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 35) line 3. + + make: *** [ikiwiki.setup] Error 2 + +Note that I had been trying to upgrade with an installed ikiwiki 3.20091114 +already in place under /opt/ikiwiki. The build does not fail for me +if I first remove the old ikiwiki installation, nor does it fail with +3.20100403 or newer installed at /opt/ikiwiki. Hence this is not +really a critical bug, although it's somewhat perplexing to me why it +ought to make a difference. diff --git a/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn b/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn deleted file mode 100644 index b11972165..000000000 --- a/doc/bugs/creating_build_fails_oddly_when_older_ikiwiki_is_installed.mdwn +++ /dev/null @@ -1,26 +0,0 @@ -I got this failure when trying to build ikiwiki version 3.20100403: - - $ perl Makefile.PL INSTALL_BASE=/opt/ikiwiki PREFIX= - Writing Makefile for IkiWiki - $ make - -*...snip...* - - ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki.in > ikiwiki.out - chmod +x ikiwiki.out - ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-transition.in > ikiwiki-transition.out - chmod +x ikiwiki-transition.out - ./pm_filter /opt/ikiwiki 3.20100403 /opt/ikiwiki/lib/perl5 < ikiwiki-calendar.in > ikiwiki-calendar.out - chmod +x ikiwiki-calendar.out - HOME=/home/me /usr/bin/perl -Iblib/lib ikiwiki.out -libdir . -dumpsetup ikiwiki.setup - Use of uninitialized value $IkiWiki::Setup::config{"setuptype"} in concatenation (.) or string at IkiWiki/Setup.pm line 53. - Can't locate IkiWiki/Setup/.pm in @INC (@INC contains: . /opt/ikiwiki/lib/perl5/i486-linux-gnu-thread-multi /opt/ikiwiki/lib/perl5 blib/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 35) line 3. - - make: *** [ikiwiki.setup] Error 2 - -Note that I had been trying to upgrade with an installed ikiwiki 3.20091114 -already in place under /opt/ikiwiki. The build does not fail for me -if I first remove the old ikiwiki installation, nor does it fail with -3.20100403 or newer installed at /opt/ikiwiki. Hence this is not -really a critical bug, although it's somewhat perplexing to me why it -ought to make a difference. -- cgit v1.2.3 From 5bc7efab7cc7a437d3d593a3ff62595ed0ab7f81 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Thu, 22 Apr 2010 23:00:33 -0400 Subject: switch to PERL5LIB so that use lib inserted for INSTALL_BASE is overridden during build --- Makefile.PL | 6 +++--- doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/Makefile.PL b/Makefile.PL index 38db20d44..794a2ed47 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -36,7 +36,7 @@ scripts=ikiwiki-update-wikilist ikiwiki-makerepo chmod +x $@ ikiwiki.setup: ikiwiki.out - HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup + PERL5LIB=. HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -dumpsetup ikiwiki.setup extra_build: $(outprogs) ikiwiki.setup docwiki ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man @@ -50,10 +50,10 @@ extra_build: $(outprogs) ikiwiki.setup docwiki rm -f ikiwiki.spec.bkp docwiki: ikiwiki.out - $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh + PERL5LIB=. $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -setup docwiki.setup -refresh extra_clean: - $(PERL) -I. $(extramodules) $(tflag) ikiwiki.in -libdir . -setup docwiki.setup -clean + PERL5LIB=. $(PERL) -I. $(extramodules) $(tflag) ikiwiki.in -setup docwiki.setup -clean rm -f *.man $(outprogs) ikiwiki.setup plugins/*.pyc $(MAKE) -C po clean diff --git a/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn b/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn index b11972165..7b252031b 100644 --- a/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn +++ b/doc/bugs/build_fails_oddly_when_older_ikiwiki_is_installed.mdwn @@ -24,3 +24,8 @@ if I first remove the old ikiwiki installation, nor does it fail with 3.20100403 or newer installed at /opt/ikiwiki. Hence this is not really a critical bug, although it's somewhat perplexing to me why it ought to make a difference. + +> So, using INSTALL_BASE causes a 'use lib' to be hardcoded into the `.out` +> files; which overrides the -libdir and the -I, and so the old version +> of IkiWiki.pm is used. +> [[fixed|done]] --[[Joey]] -- cgit v1.2.3 From 7e79da76332b93214a7d9a5c91bc046db4219ee2 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 23 Apr 2010 16:10:46 -0400 Subject: template docu reorg Remove wikitemplates page; fold its contents into templates page. Update all backlinks. Document new ability to put templates inside srcdir. --- doc/bugs/SSI_include_stripped_from_mdwn.mdwn | 2 +- doc/bugs/login_page_non-obvious_with_openid.mdwn | 4 +- doc/features.mdwn | 2 +- doc/freesoftware.mdwn | 2 +- doc/ikiwiki-calendar.mdwn | 2 +- doc/ikiwiki/directive/edittemplate.mdwn | 2 +- doc/ikiwiki/directive/pagetemplate.mdwn | 8 +- doc/ikiwiki/directive/template.mdwn | 8 +- doc/plugins/autoindex.mdwn | 2 +- doc/plugins/map/discussion.mdwn | 2 +- doc/plugins/pagetemplate.mdwn | 6 +- doc/plugins/template.mdwn | 4 +- doc/plugins/write.mdwn | 4 +- doc/templates.mdwn | 91 +++++++++++++++++++--- doc/tips/comments_feed.mdwn | 2 +- ...o-create_tag_pages_according_to_a_template.mdwn | 2 +- doc/todo/auto_rebuild_on_template_change.mdwn | 2 +- doc/todo/html.mdwn | 2 +- doc/todo/multiple_templates.mdwn | 2 +- doc/usage.mdwn | 5 +- doc/wikitemplates.mdwn | 52 ------------- doc/wikitemplates/discussion.mdwn | 46 ----------- 22 files changed, 111 insertions(+), 141 deletions(-) delete mode 100644 doc/wikitemplates.mdwn delete mode 100644 doc/wikitemplates/discussion.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn index 5519e45c6..270da86d3 100644 --- a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn +++ b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn @@ -10,7 +10,7 @@ If I have a <--#include virtual="foo" --> in some file, it gets stripped, > Anyway, it makes sense for the htmlscrubber to strip server-side > includes because otherwise your wiki could be attacked > by them being added to it. If you want to use both the htmlscrubber and -> SSI together, I'd suggest you modify the [[wikitemplates]] +> SSI together, I'd suggest you modify the [[templates]] > and put the SSI on there. > > Ie, `page.tmpl` has a diff --git a/doc/bugs/login_page_non-obvious_with_openid.mdwn b/doc/bugs/login_page_non-obvious_with_openid.mdwn index 1d087985a..9aa702037 100644 --- a/doc/bugs/login_page_non-obvious_with_openid.mdwn +++ b/doc/bugs/login_page_non-obvious_with_openid.mdwn @@ -36,7 +36,7 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > that allows modifying that form, but does not allow creating a separate > form. The best way to make it obvious how to use it currently is to just > disable password auth, then it's nice and simple. :-) Javascript is an -> interesting idea. It's also possible to write a custom [[signin.tmpl wikitemplates]] that +> interesting idea. It's also possible to write a custom [[templates]] that > is displayed instead of the regular signin form, and it should be > possible to use that to manually lay it out better than FormBuilder > manages with its automatic layout. --[[Joey]] @@ -44,4 +44,4 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > I've improved the form, I think it's more obvious now that the openid > stuff is separate. Good enough to call this [[done]]. I think. --[[Joey]] ->> Looks good, thanks! :-) -- [[AdamShand]] \ No newline at end of file +>> Looks good, thanks! :-) -- [[AdamShand]] diff --git a/doc/features.mdwn b/doc/features.mdwn index ab521213d..07ce648ea 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). Ikiwiki -generates html using [[templates|wikitemplates]], and uses [[css]], so you +generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. ## [[Plugins]] diff --git a/doc/freesoftware.mdwn b/doc/freesoftware.mdwn index 7ac1ac6b4..2243d9b1f 100644 --- a/doc/freesoftware.mdwn +++ b/doc/freesoftware.mdwn @@ -4,7 +4,7 @@ ikiwiki, and this documentation wiki, are licensed under the terms of the GNU [[GPL]], version 2 or later. The parts of ikiwiki that become part of your own wiki (the [[basewiki]] -pages (but not the smilies) and the [[templates|wikitemplates]]) are licensed +pages (but not the smilies) and the [[templates]]) are licensed as follows: > Redistribution and use in source and compiled forms, with or without diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn index c1f4d7267..03cbdd86c 100644 --- a/doc/ikiwiki-calendar.mdwn +++ b/doc/ikiwiki-calendar.mdwn @@ -43,7 +43,7 @@ An example crontab: # TEMPLATES -This command uses two [[template|wikitemplates]] to generate +This command uses two [[templates]] to generate the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. # AUTHOR diff --git a/doc/ikiwiki/directive/edittemplate.mdwn b/doc/ikiwiki/directive/edittemplate.mdwn index d731bdb47..c486e821b 100644 --- a/doc/ikiwiki/directive/edittemplate.mdwn +++ b/doc/ikiwiki/directive/edittemplate.mdwn @@ -21,7 +21,7 @@ something like: Details: The template page can also contain [[!cpan HTML::Template]] directives, -similar to other ikiwiki [[templates]]. Currently only one variable is +like other ikiwiki [[templates]]. Currently only one variable is set: `<TMPL_VAR name>` is replaced with the name of the page being created. diff --git a/doc/ikiwiki/directive/pagetemplate.mdwn b/doc/ikiwiki/directive/pagetemplate.mdwn index 8ad901c1a..401b38099 100644 --- a/doc/ikiwiki/directive/pagetemplate.mdwn +++ b/doc/ikiwiki/directive/pagetemplate.mdwn @@ -1,17 +1,13 @@ The `pagetemplate` directive is supplied by the [[!iki plugins/pagetemplate desc=pagetemplate]] plugin. -This directive allows a page to be displayed using a different template than -the default `page.tmpl` template. +This directive allows a page to be displayed using a different +[[template|templates]] than the default `page.tmpl` template. The page text is inserted into the template, so the template controls the overall look and feel of the wiki page. This is in contrast to the [[ikiwiki/directive/template]] directive, which allows inserting templates _into_ the body of a page. -This directive can only reference templates that are already installed -by the system administrator, typically into the -`/usr/share/ikiwiki/templates` directory. Example: - \[[!pagetemplate template="my_fancy.tmpl"]] [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index ae71ba5b5..052ca7873 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -1,7 +1,11 @@ The `template` directive is supplied by the [[!iki plugins/template desc=template]] plugin. -[[Templates]] are files that can be filled out and inserted into pages in the -wiki, by using the template directive. The directive has an `id` parameter +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. The [[templates]] page lists templates +that can be used with this directive. + +The directive has an `id` parameter that identifies the template to use. The remaining parameters are used to fill out the template. diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn index d1133e4f5..7c4e40419 100644 --- a/doc/plugins/autoindex.mdwn +++ b/doc/plugins/autoindex.mdwn @@ -3,5 +3,5 @@ This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent page, and generates the parent pages. The generated page content is -controlled by the `autoindex.tmpl` [[template|wikitemplates]], which by +controlled by the `autoindex.tmpl` [[template|templates]], which by default, uses a [[map]] to list the SubPages. diff --git a/doc/plugins/map/discussion.mdwn b/doc/plugins/map/discussion.mdwn index 2f7b140d6..54c921b0f 100644 --- a/doc/plugins/map/discussion.mdwn +++ b/doc/plugins/map/discussion.mdwn @@ -1,7 +1,7 @@ I'm wanting a [[map]] (with indentation levels) showing page _titles_ instead of page 'names'. As far as I can see, this is not an option with existing plugins - I can get a list of pages using [[inline]] and -appropriate [[wikitemplates]], but that has no indentation and therefore +appropriate [[templates]], but that has no indentation and therefore doesn't show structure well. The quick way is to modify the map plugin to have a 'titles' option. The diff --git a/doc/plugins/pagetemplate.mdwn b/doc/plugins/pagetemplate.mdwn index 53f069d0d..8254e14c5 100644 --- a/doc/plugins/pagetemplate.mdwn +++ b/doc/plugins/pagetemplate.mdwn @@ -3,8 +3,4 @@ This plugin provides the [[ikiwiki/directive/pagetemplate]] [[ikiwiki/directive]], which allows a page to be displayed -using a different [[template|wikitemplates]] than the default. - -This plugin can only use templates that are already installed in -`/usr/share/ikiwiki/templates` (or wherever ikiwiki is configured to look for -them). You can choose to use any .tmpl files in that directory. +using a different [[template|templates]] than the default. diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index da775f232..8d17e2825 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -3,5 +3,5 @@ This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out -and inserted into pages in the wiki. It's documented and existing templates -are listed in the [[templates]] page. +and inserted into pages in the wiki. Existing templates are listed in the +[[templates]] page. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 00b54bdd3..9128c7f54 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -297,7 +297,7 @@ value is ignored. hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); -[[Templates|wikitemplates]] are filled out for many different things in +[[Templates]] are filled out for many different things in ikiwiki, like generating a page, or part of a blog page, or an rss feed, or a cgi. This hook allows modifying the variables available on those templates. The function is passed named parameters. The "page" and @@ -313,7 +313,7 @@ a new custom parameter to the template. hook(type => "templatefile", id => "foo", call => \&templatefile); -This hook allows plugins to change the [[template|wikitemplates]] that is +This hook allows plugins to change the [[template|templates]] that is used for a page in the wiki. The hook is passed a "page" parameter, and should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default diff --git a/doc/templates.mdwn b/doc/templates.mdwn index f2b581d2f..f7b3adae5 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,17 +1,88 @@ -[[!meta robots="noindex, follow"]] -[[!if test="enabled(template)" -then="This wiki has templates **enabled**." -else="This wiki has templates **disabled**." -]] +[[Ikiwiki]] uses many templates for many purposes. By editing its templates, +you can fully customise this site. -Templates are files that can be filled out and inserted into pages in the -wiki. +[[!if test="enabled(template)" then=""" +## The template directive +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. +"""]] [[!if test="enabled(template) and enabled(inline)" then=""" - -These templates are available for use with the template directive. - [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] + +[[!if test="enabled(edittemplate)" then=""" +## The edittemplate directive + +The edittemplate directive can be used to make new pages default to +containing text from a template, which can be filled as out the page is +edited. +"""]] + +## Wiki templates + +These templates are used to build the wiki. The aim is to keep almost all +html out of ikiwiki and in the templates. + +* `page.tmpl` - Used for displaying all regular wiki pages. +* `misc.tmpl` - Generic template used for any page that doesn't + have a custom template. +* `editpage.tmpl` - Create/edit page. +* `change.tmpl` - Used to create a page describing a change made to the wiki. +* `passwordmail.tmpl` - Not a html template, this is used to + generate a mail with an url the user can use to reset their password. +* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. +* `rssitem.tmpl` - Used for generating individual items on rss feeds. +* `atompage.tmpl` - Used for generating atom feeds for blogs. +* `atomitem.tmpl` - Used for generating individual items on atom feeds. +* `inlinepage.tmpl` - Used for adding a page inline in a blog + page. +* `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `microblog.tmpl` - Used for showing a microblogging post inline. +* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) +* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. +* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create + a page for a post. +* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search + form to wiki pages. +* `searchquery.tmpl` - This is an omega template, used by the + [[plugins/search]] plugin. +* `comment.tmpl` - This template is used to display a comment + by the [[plugins/comments]] plugin. +* `editcomment.tmpl` - This template is the comment post form for the + [[plugins/comments]] plugin. +* `commentmoderation.tmpl` - This template is used to produce the comment + moderation form. +* `recentchanges.tmpl` - This template is used for listing a change + on the RecentChanges page. + +[[!if test="enabled(pagetemplate)" then=""" +## The pagetemplate directive + +The pagetemplate directive can allow individual pages to use a +different template than `page.tmpl`. +"""]] + +## Template locations + +Templates are located in `/usr/share/ikiwiki/templates` by default; +the `templatedir` setting can be used to make another directory be +searched first. Customized templates can also be placed inside the +"templates/" directory in your wiki's source. + +## Template syntax + +Ikiwiki uses the HTML::Template module as its template engine. This +supports things like conditionals and loops in templates and is pretty easy +to learn. All you really need to know are a few things: + +* To insert the value of a template variable, use `<TMPL_VAR variable>`. +* To make a block of text conditional on a variable being set use + `<TMPL_IF NAME="variable">text</TMPL_IF>`. +* To use one block of text if a variable is set and a second if it's not, + use `<TMPL_IF NAME="variable">text<TMPL_ELSE>other text</TMPL_IF>` + +[[!meta robots="noindex, follow"]] diff --git a/doc/tips/comments_feed.mdwn b/doc/tips/comments_feed.mdwn index 6f8137256..6d4dbb803 100644 --- a/doc/tips/comments_feed.mdwn +++ b/doc/tips/comments_feed.mdwn @@ -6,5 +6,5 @@ add a feed that contains all the comments posted to any page. Here's how: \[[!inline pages="internal(*/comment_*)" template=comment]] The special [[ikiwiki/PageSpec]] matches all comments. The -[[template|wikitemplates]] causes the comments to be displayed formatted +[[template|templates]] causes the comments to be displayed formatted nicely. diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index f6d444890..7eb404910 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -17,7 +17,7 @@ The new tag file is then complied during the change phase. *see git history of this page if you want the patch --[[smcv]]* -This uses a [[template|wikitemplates]] called `autotagpage.tmpl`, here is my template file: +This uses a [[template|templates]] called `autotagpage.tmpl`, here is my template file: \[[!inline pages="link(<TMPL_VAR TAG>)" archive="yes"]] diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index a112cb9da..838d15c1a 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -6,7 +6,7 @@ This would allow setting: templatedir => "$srcdir/templates", -.. and then the [[wikitemplates]] are managed like other wiki files; and +.. and then the [[templates]] are managed like other wiki files; and like other wiki files, a change to them automatically updates dependent pages. diff --git a/doc/todo/html.mdwn b/doc/todo/html.mdwn index 44f20c876..4f4542be2 100644 --- a/doc/todo/html.mdwn +++ b/doc/todo/html.mdwn @@ -1,6 +1,6 @@ Create some nice(r) stylesheets. Should be doable w/o touching a single line of code, just -editing the [[wikitemplates]] and/or editing [[style.css]]. +editing the [[templates]] and/or editing [[style.css]]. [[done]] ([[css_market]] ..) diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 72783c556..30fb8d6ee 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -1,4 +1,4 @@ -> Another useful feature might be to be able to choose a different [[template|wikitemplates]] +> Another useful feature might be to be able to choose a different [[template|templates]] > file for some pages; [[blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 2e12517ea..9cf61cc6c 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -120,10 +120,11 @@ also be configured using a setup file. * --templatedir dir - Specify the directory that the page [[templates|wikitemplates]] are stored in. + Specify the directory that [[templates|templates]] are stored in. Default is `/usr/share/ikiwiki/templates`, or another location as configured at build time. If the templatedir is changed, missing templates will still - be searched for in the default location as a fallback. + be searched for in the default location as a fallback. Templates can also be + placed in the "templates/" subdirectory of the srcdir. Note that if you choose to copy and modify ikiwiki's templates, you will need to be careful to keep them up to date when upgrading to new versions of diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn deleted file mode 100644 index 6e5a7261d..000000000 --- a/doc/wikitemplates.mdwn +++ /dev/null @@ -1,52 +0,0 @@ -ikiwiki uses the HTML::Template module as its template engine. This -supports things like conditionals and loops in templates and is pretty easy -to learn. - -The aim is to keep almost all html out of ikiwiki and in the templates. - -It ships with some basic templates which can be customised. These are -located in `/usr/share/ikiwiki/templates` by default; the `templatedir` -setting can be used to make another directory be searched first. - -* `page.tmpl` - Used for displaying all regular wiki pages. -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. -* `editpage.tmpl` - Create/edit page. -* `change.tmpl` - Used to create a page describing a change made to the wiki. -* `passwordmail.tmpl` - Not a html template, this is used to - generate a mail with an url the user can use to reset their password. -* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. -* `rssitem.tmpl` - Used for generating individual items on rss feeds. -* `atompage.tmpl` - Used for generating atom feeds for blogs. -* `atomitem.tmpl` - Used for generating individual items on atom feeds. -* `inlinepage.tmpl` - Used for adding a page inline in a blog - page. -* `archivepage.tmpl` - Used for listing a page in a blog archive page. -* `microblog.tmpl` - Used for showing a microblogging post inline. -* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) -* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. -* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create - a page for a post. -* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search - form to wiki pages. -* `searchquery.tmpl` - This is an omega template, used by the - [[plugins/search]] plugin. -* `comment.tmpl` - This template is used to display a comment - by the [[plugins/comments]] plugin. -* `editcomment.tmpl` - This template is the comment post form for the - [[plugins/comments]] plugin. -* `commentmoderation.tmpl` - This template is used to produce the comment - moderation form. -* `recentchanges.tmpl` - This template is used for listing a change - on the RecentChanges page. - -The [[plugins/pagetemplate]] plugin can allow individual pages to use a -different template than `page.tmpl`. - -The [[plugins/template]] plugin also uses templates, though those -[[templates]] are typically stored as pages in the wiki, and are inserted -into pages. - -The [[plugins/edittemplate]] plugin is used to make new pages default to -containing text from a template, which can be filled as out the page is -edited. diff --git a/doc/wikitemplates/discussion.mdwn b/doc/wikitemplates/discussion.mdwn deleted file mode 100644 index f97444e5f..000000000 --- a/doc/wikitemplates/discussion.mdwn +++ /dev/null @@ -1,46 +0,0 @@ -## Place for local templates -Where does one put any locally modified templates for an individual ikiwiki? --Ivan Z. - -> You can put them whereever you like; the `templatedir` controls -> where ikiwiki looks for them. --[[Joey]] - -Thank you for your response! My question arose out of my intention to make -custom templates for a wiki--specifically suited for the kind of content -it will have--so, that would mean I would want to distribute them through -git together with other content of the wiki. So, for this case the -separation of conceptually ONE thing (the content, the templates, and the -config option which orders to use these templates) into THREE separate -files/repos (the main content repo, the repo with templates, and the config -file) is not convenient: instead of distributing a single repo, I have to -tell people to take three things if they want to replicate this wiki. How -would you solve this inconvenience? Perhaps, a default location of the -templates *inside* the source repo would do?--Ivan Z. - -> I would avoid putting the templates in a subdirectory of the ikiwiki srcdir. -> (I'd also avoid putting the ikiwiki setup file there.) -> While it's safe to do either in some cases, there are configurations where -> it's unsafe. For example, a malicious user could use attachment handling to -> replace those files with their own, bad versions. -> -> So, two ideas for where to put the templatedir and ikiwiki setup. - -> * The easiest option is to put your wiki content in a subdirectory -> ("wiki", say) and point `srcdir` at that. -> then you can have another subdirectory for the wikitemplates, -> and put the setup file at the top. -> * Another option if using git would be to have a separate branch, -> in the same git repository, that holds wikitemplates and the setup file. -> Then you check out the repository once to make the `srcdir` available, -> and have a second checkout, of the other branch, to make the other stuff -> available. -> -> Note that with either of these methods, you have to watch out if -> giving other direct commit access to the repository. They could -> still edit the setup file and templates, so only trusted users should -> be given access. (It is, however, perfectly safe to let people edit -> the wiki via the web, and is even safe to configure -> [[tips/untrusted_git_push]] to such a repository.) --[[Joey]] - -Thanks, that's a nice and simple idea: to have a subdirectory! I'll try it. --Ivan Z. - -A [[!taglink wish|wishlist]]: the ikiwiki program could be improved so that it follows the same logic as git in looking for its config: it could ascend directories until it finds an `.ikiwiki/` directory with `.ikiwiki/setup` and then uses that configuration. Now I'm tired to always type `ikiwiki --setup path/to/the/setup --refresh` when working in my working clone of the sources; I'd like to simply type `ikiwiki` instead, and let it find the setup file. The default location to look for templates could also be made to be a sibling of the setup file: `.ikiwiki/templates/`. --Ivan Z. -- cgit v1.2.3 From 9fb15ec9fec8903776be0be01eaed0e7bb7d5009 Mon Sep 17 00:00:00 2001 From: Jon Dowland <jmtd@debian.org> Date: Fri, 30 Apr 2010 16:48:19 +0100 Subject: new bug: svn commit failures... --- ...vn_commit_failures_interpreted_as_merge_conflicts.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn b/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn new file mode 100644 index 000000000..09753b4ee --- /dev/null +++ b/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn @@ -0,0 +1,15 @@ +I'm attempting a merge with the SVN plugin via the web interface +with ikiwiki-3.20100403 and subversion 1.6.11. + +The web interface says + + Your changes conflict with other changes made to the page. + + Conflict markers have been inserted into the page content. Reconcile the conflict and commit again to save your changes. + +However there are no merge conflict markers in the page. My apache error log says: + + [Fri Apr 30 16:43:57 2010] [error] [client 10.64.64.42] svn: Commit failed (details follow):, referer: https://unixwiki.ncl.ac.uk/ikiwiki.cgi + [Fri Apr 30 16:43:57 2010] [error] [client 10.64.64.42] svn: Authorization failed, referer: https://unixwiki.ncl.ac.uk/ikiwiki.cgi + +-- [[Jon]] -- cgit v1.2.3 From dd75b61d9332e50364f97fc04179ab895bfc2ef8 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 30 Apr 2010 14:15:58 -0400 Subject: response --- doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn b/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn index 09753b4ee..0c9bce4b9 100644 --- a/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn +++ b/doc/bugs/svn_commit_failures_interpreted_as_merge_conflicts.mdwn @@ -13,3 +13,9 @@ However there are no merge conflict markers in the page. My apache error log say [Fri Apr 30 16:43:57 2010] [error] [client 10.64.64.42] svn: Authorization failed, referer: https://unixwiki.ncl.ac.uk/ikiwiki.cgi -- [[Jon]] + +> Only way for this to be improved would be for the svn plugin to +> explicitly check the file for conflict markers. I guess it could +> change the error message then, but the actual behavior of putting the +> changed file back in the editor so the user can recommit is about right +> as far as error recovery goes. --[[Joey]] -- cgit v1.2.3 From 3252df4aa8a35495bbaa8280ca13a545285e6192 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sat, 1 May 2010 15:27:32 -0400 Subject: comments, branch review, questions --- doc/bugs/html5_support.mdwn | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 239474275..5d2a41303 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -9,10 +9,67 @@ HTML5](http://www.w3.org/TR/html5-diff/). * [ikiwiki instance with HTML5 templates](http://natalian.org) * [HTML5 outliner tool](http://gsnedders.html5.org/outliner/) -- to check you have the structure of your markup correct +> Kai, thanks enormously for working on this. I switched a page to +> the html5 doctype today, and was rather pleasently suprised that it +> validated, except for the new Cache-Control meta tag. Now I see you're +> well ahead of me. --[[Joey]] +> +> So, how should ikiwiki support html5? There are basically 3 approaches: +> +> 1. Allow users to add html5 tags to their existing xhtml pages. +> 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 +> 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 +> your branch. You made only relatively minor changes to 10 templates. +> It would probably not be too dreadful to put them in ifdefs. +> +> Some of your changes are obvious, like using the new `time` and +> and `article` elements. Others less so, and I'm particularly +> puzzled by these: +> +> * Removing the value="Submit" from the button on the +> commentmoderation form. +> * Removing feedlink.tmpl. What?! +> * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather +> than the styled span. Ikiwiki has +> [[a_reason|todo/Option_to_make_title_an_h1?]] for not +> using real `hN` for the header atop a page and here. +> AFAICS, html5 does not invalidate that. +> * Removing Editurl from inlinepage.tmpl actions. I assume +> this is your own preference, needs to be removed from branch +> before I can use it. +> * Removing the pageheader, content, and footer divs +> which are all used by style.css. +> Perhaps, the style sheet needs to be updated to use +> the new elements, like the `footer` and `header`. +> * Removal of the favicon from page.tmpl. Surely html5 supports? +> * Removal of BASEURL from page.tmpl, apparently a mistake. +> * Removal of the `/` between wiki title and page title. +> Personal preference. +> * Removal of `comments` div, which is there to be styled. +> * Why use a `p` rather than the `div` for `addcomments`? +> * Moving the action bar to the bottom of the page. +> Personal preference. +> * Clearly searchquery.tmpl has no business using bad old `center` +> 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]] + # 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. Others, like `embed`, and `canvas` are *scary*. --[[Joey]] + # HTML5 Validation and t/html.t [validator.nu](http://validator.nu/) is the authorative HTML5 validator, @@ -25,6 +82,9 @@ In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG schema](http://syntax.whattf.org/) using a Debian package tool [rnv](http://packages.qa.debian.org/r/rnv.html). +> Validation in the test suite is nice, but I am willing to lose those +> tests for a while. --[[Joey]] + # HTML5 migration issues # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element @@ -45,3 +105,6 @@ As a workaround: au:~% grep timeformat natalian.setup timeformat => '%Y-%m-%d', + +> Also, the [[plugins/relativedate]] plugin needs to be updated to +> support relatatizing the contents of time elements. --[[Joey]] -- cgit v1.2.3 From 80f2042464f9d14bcaed999e9769c71618bf5252 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 78cee5140ac37f93cd2e87d8a03d71420303eb13 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <hr /> 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<TMPL_IF HTML5><!DOCTYPE html> +<html> +<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> +</TMPL_IF> <head> <TMPL_IF NAME="FORCEBASEURL"> <base href="<TMPL_VAR FORCEBASEURL>" /> 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 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<TMPL_IF HTML5><!DOCTYPE html> +<html> +<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> +</TMPL_IF> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Cache-Control" content="must-revalidate" /> -- cgit v1.2.3 From 8e4af6a8e2a8e8d9b7d9f4312c4216261ebd5a28 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sat, 1 May 2010 20:57:54 -0400 Subject: tidy plugin issue --- doc/bugs/html5_support.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index bf782a3bf..dca60d57e 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -132,3 +132,7 @@ As a workaround: > Also, the [[plugins/relativedate]] plugin needs to be updated to > support relatatizing the contents of time elements. --[[Joey]] + +## tidy plugin + +Will reformat html5 to html4. -- cgit v1.2.3 From 970373548fda77223ebbeb6aadbdbe4884b67cef Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 13:44:13 -0400 Subject: Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. --- IkiWiki.pm | 22 ++++++++++++++++++++-- IkiWiki/Plugin/comments.pm | 2 +- IkiWiki/Plugin/inline.pm | 12 +----------- IkiWiki/Plugin/relativedate.pm | 15 ++++++++++++--- IkiWiki/Render.pm | 2 +- debian/changelog | 7 +++++++ doc/bugs/html5_support.mdwn | 3 +++ doc/plugins/write.mdwn | 5 ++++- 8 files changed, 49 insertions(+), 19 deletions(-) (limited to 'doc/bugs') 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 '<span class="date">'.formattime(@_).'</span>'; + my $time=formattime($_[0], $_[1]); + if ($config{html5}) { + return '<time datetime="'.date_3339($_[0]).'"'. + ($_[2] ? ' pubdate' : ''). + '>'.$time.'</time>'; + } + else { + return '<span class="date">'.$time.'</span>'; + } } 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"></script>'; } -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 '<span class="relativedate" title="'.$gmtime.'">'. - IkiWiki::formattime($time, $format).'</span>'; + my $mid=' class="relativedate" title="'.$gmtime.'">'. + IkiWiki::formattime($time, $format); + + if ($config{html5}) { + return '<time datetime="'.IkiWiki::date_3339($time).'"'. + ($pubdate ? ' pubdate' : '').$mid.'</time>'; + } + else { + return '<span'.$mid.'</span>'; + } } 1 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 5923f5e74..cf6943e7d 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -136,7 +136,7 @@ sub genpage ($$) { backlinks => $backlinks, more_backlinks => $more_backlinks, mtime => displaytime($pagemtime{$page}), - ctime => displaytime($pagectime{$page}), + ctime => displaytime($pagectime{$page}, undef, 1), baseurl => baseurl($page), html5 => $config{html5}, ); diff --git a/debian/changelog b/debian/changelog index 6962e5171..8158429a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100502) UNRELEASED; urgency=low + + * Add parameter to displaytime to specify that it is a pubdate, + and in html5 mode, use time tag. + + -- Joey Hess <joeyh@debian.org> Sun, 02 May 2010 13:22:50 -0400 + ikiwiki (3.20100501) unstable; urgency=low * TMPL_INCLUDE re-enabled for templates read from the templatedir. diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index dca60d57e..386a3094a 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -133,6 +133,9 @@ As a workaround: > Also, the [[plugins/relativedate]] plugin needs to be updated to > support relatatizing the contents of time elements. --[[Joey]] +> Done and done; in html5 mode it uses the time tag, and even +> adds pubdate when displaying ctimes. --[[Joey]] + ## tidy plugin Will reformat html5 to html4. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index a9ea7db73..5e7042c3b 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -938,13 +938,16 @@ search for files. If the directory name is not absolute, ikiwiki will assume it is in the parent directory of the configured underlaydir. -### `displaytime($;$)` +### `displaytime($;$$)` Given a time, formats it for display. The optional second parameter is a strftime format to use to format the time. +If the third parameter is true, this is the publication time of a page. +(Ie, set the html5 pubdate attribute.) + ### `gettext` This is the standard gettext function, although slightly optimised. -- cgit v1.2.3 From b21df5029b94c5680d8a3e5f0c1ed40a660a1594 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 13:49:56 -0400 Subject: Add placeholder text in search form (in html5 mode only). --- IkiWiki/Plugin/google.pm | 1 + IkiWiki/Plugin/search.pm | 1 + debian/changelog | 1 + doc/bugs/html5_support.mdwn | 3 --- doc/todo/Add_label_to_search_form_input_field.mdwn | 2 ++ templates/googleform.tmpl | 3 ++- templates/searchform.tmpl | 3 ++- 7 files changed, 9 insertions(+), 5 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 85467fa0b..68cde261c 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -42,6 +42,7 @@ sub pagetemplate (@) { if (! defined $form) { my $searchform = template("googleform.tmpl", blind_cache => 1); $searchform->param(url => $config{url}); + $searchform->param(html5 => $config{html5}); $form=$searchform->output; } diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index be39fdf1e..9e875c79c 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -58,6 +58,7 @@ sub pagetemplate (@) { if (! defined $form) { my $searchform = template("searchform.tmpl", blind_cache => 1); $searchform->param(searchaction => $config{cgiurl}); + $searchform->param(html5 => $config{html5}); $form=$searchform->output; } diff --git a/debian/changelog b/debian/changelog index 8158429a0..c9fc2e657 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low * Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. + * Add placeholder text in search form (in html5 mode only). -- Joey Hess <joeyh@debian.org> Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 386a3094a..5530b29db 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -64,11 +64,8 @@ HTML5](http://www.w3.org/TR/html5-diff/). > > Other ideas: > -> * 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]] > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) > 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 281ab48e2..514108fba 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,6 @@ 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]] +>> [[Done]], placeholder added, in html5 mode only. + [[!tag wishlist bugs/html5_support]] diff --git a/templates/googleform.tmpl b/templates/googleform.tmpl index bcf1004a4..f39b46540 100644 --- a/templates/googleform.tmpl +++ b/templates/googleform.tmpl @@ -1,6 +1,7 @@ <form method="get" action="http://www.google.com/search" id="searchform"> <div> <input name="sitesearch" value="<TMPL_VAR URL>" type="hidden" /> - <input name="q" value="" id="searchbox" size="16" maxlength="255" type="text" /> + <input name="q" value="" id="searchbox" size="16" maxlength="255" type="text" + <TMPL_IF HTML5>placeholder="search"</TMPL_IF> /> </div> </form> diff --git a/templates/searchform.tmpl b/templates/searchform.tmpl index afae2ebf5..cb65d124c 100644 --- a/templates/searchform.tmpl +++ b/templates/searchform.tmpl @@ -1,5 +1,6 @@ <form method="get" action="<TMPL_VAR SEARCHACTION>" id="searchform"> <div> -<input type="text" id="searchbox" name="P" value="" size="16" /> +<input type="text" id="searchbox" name="P" value="" size="16" +<TMPL_IF HTML5>placeholder="search"</TMPL_IF> /> </div> </form> -- cgit v1.2.3 From 7517d34da928bb9612c65fcde87cc434b7b7d653 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 15:09:15 -0400 Subject: update --- doc/bugs/html5_support.mdwn | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 5530b29db..ef0ec1e70 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -30,40 +30,11 @@ HTML5](http://www.w3.org/TR/html5-diff/). > 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 -> puzzled by these: -> -> * Removing the value="Submit" from the button on the -> commentmoderation form. -> * Removing feedlink.tmpl. What?! -> * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather -> than the styled span. Ikiwiki has -> [[a_reason|todo/Option_to_make_title_an_h1?]] for not -> using real `hN` for the header atop a page and here. -> AFAICS, html5 does not invalidate that. -> * Removing Editurl from inlinepage.tmpl actions. I assume -> this is your own preference, needs to be removed from branch -> before I can use it. -> * Removing the pageheader, content, and footer divs -> which are all used by style.css. -> Perhaps, the style sheet needs to be updated to use -> the new elements, like the `footer` and `header`. -> * Removal of the favicon from page.tmpl. Surely html5 supports? -> * Removal of BASEURL from page.tmpl, apparently a mistake. -> * Removal of the `/` between wiki title and page title. -> Personal preference. -> * Removal of `comments` div, which is there to be styled. -> * Why use a `p` rather than the `div` for `addcomments`? -> * Moving the action bar to the bottom of the page. -> Personal preference. -> * Clearly searchquery.tmpl has no business using bad old `center` -> 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.) -> +> and `article` elements. Looks like I can't merge it as-is though +> due to other changes. +> > Other ideas: -> +> > * Use aside for the sidebar? Or for the [[templates/note]] template? > * Use nav for the actionbar > * Use details tag instead of the javascript in the toggle plugin. -- cgit v1.2.3 From 28dcb52a6c5b60302db285a13bf84e5e90c39cbc Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 16:54:31 -0400 Subject: force article and header to display as blocks iceweasel 3.5.9 does not know to display these as blocks, resulting in bad displays of blogs --- doc/bugs/html5_support.mdwn | 11 +++++------ doc/style.css | 7 +++++++ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index ef0ec1e70..0b15e64f6 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -29,14 +29,11 @@ HTML5](http://www.w3.org/TR/html5-diff/). > 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. Looks like I can't merge it as-is though -> due to other changes. -> +> I've made ikiwiki use the time element and all the new semantic elements +> in html5 mode. +> > Other ideas: > -> * Use aside for the sidebar? Or for the [[templates/note]] template? -> * Use nav for the actionbar > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) > @@ -89,6 +86,8 @@ This element is poorly supported by browsers. As a workaround, `style.css` needs Internet Explorer will display it as a block, though you can't seem to be able to further control the style. +> done (needed for header too) --[[Joey]] + ## Time element The [time element](http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element) ideally needs the datatime= attribute set by a template variable with what [HTML5 defines as a valid datetime string](http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#valid-global-date-and-time-string). diff --git a/doc/style.css b/doc/style.css index ea18ca0c3..82de8fe6e 100644 --- a/doc/style.css +++ b/doc/style.css @@ -4,6 +4,13 @@ * local.css and use it to override or change settings in this one. */ +article { + display: block; +} +header { + display: block; +} + .header { margin: 0; font-size: 22px; -- cgit v1.2.3 From 34076e398cb7662e3bf0659d591faa4208679882 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 17:16:15 -0400 Subject: html5 bug closure, and documentation --- doc/bugs/html5_support.mdwn | 6 ++++++ doc/features.mdwn | 2 +- doc/roadmap.mdwn | 2 +- doc/tips/html5.mdwn | 25 +++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 doc/tips/html5.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 0b15e64f6..3d1689301 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -106,3 +106,9 @@ As a workaround: ## tidy plugin Will reformat html5 to html4. + +---- + + +Ok, I consider this [[done]], at least as a first pass. Html5 mode +is experimental, but complete enough. --[[Joey]] diff --git a/doc/features.mdwn b/doc/features.mdwn index 215c1cecd..1f8168703 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). -(Experimental HTML5 support is also available.) +(Experimental [[tips/HTML5]] support is also available.) Ikiwiki generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 4b5f01c45..e257c21a2 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -80,7 +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..) +* [[tips/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/doc/tips/html5.mdwn b/doc/tips/html5.mdwn new file mode 100644 index 000000000..9321aa401 --- /dev/null +++ b/doc/tips/html5.mdwn @@ -0,0 +1,25 @@ +First, if you just want to embed videos using the html5 `<video>` tag, +you can do that without switching anything else to html5. +However, if you want to fully enter the brave new world of html5, read on.. + +Currently, ikiwiki does not use html5 by default. There is a `html5` +setting that can be turned on, in your setup file. Rebuild with it set, and +lots of fancy new semantic tags will be used all over the place. + +You may need to adapt your CSS for html5. While all the class and id names +are the same, some of the `div` elements are changed to other things. +Ikiwiki's default CSS will work in both modes. + +The html5 support is still experimental, and may break in some browsers. +No care is taken to add backwards compatability hacks for browsers that +are not html5 aware (like MSIE). If you want to include the javascript with +those hacks, you can edit `page.tmpl` to do so. +[Dive Into HTML5](http://diveintohtml5.org/) is a good reference for +current compatability issues and workarounds with html5. + +--- + +Known ikiwiki-specific issues: + +* [[plugins/htmltidy]] uses `tidy`, which is not html5 aware, so if you + have that enabled, it will mangle it back to html4. -- cgit v1.2.3 From bb70c15c598d1d35711369aa85cb39074beb64aa Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 18:55:21 -0400 Subject: on img and figure --- doc/bugs/html5_support.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 3d1689301..ba67d532b 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -36,6 +36,9 @@ HTML5](http://www.w3.org/TR/html5-diff/). > > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) +> * Use figure and figcaption for captions in img. However, I have not +> managed to style it to look as good as the current table+caption +> approach. > > --[[Joey]] -- cgit v1.2.3 From 78962ddfe6f4dcae29fa50fd4eb2a381c02bde87 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 2 May 2010 22:03:28 -0400 Subject: add bug --- doc/bugs/deletion_warnings.mdwn | 86 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 doc/bugs/deletion_warnings.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/deletion_warnings.mdwn b/doc/bugs/deletion_warnings.mdwn new file mode 100644 index 000000000..c8879379b --- /dev/null +++ b/doc/bugs/deletion_warnings.mdwn @@ -0,0 +1,86 @@ +Seen while deleting a blog's calendar pages: + +--[[Joey]] + +<pre> + 427250f..ff6c054 master -> origin/master +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. +Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/IkiWiki.pm line 668. +Use of uninitialized value $base in exists at /usr/share/perl5/IkiWiki.pm line 692. +</pre> + -- cgit v1.2.3 From 89e0669692eaf597596f1da36e8c385330c594ff Mon Sep 17 00:00:00 2001 From: Jon Dowland <jmtd@debian.org> Date: Tue, 4 May 2010 16:39:50 +0100 Subject: split two graphviz bugs from one page; undo one of them --- doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn | 23 +---------- ...Problems_with_graphviz.pm_plug-in_previews.mdwn | 46 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn index c9f698158..bc80125ad 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn @@ -9,31 +9,12 @@ The graphviz.pm plug-in currently attempts to read PNG data in UTF-8 mode, which It also generates image URLs relative to the page being rendered, which means the URLs wont work when previewing a graph from the CGI script. +(preview bug split to [[Problems_with_graphviz.pm_plug-in_previews]]) + >> Here is an updated patch againt ikiwiki-2.5: >>> [[Applied|done]], thanks. --[[Joey]] - --- IkiWiki/Plugin/graphviz.pm.orig 2007-07-27 11:35:05.000000000 +0200 - +++ IkiWiki/Plugin/graphviz.pm 2007-07-27 11:36:02.000000000 +0200 - @@ -69,7 +69,12 @@ sub render_graph (\%) { - } - } - - - return "<img src=\"".urlto($dest, $params{page})."\" />\n"; - + if ($params{preview}) { - + return "<img src=\"".urlto($dest, "")."\" />\n"; - + } - + else { - + return "<img src=\"".urlto($dest, $params{page})."\" />\n"; - + } - } - - sub graph (@) { - - ->> --[[HenrikBrixAndersen]] - - The patch below fixes these two issues. --- graphviz.pm.orig Thu Jun 7 15:45:16 2007 diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn new file mode 100644 index 000000000..3b77a48bb --- /dev/null +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -0,0 +1,46 @@ +(split from [[Problems_with_graphviz.pm_plug-in]]) + +[graphviz] generates image URLs relative to the page being rendered, which means the URLs wont work when previewing a graph from the CGI script. + +>> Here is an updated patch againt ikiwiki-2.5: + +>>> Applied, thanks. --[[Joey]] + + --- IkiWiki/Plugin/graphviz.pm.orig 2007-07-27 11:35:05.000000000 +0200 + +++ IkiWiki/Plugin/graphviz.pm 2007-07-27 11:36:02.000000000 +0200 + @@ -69,7 +69,12 @@ sub render_graph (\%) { + } + } + + - return "<img src=\"".urlto($dest, $params{page})."\" />\n"; + + if ($params{preview}) { + + return "<img src=\"".urlto($dest, "")."\" />\n"; + + } + + else { + + return "<img src=\"".urlto($dest, $params{page})."\" />\n"; + + } + } + + sub graph (@) { + + +>> --[[HenrikBrixAndersen]] + +>>> Despite this patch I am still experiencing the problem. Normal page source for a graph contains: + + <div id="content"> + <p><img src="./graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + + </div> + +>>> preview contains + + <div id="preview"> + <p><img src="./demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + + </div> + +>>> I don't quite understand why, this makes sense from the CGI path (in my +>>> case from the root of the site). The browsers appear to be trying to fetch +>>> `/demo/diagrams/demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png` +>>> (i.e., prepending the required relpath twice). -- [[Jon]] -- cgit v1.2.3 From 7060a818c108de5b5e2b1c2aa617f5e926bd5f86 Mon Sep 17 00:00:00 2001 From: Jon Dowland <jmtd@debian.org> Date: Tue, 4 May 2010 16:43:22 +0100 Subject: un-escape escaped chevrons --- doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn index 3b77a48bb..283a6ef08 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -28,17 +28,17 @@ >>> Despite this patch I am still experiencing the problem. Normal page source for a graph contains: - <div id="content"> - <p><img src="./graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + <div id="content"> + <p><img src="./graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> - </div> + </div> >>> preview contains - <div id="preview"> - <p><img src="./demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + <div id="preview"> + <p><img src="./demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> - </div> + </div> >>> I don't quite understand why, this makes sense from the CGI path (in my >>> case from the root of the site). The browsers appear to be trying to fetch -- cgit v1.2.3 From 35bd43aea3e6694cb474fc2e784113194c6865ba Mon Sep 17 00:00:00 2001 From: "http://zwol.livejournal.com/" <http://zwol.livejournal.com/@web> Date: Tue, 4 May 2010 17:09:27 +0000 Subject: --- doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn new file mode 100644 index 000000000..bbf8c7cd7 --- /dev/null +++ b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn @@ -0,0 +1,17 @@ +I'm getting this error message when I refresh my wiki: + + $ hg commit -u me -m "Minor corrections" + refreshing wiki.. + scanning htmletc/moco-conf-rooms.mdwn + building htmletc/moco-conf-rooms.mdwn + Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.9/Text/Typography.pm line 542. + building sidebar.mdwn, which depends on htmletc/moco-conf-rooms + building contact.mdwn, which depends on sidebar + building 500.mdwn, which depends on sidebar + Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.9/Text/Typography.pm line 542. + building ceramics.mdwn, which depends on sidebar + building glossary.mdwn, which depends on sidebar + syntax error in pagespec "internal(glossary/comment_*)" + warning: post-commit hook exited with status 2 + +But there is no error if I use `ikiwiki --rebuild` to regenerate the whole thing. -- cgit v1.2.3 From ac2cc8f87d3dc0eefb5069fe1c9c189cd13fb33f Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 4 May 2010 16:22:27 -0400 Subject: response --- doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn index bbf8c7cd7..316ea7e9b 100644 --- a/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn +++ b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn @@ -15,3 +15,14 @@ I'm getting this error message when I refresh my wiki: warning: post-commit hook exited with status 2 But there is no error if I use `ikiwiki --rebuild` to regenerate the whole thing. + +> You neglect to say what version of ikiwiki this is, +> or give any information to reproduce the bug. +> +> My guess: A version older than 3.20100403, which included +> [this bugfix](http://git.ikiwiki.info/?p=ikiwiki;a=commitdiff;h=799b93d258bad917262ac160df74136f05d4a451), +> which could lead to incorrect "syntax error in pagespec" +> that only happened some of the time. +> +> (The Text::Typography warning seems probably unrelated.) +> --[[Joey]] -- cgit v1.2.3 From ab575a4b6985d38969069757bb374aa8f1013019 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 4 May 2010 16:54:58 -0400 Subject: graphviz: Fix display of preexisting images in preview mode. --- IkiWiki/Plugin/graphviz.pm | 7 +------ debian/changelog | 1 + doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index bec122076..c91c92fec 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -79,12 +79,7 @@ sub render_graph (\%) { } } - if ($params{preview}) { - return "<img src=\"".urlto($dest, "")."\" />\n"; - } - else { - return "<img src=\"".urlto($dest, $params{destpage})."\" />\n"; - } + return "<img src=\"".urlto($dest, $params{destpage})."\" />\n"; } sub graph (@) { diff --git a/debian/changelog b/debian/changelog index 9fb9607a3..31deaf9aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) * websetup: Only display Setup button on admins' preferences page. + * graphviz: Fix display of preexisting images in preview mode. -- Joey Hess <joeyh@debian.org> Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn index 283a6ef08..c77bbeeaf 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -44,3 +44,11 @@ >>> case from the root of the site). The browsers appear to be trying to fetch >>> `/demo/diagrams/demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png` >>> (i.e., prepending the required relpath twice). -- [[Jon]] + +>>>> Yeah, that patch may have been right once, but it's wrong now; +>>>> preview mode uses `<base>` to make urls work the same as they would +>>>> when viewing the html page. +>>>> +>>>> Perhaps this was not noticed for a while while because it only +>>>> shows up if previewing an *unchanged* graph on a page that has already +>>>> been built before. Fixed now. [[done]] --[[Joey]] -- cgit v1.2.3 From f0b83af9aadfb5c4755fe9079f1dc97112f49d95 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Thu, 6 May 2010 17:18:08 -0400 Subject: add --- doc/bugs/comments_not_searchable.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/bugs/comments_not_searchable.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/comments_not_searchable.mdwn b/doc/bugs/comments_not_searchable.mdwn new file mode 100644 index 000000000..72f7bf30f --- /dev/null +++ b/doc/bugs/comments_not_searchable.mdwn @@ -0,0 +1,17 @@ +The text of comments (and other internal pages) does not get indexed by the +search plugin. + +Search indexes content passed to the postscan hook. +Comments are inlined, but inline's speed hack avoids adding inlined +content to the page until the format hook. + +And hmm, that's somewhat desirable, because we don't want searches +to find content that is inlined onto another page. + +That suggests that the fix could be to call the postscan hook +for internal pages. + +However, the search postscan hook tells xapian the page url, +and uses `urlto($page)` to do it. And that won't work for +an internal page. Guess it could be modified to tell xapian the +permalink. --[[Joey]] -- cgit v1.2.3 From 121e2ffc2f25bf264a68d35e80a9386995fa9e5a Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Thu, 6 May 2010 23:07:08 -0400 Subject: Renamed postscan hook to indexhtml, to reflect its changed position. Probably only the search plugin uses it, so this seemed safe. --- IkiWiki/Plugin/search.pm | 2 +- IkiWiki/Plugin/skeleton.pm.example | 6 +++--- IkiWiki/Render.pm | 2 +- debian/changelog | 2 ++ doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn | 2 +- doc/plugins/po/discussion.mdwn | 2 +- doc/plugins/write.mdwn | 6 +++--- 7 files changed, 12 insertions(+), 10 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 9e875c79c..b1f4747fe 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -10,7 +10,7 @@ sub import { hook(type => "getsetup", id => "search", call => \&getsetup); hook(type => "checkconfig", id => "search", call => \&checkconfig); hook(type => "pagetemplate", id => "search", call => \&pagetemplate); - hook(type => "postscan", id => "search", call => \&index); + hook(type => "indexhtml", id => "search", call => \&index); hook(type => "delete", id => "search", call => \&delete); hook(type => "cgi", id => "search", call => \&cgi); } diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index a404e24af..34713c73b 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -20,7 +20,7 @@ sub import { hook(type => "scan", id => "skeleton", call => \&scan); hook(type => "htmlize", id => "skeleton", call => \&htmlize); hook(type => "sanitize", id => "skeleton", call => \&sanitize); - hook(type => "postscan", id => "skeleton", call => \&postscan); + hook(type => "indexhtml", id => "skeleton", call => \&indexhtml); hook(type => "format", id => "skeleton", call => \&format); hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate); hook(type => "templatefile", id => "skeleton", call => \&templatefile); @@ -118,10 +118,10 @@ sub sanitize (@) { return $params{content}; } -sub postscan (@) { +sub indexhtml (@) { my %params=@_; - debug("skeleton plugin running as postscan"); + debug("skeleton plugin running as indexhtml"); } sub format (@) { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e5ba0079b..30e3d4199 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -62,7 +62,7 @@ sub genpage ($$) { my $page=shift; my $content=shift; - run_hooks(postscan => sub { + run_hooks(indexhtml => sub { shift->(page => $page, content => $content); }); diff --git a/debian/changelog b/debian/changelog index 77fd13826..eb67c2bde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low * If you have a locally customised page.tmpl, it needs to be updated to set <base> when BASEURL or FORCEBAREURL is set. * Gave comment and page editing forms some CSS and accessability love. + * Renamed postscan hook to indexhtml, to reflect its changed position, + and typical use. -- Joey Hess <joeyh@debian.org> Wed, 05 May 2010 18:07:29 -0400 diff --git a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn index be14e5126..c6e3cd4fd 100644 --- a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn +++ b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn @@ -144,7 +144,7 @@ So, looking at your meta branch: --[[Joey]] has no title, then A will display the link as "B". Now page B is modified and a title is added. Nothing updates "A". The added overhead of rebuilding every page that links to B when B is - changed (as the `postscan` hook of the po plugin does) is IMHO a killer. + changed (as the `indexhtml` hook of the po plugin does) is IMHO a killer. That could be hundreds or thousands of pages, making interactive editing way slow. This is probably the main reason I had not attempted this whole thing myself. IMHO this calls for some kind of intellegent dependency diff --git a/doc/plugins/po/discussion.mdwn b/doc/plugins/po/discussion.mdwn index ab822e76c..27683f1ea 100644 --- a/doc/plugins/po/discussion.mdwn +++ b/doc/plugins/po/discussion.mdwn @@ -513,7 +513,7 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]] >>>> >>>>> Done. --[[intrigeri]] >>> -> * I'm very fearful of the `add_depends` in `postscan`. +> * I'm very fearful of the `add_depends` in `indexhtml`. > Does this make every page depend on every page that links > to it? Won't this absurdly bloat the dependency pagespecs > and slow everything down? And since nicepagetitle is given diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 3b1d770eb..7180237a4 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -39,7 +39,7 @@ built. Now that it knows what pages it needs to build, ikiwiki runs two compile passes. First, it runs `scan` hooks, which collect metadata about the pages. Then it runs a page rendering pipeline, by calling in turn these -hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `postscan`, +hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `indexhtml`, `pagetemplate`, `sanitize`, `format`. After all necessary pages are built, it calls the `change` hook. Finally, @@ -282,9 +282,9 @@ like `Makefile` that have no extension. If `hook` is passed an optional "longname" parameter, this value is used when prompting a user to choose a page type on the edit page form. -### postscan +### indexhtml - hook(type => "postscan", id => "foo", call => \&postscan); + hook(type => "indexhtml", id => "foo", call => \&indexhtml); This hook is called once the page has been converted to html (but before the generated html is put in a template). The most common use is to -- cgit v1.2.3 From 300001184ea60895de9a63537951c41b21486f11 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Thu, 6 May 2010 23:28:54 -0400 Subject: done --- doc/bugs/comments_not_searchable.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/comments_not_searchable.mdwn b/doc/bugs/comments_not_searchable.mdwn index 72f7bf30f..6fda89bd2 100644 --- a/doc/bugs/comments_not_searchable.mdwn +++ b/doc/bugs/comments_not_searchable.mdwn @@ -15,3 +15,5 @@ However, the search postscan hook tells xapian the page url, and uses `urlto($page)` to do it. And that won't work for an internal page. Guess it could be modified to tell xapian the permalink. --[[Joey]] + +> [[done]] --[[Joey]] -- cgit v1.2.3 From f9553a06ab0a13140c62a90a59c566faeedfa9d6 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" <http://smcv.pseudorandom.co.uk/@web> Date: Fri, 7 May 2010 16:56:45 +0000 Subject: patch --- doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn new file mode 100644 index 000000000..96bdab9cd --- /dev/null +++ b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn @@ -0,0 +1,11 @@ +[[!tag patch]] +[[!template id=gitbranch branch=smcv/ready/no-tags author="[[smcv]]"]] + +The `gitremotes` script picks up tags from any repository, including those +used for local .debs that were never actually present in Debian: + + smcv@reptile% git tag | grep -c nmu + 52 + +This can be avoided with the `tagopt = --no-tags` option in .git/config; +see <http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/ready/no-tags> -- cgit v1.2.3 From 5dfcaf1f7f3c2ae8304465bdc10bd82bb862fa09 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 7 May 2010 13:04:00 -0400 Subject: applied --- doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn index 96bdab9cd..eb37aee1b 100644 --- a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn +++ b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn @@ -9,3 +9,5 @@ used for local .debs that were never actually present in Debian: This can be avoided with the `tagopt = --no-tags` option in .git/config; see <http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/ready/no-tags> + +> [[done]] thanks. Also cleared propigated tags out of origin. --[[Joey]] -- cgit v1.2.3 From 888ac35e11a22fe254127f2c39d71909038494c9 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 7 May 2010 13:13:57 -0400 Subject: a bug? --- doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn index eb37aee1b..32cf419e8 100644 --- a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn +++ b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn @@ -10,4 +10,9 @@ used for local .debs that were never actually present in Debian: This can be avoided with the `tagopt = --no-tags` option in .git/config; see <http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/ready/no-tags> -> [[done]] thanks. Also cleared propigated tags out of origin. --[[Joey]] +> [[done]] thanks. Also cleared propigated tags out of origin. +> +> Hmm, in testing I still see tags get pulled the first time a remote +> is added. If those are then locally deleted, it doesn't pull them again +> with the `--no-tags`. +> --[[Joey]] -- cgit v1.2.3 From b01a2274c3f96541b8b48f9ebb883ee8b7451fa3 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 7 May 2010 13:25:32 -0400 Subject: fix undef warning when page() tests a deleted file --- IkiWiki.pm | 3 ++- doc/bugs/deletion_warnings.mdwn | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/IkiWiki.pm b/IkiWiki.pm index 11cfcdfd2..d76b5edb4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2348,7 +2348,8 @@ sub match_internal ($$;@) { sub match_page ($$;@) { my $page=shift; my $match=match_glob($page, shift, @_); - if ($match && ! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) { + if ($match && ! (exists $IkiWiki::pagesources{$page} + && defined IkiWiki::pagetype($IkiWiki::pagesources{$page}))) { return IkiWiki::FailReason->new("$page is not a page"); } else { diff --git a/doc/bugs/deletion_warnings.mdwn b/doc/bugs/deletion_warnings.mdwn index c8879379b..668626b49 100644 --- a/doc/bugs/deletion_warnings.mdwn +++ b/doc/bugs/deletion_warnings.mdwn @@ -2,6 +2,9 @@ Seen while deleting a blog's calendar pages: --[[Joey]] +[[done]] -- the new `page()` pagespec needed to check if there was a source +file for the page, and was leaking undef. + <pre> 427250f..ff6c054 master -> origin/master Use of uninitialized value $file in pattern match (m//) at /usr/share/perl5/IkiWiki.pm line 688. -- cgit v1.2.3 From d238fd1b04b41b17cc9cb444d6dcee498d6a14c5 Mon Sep 17 00:00:00 2001 From: simonraven <simonraven@web> Date: Sat, 8 May 2010 23:38:35 +0000 Subject: bug with pubdate, in process of testing fix --- ...e_wrong_when_using_xhtml5___34__mode__34__.mdwn | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..c55b3f62d --- /dev/null +++ b/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn @@ -0,0 +1,40 @@ +Hi, + +XML error: + + Created <time datetime="2009-03-24T18:02:14Z" pubdate class="relativedate" title="Tue, 24 Mar 2009 14:02:14 -0400">2009-03-24</time> + +The pubdate REQUIRES a date, so e.g. `pubdate="2009-03-24T18:02:14Z"` + +Otherwise the XML parser chokes. + +<http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate> + +<pre> +diff --git a/IkiWiki.pm b/IkiWiki.pm +index 1f2ab07..6ab5b56 100644 +--- a/IkiWiki.pm ++++ b/IkiWiki.pm +@@ -1004,7 +1004,7 @@ sub displaytime ($;$$) { + my $time=formattime($_[0], $_[1]); + if ($config{html5}) { + return '<time datetime="'.date_3339($_[0]).'"'. +- ($_[2] ? ' pubdate' : ''). ++ ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : ''). + '>'.$time.'</time>'; + } + else { +diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm +index fe8ef09..8c4a1b4 100644 +--- a/IkiWiki/Plugin/relativedate.pm ++++ b/IkiWiki/Plugin/relativedate.pm +@@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) { + + if ($config{html5}) { + return '<time datetime="'.IkiWiki::date_3339($time).'"'. +- ($pubdate ? ' pubdate' : '').$mid.'</time>'; ++ ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>'; + } + else { + return '<span'.$mid.'</span>'; +</pre> -- cgit v1.2.3 From 6512423f159a0917137b2caca3fa244147dd0131 Mon Sep 17 00:00:00 2001 From: simonraven <simonraven@web> Date: Sat, 8 May 2010 23:42:45 +0000 Subject: fixed patch display... --- ...e_wrong_when_using_xhtml5___34__mode__34__.mdwn | 54 +++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'doc/bugs') 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 c55b3f62d..2dd0d945f 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 @@ -10,31 +10,33 @@ Otherwise the XML parser chokes. <http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate> +(indented exactly 4 spaces) + <pre> -diff --git a/IkiWiki.pm b/IkiWiki.pm -index 1f2ab07..6ab5b56 100644 ---- a/IkiWiki.pm -+++ b/IkiWiki.pm -@@ -1004,7 +1004,7 @@ sub displaytime ($;$$) { - my $time=formattime($_[0], $_[1]); - if ($config{html5}) { - return '<time datetime="'.date_3339($_[0]).'"'. -- ($_[2] ? ' pubdate' : ''). -+ ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : ''). - '>'.$time.'</time>'; - } - else { -diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm -index fe8ef09..8c4a1b4 100644 ---- a/IkiWiki/Plugin/relativedate.pm -+++ b/IkiWiki/Plugin/relativedate.pm -@@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) { - - if ($config{html5}) { - return '<time datetime="'.IkiWiki::date_3339($time).'"'. -- ($pubdate ? ' pubdate' : '').$mid.'</time>'; -+ ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>'; - } - else { - return '<span'.$mid.'</span>'; + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 1f2ab07..6ab5b56 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) { + my $time=formattime($_[0], $_[1]); + if ($config{html5}) { + return '<time datetime="'.date_3339($_[0]).'"'. + - ($_[2] ? ' pubdate' : ''). + + ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : ''). + '>'.$time.'</time>'; + } + else { + diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm + index fe8ef09..8c4a1b4 100644 + --- a/IkiWiki/Plugin/relativedate.pm + +++ b/IkiWiki/Plugin/relativedate.pm + @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) { + + if ($config{html5}) { + return '<time datetime="'.IkiWiki::date_3339($time).'"'. + - ($pubdate ? ' pubdate' : '').$mid.'</time>'; + + ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>'; + } + else { + return '<span'.$mid.'</span>'; </pre> -- cgit v1.2.3 From bc0aa4d40e10238f6b83e285869caab3dfeca395 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 '<time datetime="'.date_3339($_[0]).'"'. - ($_[2] ? ' pubdate' : ''). + ($_[2] ? ' pubdate="pubdate"' : ''). '>'.$time.'</time>'; } 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 '<time datetime="'.IkiWiki::date_3339($time).'"'. - ($pubdate ? ' pubdate' : '').$mid.'</time>'; + ($pubdate ? ' pubdate="pubdate"' : '').$mid.'</time>'; } else { return '<span'.$mid.'</span>'; 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 <joeyh@debian.org> 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. <http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate> -- cgit v1.2.3 From d379d8ab9dc999da6dcd3212634e9d2dc97d7a3e Mon Sep 17 00:00:00 2001 From: simonraven <simonraven@web> Date: Sat, 8 May 2010 23:55:47 +0000 Subject: --- ..._element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/bugs') 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 1f6bdb333..def5bcc2a 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 @@ -8,6 +8,7 @@ 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]] +>> awesome, thanks for fixing my fix ;) --[[simonraven]] Otherwise the XML parser chokes. -- cgit v1.2.3 From 0badce2ec03d9db1f6034546eabef097a5d7354d Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" <http://smcv.pseudorandom.co.uk/@web> Date: Sun, 9 May 2010 15:46:11 +0000 Subject: bugfix - only fetch after tags are disabled --- doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn index 32cf419e8..f9f086793 100644 --- a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn +++ b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn @@ -10,9 +10,11 @@ used for local .debs that were never actually present in Debian: This can be avoided with the `tagopt = --no-tags` option in .git/config; see <http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/ready/no-tags> -> [[done]] thanks. Also cleared propigated tags out of origin. +> *done* thanks. Also cleared propigated tags out of origin. > > Hmm, in testing I still see tags get pulled the first time a remote > is added. If those are then locally deleted, it doesn't pull them again > with the `--no-tags`. > --[[Joey]] + +>> Oh, I see why. Try the same branch again... --[[smcv]] -- cgit v1.2.3 From b5aa42d3e0f54649c8e5d3842ad0025279ba38a5 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 9 May 2010 12:56:42 -0400 Subject: remerged --- doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn index f9f086793..9bd8938c5 100644 --- a/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn +++ b/doc/bugs/gitremotes_script_picks_up_tags_from_anywhere.mdwn @@ -18,3 +18,5 @@ see <http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/read > --[[Joey]] >> Oh, I see why. Try the same branch again... --[[smcv]] + +>>> [[done]] --[[Joey]] -- cgit v1.2.3 From 4ceae1761b6f190a6115c106713d28f0a94e9191 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawngPXAGrxk1pbqnum3O4I_VPRgNj_TZR1I" <https://www.google.com/accounts/o8/id?id=AItOawngPXAGrxk1pbqnum3O4I_VPRgNj_TZR1I@web> Date: Tue, 11 May 2010 21:52:38 +0000 Subject: --- doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn index 316ea7e9b..e89545955 100644 --- a/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn +++ b/doc/bugs/pagespec_error_on_refresh_but_not_rebuild.mdwn @@ -25,4 +25,8 @@ But there is no error if I use `ikiwiki --rebuild` to regenerate the whole thing > that only happened some of the time. > > (The Text::Typography warning seems probably unrelated.) -> --[[Joey]] +> --[[Joey]] + +>> I'm sorry, I don't know what I was thinking there. It's ikiwiki 3.20100212, and manually applying the patch you linked to made the bug go away. (Upgrading ikiwiki is a pain on nearlyfreespeech, especially if you don't want to keep the build directory around -- please consider making ikiwiki runnable directly from a git clone.) + +[[!meta link="done"]] -- cgit v1.2.3 From f0f4073a17cf8a860cf7b04a2157a89e72ae0be2 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0" <https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0@web> Date: Mon, 7 Jun 2010 03:34:34 +0000 Subject: add bug about locale dependance of plugins/relativedate --- .../plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..1f4dc8e2d --- /dev/null +++ b/doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn @@ -0,0 +1,3 @@ +[[plugins/relativedate]] does not works when russian locale defined at setup file (locale => 'ru_RU.UTF-8'). This is happen because javascript for this plugin takes either elements title or content itself. If russian locale is turned on then title generated on russian language and JS can't convert it into Date object. innerHTML is language independent (YYYY-MM-DD HH:mm) always. + +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). -- cgit v1.2.3 From 75cae954cf4c244d9f7a8c5c9ef20d57fee10a2f Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0" <https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0@web> Date: Mon, 7 Jun 2010 03:39:14 +0000 Subject: Add note about date formating --- doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') 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 1f4dc8e2d..db009fa19 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 @@ -1,3 +1,5 @@ [[plugins/relativedate]] does not works when russian locale defined at setup file (locale => 'ru_RU.UTF-8'). This is happen because javascript for this plugin takes either elements title or content itself. If russian locale is turned on then title generated on russian language and JS can't convert it into Date object. innerHTML is language independent (YYYY-MM-DD HH:mm) always. 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. -- cgit v1.2.3 From 9dd91b393da6fa4aa48eb8e7d722afcd28de4690 Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Tue, 8 Jun 2010 09:21:43 +0000 Subject: File issue. --- .../Git:_changed_behavior_w.r.t._timestamps.mdwn | 180 +++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn new file mode 100644 index 000000000..5d5b9fc23 --- /dev/null +++ b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn @@ -0,0 +1,180 @@ +After some months, I just updated my local ikiwiki sources, and rebuilt +the Hurd web pages, <http://git.savannah.gnu.org/cgit/hurd/web.git/>. + +I was confused, having switched to the new automatic (thanks!) --gettime +mechanism, why on some pages the timestamps had changed compared to my +previous use of --getctime and setting files' mtimes (using a script) +according to the last Git commit. For example: + +community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.html + +old: + + Last edited <span class="date">2008-09-11 18:11:53 UTC</span> + <!-- Created <span class="date">2008-09-11 17:47:08 UTC</span> --> + +new: + + Last edited <span class="date">2008-09-11 18:12:22 UTC</span> + <!-- Created <span class="date">2008-09-11 17:47:50 UTC</span> --> + + +I had a look at what git.pm is doing, and began to manually replay / +investigate: + + $ git log --pretty=fuller --name-only --relative -- community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + commit 8f1b97bfe45b2f173e3a7d55dee226a9e289a695 + Author: arnebab <arne_bab@web.de> + AuthorDate: Thu Sep 11 20:11:53 2008 +0200 + Commit: arnebab <arne_bab@web.de> + CommitDate: Thu Sep 11 20:11:53 2008 +0200 + + Added a link to the X.org guide in this wiki. + + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + commit 3ef8b7d80d80572c436c4c60c71879bc74409816 + Author: arnebab <arne_bab@web.de> + AuthorDate: Thu Sep 11 19:47:08 2008 +0200 + Commit: arnebab <arne_bab@web.de> + CommitDate: Thu Sep 11 19:47:08 2008 +0200 + + Minor update on the enty trying to get X working -> 'watch this place for updates' + + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + +OK, these are my old dates. + + $ git log --pretty=format:%ci --name-only --relative -- community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + 2008-09-11 20:11:53 +0200 + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + 2008-09-11 19:47:08 +0200 + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + $ git log --pretty=format:%ct --name-only --relative -- community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + 1221156713 + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + 1221155228 + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + $ date -d @1221156713 + Thu Sep 11 18:11:53 UTC 2008 + $ date -d @1221155228 + Thu Sep 11 17:47:08 UTC 2008 + +That's all consistent. + + +But: + + $ perl -le 'use Storable; my $index=Storable::retrieve("indexdb"); use Data::Dumper; print Dumper $index' + [...] + 'community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn' => { + 'ctime' => '1221155270', + 'dest' => [ + 'community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.html' + ], + 'typedlinks' => { + 'tag' => {} + }, + 'mtime' => 1221156742, + 'depends_simple' => { + 'sidebar' => 1 + }, + 'links' => [ + 'community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x/discussion', + 'Hurd/DebianXorg' + ], + 'state' => { + [...] + + $ date -d @1221156742 + Thu Sep 11 18:12:22 UTC 2008 + $ date -d @1221155270 + Thu Sep 11 17:47:50 UTC 2008 + +That's different, and it matches what the new ikiwiki writes into the +HTML file. + + +Back to Git again, this time without specifying the file: + + $ git log --pretty=format:%ct --name-only --relative + [...] + 1221255713 + 1221255655 + unsorted/PortingIssues.mdwn + + 1221156742 [Thu Sep 11 18:12:22 UTC 2008] + 1221156713 [Thu Sep 11 18:11:53 UTC 2008] + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + 1221156267 + 1221156235 + index.mdwn + + 1221156122 + 1221156091 + index.mdwn + + 1221155942 + 1221155910 + index.mdwn + + 1221155270 [Thu Sep 11 17:47:50 UTC 2008] + 1221155228 [Thu Sep 11 17:47:08 UTC 2008] + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + + 1221154986 + community/gsoc.mdwn + community/gsoc/project_ideas.mdwn + + 1221147244 + whatsnew.html + [...] + +Aha! + +... and some more detail: + + $ git log --pretty=fuller --name-only --relative + [...] + commit e4e89e1683012c879012522105a3471a00714613 + Author: Samuel Thibault <samuel.thibault@ens-lyon.org> + AuthorDate: Fri Sep 12 23:40:55 2008 +0200 + Commit: Samuel Thibault <samuel.thibault@ens-lyon.org> + CommitDate: Fri Sep 12 23:40:55 2008 +0200 + + MSG_NOSIGNAL and IPV6_PKTINFO got fixed + + unsorted/PortingIssues.mdwn + + commit c389fae98dff86527be62f895ff7272e4ab1932c + Merge: 0339e3e 8f1b97b + Author: GNU Hurd wiki engine <web-hurd@gnu.org> + AuthorDate: Thu Sep 11 18:12:22 2008 +0000 + Commit: GNU Hurd wiki engine <web-hurd@gnu.org> + CommitDate: Thu Sep 11 18:12:22 2008 +0000 + + Merge branch 'master' of wiki@192.168.10.50:wiki + + commit 8f1b97bfe45b2f173e3a7d55dee226a9e289a695 + Author: arnebab <arne_bab@web.de> + AuthorDate: Thu Sep 11 20:11:53 2008 +0200 + Commit: arnebab <arne_bab@web.de> + CommitDate: Thu Sep 11 20:11:53 2008 +0200 + + Added a link to the X.org guide in this wiki. + + community/weblogs/ArneBab/2008-08-02-gnu_hurd_and_x.mdwn + [...] + +So, merges are involved there. + +What (the new) ikiwiki code does, is use the timestamp when the merge was +done instead of the timestamp when the commit was done. Is this +intentional? Otherwise I could supply a patch. + +--[[tschwinge]] -- cgit v1.2.3 From 2513f0ea6b65e1b866c01647454062ceb6bbfb7d Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Tue, 8 Jun 2010 09:23:05 +0000 Subject: File issue. --- doc/bugs/pagemtime_in_refresh_mode.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/bugs/pagemtime_in_refresh_mode.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/pagemtime_in_refresh_mode.mdwn b/doc/bugs/pagemtime_in_refresh_mode.mdwn new file mode 100644 index 000000000..97146f805 --- /dev/null +++ b/doc/bugs/pagemtime_in_refresh_mode.mdwn @@ -0,0 +1,14 @@ +I'd like a way to always ask the RCS (Git) to update a file's mtime in +refresh mode. This is currently only done on the first build, and later +for `--gettime --rebuild`. But always rebuilding is too heavy-weight for +this use-case. My options are to either manually set the mtime before +refreshing, or to have ikiwiki do it at command. I used to do the +former, but would now like the latter, as ikiwiki now generally does this +timestamp handling. + +From a quick look, the code in `IkiWiki/Render.pm:find_new_files` is +relevant: `if (! $pagemtime{$page}) { [...]`. + +How would you like to tackle this? + +--[[tschwinge]] -- cgit v1.2.3 From 9a18ea18e3ee0b5bbc0a20a075862af14f5860ad Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Tue, 8 Jun 2010 10:06:47 +0000 Subject: File issue. --- doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn new file mode 100644 index 000000000..8678249bb --- /dev/null +++ b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn @@ -0,0 +1,3 @@ +The autotag functionality of the tag plugin committed (when doing its +first commit) all changes that have been staged (in Git). I suggest it +should be restricted to the specific file only. --[[tschwinge]] -- cgit v1.2.3 From cc6ead1d81eacc75914eedb49c8773d6624cca33 Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Tue, 8 Jun 2010 14:04:00 +0000 Subject: File issue. --- doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn new file mode 100644 index 000000000..c29eb994f --- /dev/null +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -0,0 +1,10 @@ +With the current HEAD (b10d353490197b576ef7bf2e8bf8016039efbd2d), +globbing in `tagged()` pagespecs doesn't work for me. For example, +`tagged(*)` doesn't match any pages. (It does in this wiki installation +here, though.) + +I did not yet do any testing to figure out when this broke. + +--[[tschwinge]] + +[[!map pages="*/a* and tagged(*ose)"]] -- cgit v1.2.3 From 2be6660a8f3f523905e7c0ba4c36f579ed0d2493 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 8 Jun 2010 14:43:21 -0400 Subject: response --- doc/bugs/pagemtime_in_refresh_mode.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/pagemtime_in_refresh_mode.mdwn b/doc/bugs/pagemtime_in_refresh_mode.mdwn index 97146f805..f926ec86c 100644 --- a/doc/bugs/pagemtime_in_refresh_mode.mdwn +++ b/doc/bugs/pagemtime_in_refresh_mode.mdwn @@ -12,3 +12,17 @@ relevant: `if (! $pagemtime{$page}) { [...]`. How would you like to tackle this? --[[tschwinge]] + +> This could be done via a `needsbuild` hook. The hook is passed +> the list of changed files, and it should be safe to call `rcs_getmtime` +> and update the `pagemtime` for each. +> +> That lets the feature be done by a plugin, which seems good, since +> `rcs_getmtime` varies between very slow and not very fast, depending on +> VCS. +> +> AFAICS, the only use case for doing this is if you commit changes and +> then delay pushing them to a DVCS repo. Since then the file mtime will +> be when the change was pushed, not when it was committed. But I've +> generally felt that recording when a change was published to the repo +> of a wiki as its mtime is good enough. --[[Joey]] -- cgit v1.2.3 From c911b4b998992a69b5eea167658fb00c52a064a1 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 8 Jun 2010 14:46:54 -0400 Subject: response --- doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn index 5d5b9fc23..6abe203a3 100644 --- a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn +++ b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn @@ -178,3 +178,12 @@ done instead of the timestamp when the commit was done. Is this intentional? Otherwise I could supply a patch. --[[tschwinge]] + +> In order to be nice and fast, the git backend runs git log once +> and records data for all files. Rather than looking at the log for a +> given file. So amoung other things, it does not follow renames. +> +> AFAICS, git log only shows merges modifying files if it was a conflicted +> merge. As the file is then actually modified to resolve the merge +> I think it makes sense to count the merge as the last modification in +> that case. --[[Joey]] -- cgit v1.2.3 From 868f5a94bfdf03ccb720d561cf99185d7182cb77 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 8 Jun 2010 14:50:24 -0400 Subject: response --- doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn index 8678249bb..2419cf75f 100644 --- a/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn +++ b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn @@ -1,3 +1,14 @@ The autotag functionality of the tag plugin committed (when doing its first commit) all changes that have been staged (in Git). I suggest it should be restricted to the specific file only. --[[tschwinge]] + +> This is not specific to the tag plugin. Same can happen +> if you rename a file, or post a comment, or remove a file +> via web interface. All of these use `rcs_commit_staged`. +> +> This is why ikiwiki is supposed to have a checkout of +> the repository that it uses for its own purposes, and nobody else +> should mess with. There are various notes about that being needed here +> and there; you're free to not give ikiwiki its own repo, but you have to +> be aware that it can fight with you if you're making changes to the same +> repo. [[done]] --[[Joey]] -- cgit v1.2.3 From 73bb42ccf0e3240f8fecc9a543bfff435bb27a02 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 8 Jun 2010 14:53:22 -0400 Subject: response --- doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn index c29eb994f..76bf740fb 100644 --- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -8,3 +8,9 @@ I did not yet do any testing to figure out when this broke. --[[tschwinge]] [[!map pages="*/a* and tagged(*ose)"]] + +> Are you sure that `tagged()` ever matches pages there? Take globbing +> out of the equasion. +> +> This could be as simple as you having not rebuilt the wiki +> on upgrade to the version that tracks tagged links. --[[Joey]] -- cgit v1.2.3 From eff7fac985b41d038b071ab68cfe8bc0f428441b Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Tue, 8 Jun 2010 21:07:45 -0400 Subject: move bug to bugs --- doc/bugs/img_plugin_and_missing_heigth_value.mdwn | 3 +++ doc/forum/img_plugin_and_missing_heigth_value.mdwn | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 doc/bugs/img_plugin_and_missing_heigth_value.mdwn delete mode 100644 doc/forum/img_plugin_and_missing_heigth_value.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/img_plugin_and_missing_heigth_value.mdwn b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn new file mode 100644 index 000000000..a82e2a7d7 --- /dev/null +++ b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn @@ -0,0 +1,3 @@ +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]] diff --git a/doc/forum/img_plugin_and_missing_heigth_value.mdwn b/doc/forum/img_plugin_and_missing_heigth_value.mdwn deleted file mode 100644 index a82e2a7d7..000000000 --- a/doc/forum/img_plugin_and_missing_heigth_value.mdwn +++ /dev/null @@ -1,3 +0,0 @@ -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]] -- cgit v1.2.3 From 0ccf21daafa76fd182df5e6bc156f22873fe062d Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 f3dacd82341477dd41d6c97e7381f8cdf889738b Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Wed, 9 Jun 2010 06:17:56 +0000 Subject: Ack. --- doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn index 2419cf75f..e5526bedf 100644 --- a/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn +++ b/doc/bugs/tag_plugin:_autotag_vs._staged_changes.mdwn @@ -12,3 +12,6 @@ should be restricted to the specific file only. --[[tschwinge]] > and there; you're free to not give ikiwiki its own repo, but you have to > be aware that it can fight with you if you're making changes to the same > repo. [[done]] --[[Joey]] + +>> Ack, that is reasonable. (And it's only been a very minor problem +>> during manual testing.) --[[tschwinge]] -- cgit v1.2.3 From 215538aa58801a6a136029ff9ef4c632b72cf12e Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Wed, 9 Jun 2010 06:39:26 +0000 Subject: Yes, is a globbing issue. --- doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn index 76bf740fb..55669e5c8 100644 --- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -14,3 +14,16 @@ I did not yet do any testing to figure out when this broke. > > This could be as simple as you having not rebuilt the wiki > on upgrade to the version that tracks tagged links. --[[Joey]] + +>> Yes, it is a globbing issue: + +>> \[[!map pages="tagged(open_i*ue_gdb)" show=title]] + +>> ... doesn't show anything. + +>> \[[!map pages="tagged(open_issue_gdb)" show=title]] + +>> ... does show a map of eight pages. Also, it's working fine on the +>> autotags pages. + +>> --[[tschwinge]] -- cgit v1.2.3 From 4eb82e7d4161114c6a2194f8f887629ab86162c8 Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Wed, 9 Jun 2010 13:47:35 +0000 Subject: Comment and done. --- doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn index 6abe203a3..4ce7cc3df 100644 --- a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn +++ b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn @@ -187,3 +187,19 @@ intentional? Otherwise I could supply a patch. > merge. As the file is then actually modified to resolve the merge > I think it makes sense to count the merge as the last modification in > that case. --[[Joey]] + +>> That'd be reasonable, but `git log` will also show merges that are not +>> conflicting (as in my case). + +>> Yet, I'm not totally disagreeing with your choice. With this `git +>> log` invocation, you're not able to tell from its output whether a +>> conflict was resolved or not. + +>> Also, it's a bit like the *should we use the **author timestamp** or +>> **commit timestamp*** discussion. Your code will always use the +>> latest timestamp. + +>> I guess I'll get my head wrapped around that, and it's fine, so this is +>> [[done]]. + +>> --[[tschwinge]] -- cgit v1.2.3 From 0da7b1a9c33b3ff67fade15c395672f02bfe6a45 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 13:42:13 -0400 Subject: clarification --- doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn index 4ce7cc3df..164e62075 100644 --- a/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn +++ b/doc/bugs/Git:_changed_behavior_w.r.t._timestamps.mdwn @@ -191,6 +191,15 @@ intentional? Otherwise I could supply a patch. >> That'd be reasonable, but `git log` will also show merges that are not >> conflicting (as in my case). +>>> Actually when displaying a merge, `git log --stat` only lists files that +>>> were actually modified in a new way as part of the merge resolution. +>>> Ie, if the merge resolution only joins together some of the parent +>>> hunks, the file is not listed as having been modified. +>>> +>>> So, no, ikiwiki's use of git log will not show files modified in +>>> non-conflicting merges. +>>> --[[Joey]] + >> Yet, I'm not totally disagreeing with your choice. With this `git >> log` invocation, you're not able to tell from its output whether a >> conflict was resolved or not. -- cgit v1.2.3 From ba9b808c898a556541057ac9f524db2de2a33d77 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 14:04:42 -0400 Subject: remove example blog tag pages Autotag will create them as needed. Avoids some complexity. --- debian/changelog | 2 ++ doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 3 +++ doc/examples/blog/tags/life.mdwn | 4 ---- doc/examples/blog/tags/tech.mdwn | 4 ---- 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 doc/examples/blog/tags/life.mdwn delete mode 100644 doc/examples/blog/tags/tech.mdwn (limited to 'doc/bugs') diff --git a/debian/changelog b/debian/changelog index 9a10332ea..a0ea9c156 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ 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. + * Remove example blog tag pages; allow autotag creation to create them + when used. -- Joey Hess <joeyh@debian.org> Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn index 55669e5c8..9a55c0673 100644 --- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -27,3 +27,6 @@ I did not yet do any testing to figure out when this broke. >> autotags pages. >> --[[tschwinge]] + +>>> Only way I can reproduce something like this is if tagbase is not set. +>>> --[[Joey]] diff --git a/doc/examples/blog/tags/life.mdwn b/doc/examples/blog/tags/life.mdwn deleted file mode 100644 index e1614dbdc..000000000 --- a/doc/examples/blog/tags/life.mdwn +++ /dev/null @@ -1,4 +0,0 @@ -[[!meta title="tag life"]] - -[[!inline pages="tagged(tags/life)" actions="no" archive="yes" -feedshow=10]] diff --git a/doc/examples/blog/tags/tech.mdwn b/doc/examples/blog/tags/tech.mdwn deleted file mode 100644 index 398146cdb..000000000 --- a/doc/examples/blog/tags/tech.mdwn +++ /dev/null @@ -1,4 +0,0 @@ -[[!meta title="tag tech"]] - -[[!inline pages="tagged(tags/tech)" actions="no" archive="yes" -feedshow=10]] -- cgit v1.2.3 From cdf4292846e6fe0fb877809ef0906ff6bddf6bf9 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 14:33:49 -0400 Subject: Fix support for globbing in tagged() pagespecs. The linktype check was being done on the relativised link target, but %typedlinks uses the same link targets as %links, so that didn't work. I think the bug only appeared when tagbase was not set. This bugfix also let me factor out the common typedlink checking code. --- IkiWiki.pm | 8 +++++--- debian/changelog | 1 + doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/IkiWiki.pm b/IkiWiki.pm index e2a3d216f..27fa4ca17 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -2397,18 +2397,20 @@ sub match_link ($$;@) { unless $links && @{$links}; my $bestlink = IkiWiki::bestlink($from, $link); foreach my $p (@{$links}) { + next unless (! defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}); + if (length $bestlink) { - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && $bestlink eq IkiWiki::bestlink($page, $p)) { + if ($bestlink eq IkiWiki::bestlink($page, $p)) { return IkiWiki::SuccessReason->new("$page links to $link$qualifier", $page => $IkiWiki::DEPEND_LINKS, "" => 1) } } else { - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p}) && match_glob($p, $link, %params)) { + if (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/^\///; - if ((!defined $linktype || exists $IkiWiki::typedlinks{$page}{$linktype}{$p_rel}) && match_glob($p_rel, $link, %params)) { + if (match_glob($p_rel, $link, %params)) { return IkiWiki::SuccessReason->new("$page links to page $p_rel$qualifier, matching $link", $page => $IkiWiki::DEPEND_LINKS, "" => 1) } } diff --git a/debian/changelog b/debian/changelog index a0ea9c156..38beca395 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ ikiwiki (3.20100518.3) UNRELEASED; urgency=low * img: Fill in missing height or width when scaling image. * Remove example blog tag pages; allow autotag creation to create them when used. + * Fix support for globbing in tagged() pagespecs. -- Joey Hess <joeyh@debian.org> Mon, 31 May 2010 20:44:17 -0400 diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn index 9a55c0673..fba332949 100644 --- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -29,4 +29,5 @@ I did not yet do any testing to figure out when this broke. >> --[[tschwinge]] >>> Only way I can reproduce something like this is if tagbase is not set. +>>> I have fixed a bug there, see if it works for you? >>> --[[Joey]] -- cgit v1.2.3 From 9f41b231088a6a3dbd560cc999ad5ee9549aa914 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:02:08 -0400 Subject: seems this was fixed a long time ago --- doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn b/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn index e43540c65..19aa94e7e 100644 --- a/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn +++ b/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn @@ -25,3 +25,5 @@ types, ikiwiki should output a better error message. > It does allow including binary files right into a page, but nothing is > stopping you pasting binary data right into the edit form either, so > while annoying I don't think that will be a security problem. --[[Joey]] + +[[done]] -- cgit v1.2.3 From addedde0d64bc70b2dceac22886eec636f6b6e9a Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:03:51 -0400 Subject: fixed by improved openid login form --- doc/bugs/the_login_page_is_unclear_when_multiple_methods_exist.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/the_login_page_is_unclear_when_multiple_methods_exist.mdwn b/doc/bugs/the_login_page_is_unclear_when_multiple_methods_exist.mdwn index 9985c13a0..70266c49c 100644 --- a/doc/bugs/the_login_page_is_unclear_when_multiple_methods_exist.mdwn +++ b/doc/bugs/the_login_page_is_unclear_when_multiple_methods_exist.mdwn @@ -12,3 +12,5 @@ Followed by the "login" button underneath. It's not obvious to anyone unfamiliar > it visually distinct from the rest of the form. I'm sure the styling > could be improved, but the current form does not seem too non-obvious > to me, or to naive users in the field. --[[Joey]] + +>> [[done]], better fixed by new fancy openid login form. --[[Joey]] -- cgit v1.2.3 From 3cd4d1e31ba5d7b0a3705af08de2179a0dd07632 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:08:41 -0400 Subject: fixed --- doc/bugs/nested_raw_included_inlines.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/nested_raw_included_inlines.mdwn b/doc/bugs/nested_raw_included_inlines.mdwn index 33433e235..92ea4c4ef 100644 --- a/doc/bugs/nested_raw_included_inlines.mdwn +++ b/doc/bugs/nested_raw_included_inlines.mdwn @@ -32,3 +32,20 @@ Am I missing something? Is this a bug or Ikiwiki not supposed to support this us > currently merges pagespecs, though - maybe the patches I suggested for > [[separating_and_uniquifying_pagespecs|todo/should_optimise_pagespecs]] > would help? --[[smcv]] + +>> That, or something seems to have helped in the meantime... +>> Actually, I think it was the [[transitive_dependencies]] support +>> that did it, though smcv's pagespec stuff was also a crucial improvement. +>> +>> Anyhoo: + + joey@gnu:~/tmp>touch testcase/page2.mdwn + joey@gnu:~/tmp>ikiwiki -v testcase html + refreshing wiki.. + scanning page2.mdwn + building page2.mdwn + building page1.mdwn, which depends on page2 + building page0.mdwn, which depends on page1 + done + +>> I happily think this is [[done]] --[[Joey]] -- cgit v1.2.3 From 34594fb89a78c26f934a03e06c1aebb097ad57d2 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:11:23 -0400 Subject: close --- doc/bugs/remove_orphaned_sparkline-php_from_Suggests.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/remove_orphaned_sparkline-php_from_Suggests.mdwn b/doc/bugs/remove_orphaned_sparkline-php_from_Suggests.mdwn index b4e2a1501..ab08c0b26 100644 --- a/doc/bugs/remove_orphaned_sparkline-php_from_Suggests.mdwn +++ b/doc/bugs/remove_orphaned_sparkline-php_from_Suggests.mdwn @@ -18,3 +18,5 @@ Thanks > rewriting the ikiwiki code to use it, *and* packaging that alternative > and maintaining it in Debian. So your suggestion doesn't make a lot of > sense; Debian should just find a maintainer for sparkline-php. --[[Joey]] + +[[done]] -- cgit v1.2.3 From b382625f9fbe860ca80baaac7c2b38baa0626bc0 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:13:46 -0400 Subject: close --- doc/bugs/login_page_should_note_cookie_requirement.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/login_page_should_note_cookie_requirement.mdwn b/doc/bugs/login_page_should_note_cookie_requirement.mdwn index 96686053c..17ac12b34 100644 --- a/doc/bugs/login_page_should_note_cookie_requirement.mdwn +++ b/doc/bugs/login_page_should_note_cookie_requirement.mdwn @@ -31,3 +31,9 @@ Best of all would be to use URL-based or hidden-field-based session tokens if co >> don't look static. Are they really? --[MJR](http://mjr.towers.org.uk) >>> As soon as you post an edit page, you are back to a static website. + +>>> It is impossible to get to an edit page w/o a cookie, unless +>>> anonymous edits are allowed, in which case it will save. No data loss. +>>> Since noone is working on this, and the nonsense above has pissed me +>>> off to the point that I will certianly never work on it, I'm going to +>>> close it. --[[Joey]] [[done]] -- cgit v1.2.3 From 3638657f75a5cba68511acebd5e124f4b22179ed Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:15:18 -0400 Subject: closing; cannot reproduce and no followup for 1 year 9 months --- debian/changelog | 2 +- doc/bugs/Cannot_inline_pages_with_apostrophes_in_title.mdwn | 2 ++ ikiwiki.spec | 2 +- po/bg.po | 3 ++- po/cs.po | 3 ++- po/da.po | 3 ++- po/de.po | 3 ++- po/es.po | 3 ++- po/fr.po | 10 ++++++---- 9 files changed, 20 insertions(+), 11 deletions(-) (limited to 'doc/bugs') diff --git a/debian/changelog b/debian/changelog index 38beca395..36848d680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100518.3) UNRELEASED; urgency=low +ikiwiki (3.20100609) unstable; urgency=low * creation_day() etc use local time, not gmtime. To match calendars, which use local time. diff --git a/doc/bugs/Cannot_inline_pages_with_apostrophes_in_title.mdwn b/doc/bugs/Cannot_inline_pages_with_apostrophes_in_title.mdwn index 7daf52f2a..3e1fe823e 100644 --- a/doc/bugs/Cannot_inline_pages_with_apostrophes_in_title.mdwn +++ b/doc/bugs/Cannot_inline_pages_with_apostrophes_in_title.mdwn @@ -3,3 +3,5 @@ page produces nothing. It looks like the inline plugin is failing to do the translation from apostrophe to `_39_` that other parts of the system do, so although one can make wikilinks to such pages and have them detected as existing (for instance, by the conditional plugin), inline looks in the wrong place and doesn't see the page. > I can't reproduce that (btw, an apostrophe would be `__39__`) --[[Joey]] + +[[done]] diff --git a/ikiwiki.spec b/ikiwiki.spec index fb8b777fe..d373c5cf3 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20100518.2 +Version: 3.20100609 Release: 1%{?dist} Summary: A wiki compiler diff --git a/po/bg.po b/po/bg.po index a399a8c77..49dddee2b 100644 --- a/po/bg.po +++ b/po/bg.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-bg\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2007-01-12 01:19+0200\n" "Last-Translator: Damyan Ivanov <dam@modsodtsys.com>\n" "Language-Team: Bulgarian <dict@fsa-bg.org>\n" +"Language: bg\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/cs.po b/po/cs.po index 5e3d8abac..c3fb1f832 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2009-09-11 20:23+0200\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n" +"Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/da.po b/po/da.po index 81f40ea52..fb0ec754d 100644 --- a/po/da.po +++ b/po/da.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.14159\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2009-07-23 01:07+0200\n" "Last-Translator: Jonas Smedegaard <dr@jones.dk>\n" "Language-Team: None\n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/de.po b/po/de.po index a6241388e..1cfc57886 100644 --- a/po/de.po +++ b/po/de.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.14159\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2010-03-14 16:09+0530\n" "Last-Translator: Sebastian Kuhnert <mail@sebastian-kuhnert.de>\n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/es.po b/po/es.po index 2f0b83813..34c704238 100644 --- a/po/es.po +++ b/po/es.po @@ -9,10 +9,11 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2009-06-14 12:32+0200\n" "Last-Translator: Victor Moral <victor@taquiones.net>\n" "Language-Team: <en@li.org>\n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/fr.po b/po/fr.po index e1cee2e80..ec21d51ab 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,10 +9,11 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.141\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-18 13:38-0400\n" +"POT-Creation-Date: 2010-05-18 14:18-0400\n" "PO-Revision-Date: 2009-08-17 10:06+0200\n" "Last-Translator: Philippe Batailler <philippe.batailler@free.fr>\n" "Language-Team: French <debian-l10n-french@lists.debian.org>\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -807,7 +808,8 @@ msgstr "pourcentage %s illégal" #: ../IkiWiki/Plugin/progress.pm:56 msgid "need either `percent` or `totalpages` and `donepages` parameters" msgstr "" -"L'un des paramètres « percent », « totalpages » ou « donepages » est nécessaire." +"L'un des paramètres « percent », « totalpages » ou « donepages » est " +"nécessaire." #: ../IkiWiki/Plugin/recentchangesdiff.pm:37 msgid "(Diff truncated)" @@ -1320,5 +1322,5 @@ msgstr "Nom de domaine du serveur HTTP :" #~ msgid "<p class=\"error\">Error: %s exited nonzero (%s)" #~ msgstr "" -#~ "<p class=\"erreur\">Erreur : %s s'est terminé, valeur de sortie nonzero (%" -#~ "s)" +#~ "<p class=\"erreur\">Erreur : %s s'est terminé, valeur de sortie nonzero " +#~ "(%s)" -- cgit v1.2.3 From 2b716c47a7caa90338430d407fea2a0d07550429 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:19:46 -0400 Subject: close old bug, apparently worked around --- doc/bugs/2.45_Compilation_error.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/2.45_Compilation_error.mdwn b/doc/bugs/2.45_Compilation_error.mdwn index c69c2fc25..63147b656 100644 --- a/doc/bugs/2.45_Compilation_error.mdwn +++ b/doc/bugs/2.45_Compilation_error.mdwn @@ -189,3 +189,10 @@ Would you suggest I try rebuilding perl without this patch? Debian has a huge pe it's not straightforward for me to see if they do something similar to Arch. > I think Debian has a similar patch. + +--- + +[[done]] -- apparently this was a problem due to a distribution's +customisation to perl, or something. Seems to late now to track down what, +unfortunatly. And ikiwiki's Makefile no longer uses the "-libdir" switch +that seemed to trigger the bug. --[[Joey]] -- cgit v1.2.3 From 0b3d08665bf451d30bd9f355cfe31ed4072b407a Mon Sep 17 00:00:00 2001 From: privat <privat@web> Date: Wed, 9 Jun 2010 19:26:40 +0000 Subject: --- ...espect_the_current_page___40__if_any__41__.mdwn | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..58cf9d737 --- /dev/null +++ b/doc/bugs/misctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn @@ -0,0 +1,50 @@ +I really like the new approach to having only one main template "page.tmpl". For instance, it improves previews during edits. +But it causes some nasty bugs for plugins that use the pagetemplate hook. It is especially visible with the [[plugins/sidebar]] plugin. + +## Some examples + +### A first example + +* activate sidebars globally and cgi +* create "/sidebar.mdwn" with "[<span></span>[foo]]" inside +* create "/foo.mdwn" with "hello!" inside +* create "/bar.mdwn" +* run ikiwiki +* with the web browser, go to the page "bar" +* notice the sidebar, click on "foo" +* notice the page "foo" is now displayed (hello!) +* return the the page "bar" and click "edit" +* notice the sidebar is still here, click on the "foo" +* -> Problem: 404, the browser goes to "/bar/foo" +* -> Was expected: the browser goes to "/foo" + +### A second example + +* create "/bar/sidebar.mdwn" with "world" +* run ikiwiki +* with the web browser, go to the page "bar" +* notice the sidebar displays "world" +* click "edit" +* -> Problem: the sidebar now shows the foo link (it is the root sidebar!) +* -> Was expecte : the sidebar displays "world" + +### A last example + +* with the web browser edit the page "bar" +* type <code>[<span></span>[!sidebar content="goodby"]]</code> +* click preview +* -> Problem: the sidebar still displays the foo link +* -> Was expected: the sidebar display "goodby" + +## Some superficial hacking + +With the following workaround hacks, I manage to solve the 3 examples shown above: + +1- edit IkiWiki/Plugin/editpage.pm and call showform with additional page and destpage parameters: +<pre>showform($form, \@buttons, $session, $q, forcebaseurl => $baseurl, page => $page, destpage => $page);</pre> + +2- edit /usr/share/perl5/IkiWiki.pm and modify the misctemplate function to use the given page and destpage: +<pre>my %params=@_; +shift->(page => $params{page}, destpage => $params{destpage}, template => $template);</pre> + +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. -- cgit v1.2.3 From b5978713f134f82ba4929df234a16c007d4acb79 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 15:29:20 -0400 Subject: close; use ENV in setup file --- doc/bugs/http_proxy_for_openid.mdwn | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc/bugs') diff --git a/doc/bugs/http_proxy_for_openid.mdwn b/doc/bugs/http_proxy_for_openid.mdwn index 3d0c99b83..dac4d2736 100644 --- a/doc/bugs/http_proxy_for_openid.mdwn +++ b/doc/bugs/http_proxy_for_openid.mdwn @@ -22,8 +22,7 @@ Note that using $ua->proxy(['https'], ...); won't work, you get a "Not Implement Also note that the proxy won't work with liblwpx-paranoidagent-perl, I had to remove liblwpx-paranoidagent-perl first. -Please get the patch from the *.mdwn source. - +<pre> louie:/usr/share/perl5/IkiWiki/Plugin# diff -u openid.pm.old openid.pm --- openid.pm.old 2008-10-26 12:18:58.094489360 +1100 +++ openid.pm 2008-10-26 12:40:05.763429880 +1100 @@ -42,6 +41,11 @@ louie:/usr/share/perl5/IkiWiki/Plugin# diff -u openid.pm.old openid.pm # Store the secret in the session. my $secret=$session->param("openid_secret"); if (! defined $secret) { - +</pre> Brian May + +> Rather than adding config file settings for every useful environment +> variable, there is a ENV config file setting that can be used to set +> any environment variables you like. So, no changed needed. [[done]] +> --[[Joey]] -- cgit v1.2.3 From e96cf38eccd219714140f221090d2e7751fd4ee0 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 `<base>` 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 <pre>my %params=@_; shift->(page => $params{page}, destpage => $params{destpage}, template => $template);</pre> -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 <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 118750658885fa64a03c8860d8a3fe2573221276 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Wed, 9 Jun 2010 17:13:35 -0400 Subject: ugly bug --- doc/bugs/preview_pagestate.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/bugs/preview_pagestate.mdwn (limited to 'doc/bugs') diff --git a/doc/bugs/preview_pagestate.mdwn b/doc/bugs/preview_pagestate.mdwn new file mode 100644 index 000000000..14973908b --- /dev/null +++ b/doc/bugs/preview_pagestate.mdwn @@ -0,0 +1,11 @@ +If a change to a page is previewed, but not saved, `%pagestate` and +`%wikistate` can be changed, and saved. Actually, it's not limited to +those. Seems that spurious dependencies can be added, though existing +dependencies will at least not be removed. + +It calls saveindex to record state about files created on disk for the +preview. Those files will expire later. However, saveindex also +saves other state changes. + +Seems like it needs to isolate all state changes when previewing... ugh. +--[[Joey]] -- cgit v1.2.3 From 24b59b3a9edb350ef0dc064b0a3f3cdee01f81be Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 04309536085b06a4121b8aad35adc53d91fcb3f2 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0" <https://www.google.com/accounts/o8/id?id=AItOawmPD3Qj5IoazkkW6Tk-kLOlKGmJLXim0H0@web> Date: Thu, 10 Jun 2010 03:29:22 +0000 Subject: --- doc/bugs/plugins__47__relativedate_depends_on_locale_at_setup_file.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') 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 e2ea3e4f6..a9a39ac47 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 @@ -12,3 +12,5 @@ P.S. All pages but RecentChanges show well-formated date. RecentChanges show dat > 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]] + +>> Thanks. -- cgit v1.2.3 From 0fbec10a42c0b6ae3111d5a5d5488cd5d573f554 Mon Sep 17 00:00:00 2001 From: tschwinge <tschwinge@web> Date: Thu, 10 Jun 2010 08:54:46 +0000 Subject: Fixed. --- doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn index fba332949..f9cb37487 100644 --- a/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn +++ b/doc/bugs/pagespec:_tagged__40____41____44___globbing.mdwn @@ -31,3 +31,6 @@ I did not yet do any testing to figure out when this broke. >>> Only way I can reproduce something like this is if tagbase is not set. >>> I have fixed a bug there, see if it works for you? >>> --[[Joey]] + +>>>> This is now indeed [[fixed|done]] (thanks!) -- even though I already +>>>> did have tagbase set. -- cgit v1.2.3 From 48a1dce15d870134358dacd2c2839e5c843a79e8 Mon Sep 17 00:00:00 2001 From: "http://jblevins.org/" <http://jblevins.org/@web> Date: Thu, 10 Jun 2010 22:16:55 +0000 Subject: Update URL --- doc/bugs/external_links_inside_headings_don__39__t_work.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/external_links_inside_headings_don__39__t_work.mdwn b/doc/bugs/external_links_inside_headings_don__39__t_work.mdwn index 5bab283fd..51d6ad475 100644 --- a/doc/bugs/external_links_inside_headings_don__39__t_work.mdwn +++ b/doc/bugs/external_links_inside_headings_don__39__t_work.mdwn @@ -21,4 +21,4 @@ It works fine with h2 and deeper. The square brackets also appear in the output > [[done]] --[[Joey]] ->> It works here but it definitely does *not* work on my wiki; but on further experimentation, I believe my problem is being caused by JasonBlevins' [h1title](http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm) plugin. +>> It works here but it definitely does *not* work on my wiki; but on further experimentation, I believe my problem is being caused by JasonBlevins' [h1title](http://jblevins.org/git/ikiwiki/plugins.git/plain/h1title.pm) plugin. -- cgit v1.2.3 From 6ba1cf7c3dc81d4a9d3c92b1e319051d40bf8daa Mon Sep 17 00:00:00 2001 From: zimek <zimek@web> Date: Fri, 11 Jun 2010 11:14:34 +0000 Subject: --- doc/bugs/img_plugin_and_missing_heigth_value.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/img_plugin_and_missing_heigth_value.mdwn b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn index bcb17c330..4bc070c95 100644 --- a/doc/bugs/img_plugin_and_missing_heigth_value.mdwn +++ b/doc/bugs/img_plugin_and_missing_heigth_value.mdwn @@ -3,3 +3,5 @@ When I set up my picture page with `\[[!img defaults size=300x]]` then the html > This is a bug. --[[Joey]] > And .. [[fixed|done]] --[[Joey]] + +>> Not quite; For some reason it requires me to update wiki pages twice before the height value shows up. -- cgit v1.2.3 From 77a3585e92a947610b1b26cdd7ce499bfefc21f6 Mon Sep 17 00:00:00 2001 From: jwalzer <jwalzer@web> Date: Fri, 11 Jun 2010 13:53:06 +0000 Subject: --- doc/bugs/img_vs_align.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/img_vs_align.mdwn b/doc/bugs/img_vs_align.mdwn index 6eff46178..641d3ff76 100644 --- a/doc/bugs/img_vs_align.mdwn +++ b/doc/bugs/img_vs_align.mdwn @@ -29,3 +29,7 @@ almost of my CSS foo again ;-) it seems.) --[[tschwinge]] >> scripts again... >> >> --[[tschwinge]] + +>>> It seems, the 'align=right' parameter gets filtered in my installation +>>> Are there other plugins, that could throw the parameter away? +>>> --[[jwalzer]] -- cgit v1.2.3 From 89a970bd7d8cccf5362985ae293aba5626429095 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Sun, 13 Jun 2010 09:11:59 -0400 Subject: response --- doc/bugs/img_vs_align.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/bugs') diff --git a/doc/bugs/img_vs_align.mdwn b/doc/bugs/img_vs_align.mdwn index 641d3ff76..c78465a37 100644 --- a/doc/bugs/img_vs_align.mdwn +++ b/doc/bugs/img_vs_align.mdwn @@ -33,3 +33,6 @@ almost of my CSS foo again ;-) it seems.) --[[tschwinge]] >>> It seems, the 'align=right' parameter gets filtered in my installation >>> Are there other plugins, that could throw the parameter away? >>> --[[jwalzer]] + +>>>> Can't think of anything. htmlscrubber doesn't; tidy doesn't. +>>>> --[[Joey]] -- cgit v1.2.3 From 8746480c259a9d52b1661f6832428cfeeb3458bd Mon Sep 17 00:00:00 2001 From: privat <privat@web> Date: Mon, 14 Jun 2010 13:54:43 +0000 Subject: Reopen the bug since it is not fixed --- ...espect_the_current_page___40__if_any__41__.mdwn | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'doc/bugs') 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 f1e4649ff..c6f1cef3d 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 @@ -24,6 +24,15 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is > The [[version_3.20100515]] announcment mentions that you need to > update old `page.tmpl` files to include that on upgrade. --[[Joey]] +>> I followed the anouncment. I also disabled my custom page.tmpl to confirm the bug. I even produced a step-by-step example to reproduce the bug. +>> In fact, the base tag work for the page links (the content part) but did not works for the sidebar links (the sidebar part) since the sidebar links are generated in the context of the root page. +>> In the examble above: +>> +>> * base="http://www.example.com/bar" relative_link_in_bar=''something" -> absolute_link_in_bar = "http://www.example.com/bar/something" (that is fine) +>> * base="http://www.example.com/bar" relative_link_in_sidebar="foo" (because generated in the context of the root page) -> absolute_link_in_sidebar = "http://www.example.com/bar/foo" (that is not fine) +>> +>> 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]] + ### A second example * create "/bar/sidebar.mdwn" with "world" @@ -39,6 +48,13 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is > the "are you sure" confirmation page to display the page's sidebar? > --[[Joey]] +>> It is a very good point and could be argued: +>> +>> * for dynamic page, is the root context more legitimate than the current page context? +>> * when clicking the Edit link, does the user expect to remain in the "same page"? +>> +>> But, as far as something sensible is displayed and that the links work. I'm OK with any choice. -- [[JeanPrivat]] + ### A last example * with the web browser edit the page "bar" @@ -54,6 +70,13 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is > put the sidebar anywhere so we can't just display the preview sidebar > next to the rest of the page preview. --[[Joey]] +>> The behavior is fine for me. However, some nitpicking (fell free to ingore) : +>> +>> * If the sidebar is replaced (making the previewing in-place), for consitency, should not the previewed content also shown in-place ? i.e. above the form part +>> * there is no way to come back (without saving or canceling) to the root context (e.g. displaying the root sidebar) i.e. some sort of unpreviewing. +>> +>> -- [[JeanPrivat]] + ## Some superficial hacking With the following workaround hacks, I manage to solve the 3 examples shown above: @@ -70,5 +93,5 @@ 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]] +>> I removed the done tag (I suspect it is the way to reopen bugs) -- [[JeanPrivat]] -- cgit v1.2.3 From c0bc2d08398ae5cfa6becba155a2127a481a4d5e Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 b39630c16cd663bd39f4fc787407928c44010a24 Mon Sep 17 00:00:00 2001 From: privat <privat@web> Date: Tue, 15 Jun 2010 13:33:16 +0000 Subject: Thanks --- ...sctemplate_does_not_respect_the_current_page___40__if_any__41__.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/bugs') 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 adf0ec745..3b0347f5f 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 @@ -35,6 +35,8 @@ But it causes some nasty bugs for plugins that use the pagetemplate hook. It is >>> Sorry if my not seeing the bug offended you. [[Fixed|done]] --[[Joey]] +>>>> Thanks! --[[JeanPrivat]] (I'm not offended) + ### A second example * create "/bar/sidebar.mdwn" with "world" -- cgit v1.2.3 From 96c7e31c34b10e343afb3f17eb1ca7c34aaa4123 Mon Sep 17 00:00:00 2001 From: jhagg <jhagg@web> Date: Wed, 16 Jun 2010 13:40:29 +0000 Subject: --- ...ment_upload_does_not_work_for_windows_clients.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn (limited to 'doc/bugs') 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 new file mode 100644 index 000000000..de57a1441 --- /dev/null +++ b/doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn @@ -0,0 +1,19 @@ +It seems as if windows clients (IE) submit filenames with backslash as directory separator. +(no surprise :-). + +But the attachment plugin translates these backslashes to underscore, making the +whole path a filename. + +This little hack fixed the backslash problem, although I wonder if that +really is the problem? +(Everything works perfectly from linux clients of course. :-) + + sub basename ($) { + my $file=shift; + + $file=~s!.*/+!!; + $file=~s!.*\\+!!; + return $file; + } + +Should probably be `$file=~s!.*[/\\]+!!` :-) -- cgit v1.2.3 From 69c22fa1ea143e3eb36692e087b167ae2171581e Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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 <joeyh@debian.org> 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 79ffede4a7224a26e1725296db2db1918d52667c Mon Sep 17 00:00:00 2001 From: jhagg <jhagg@web> Date: Thu, 17 Jun 2010 08:30:38 +0000 Subject: --- doc/bugs/attachment_upload_does_not_work_for_windows_clients.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/bugs') 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 ad3aadbce..4e8c7bdcf 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 @@ -11,6 +11,14 @@ whole path a filename. > Still, I don't mind adding a special case, though obviously not in > `basename`. [[done]] --[[Joey]] +>> Well, it's probably something else also, I get **bad attachment filename**. +>> Now, that could really be a bad filename, problem is that it wasn't. I even +>> tried applying the **wiki_file_prune_regexps** one by one to see what was +>> causing it. No problem there. The strange thing is that the error shows up +>> when using firefox on windows too. But the backslash hack fixes at least the +>> incorrect filename from IE (firefox on windows gave me the correct filename. +>> I'll do some more digging... :-) /jh + 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 99c9d8c34f95fe62c575a78e28abdbb47310c230 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> Date: Fri, 18 Jun 2010 14:39:08 -0400 Subject: also a problem for theme plugin --- doc/bugs/underlaydir_file_expose.mdwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/bugs') diff --git a/doc/bugs/underlaydir_file_expose.mdwn b/doc/bugs/underlaydir_file_expose.mdwn index c827c6dd8..ca492e396 100644 --- a/doc/bugs/underlaydir_file_expose.mdwn +++ b/doc/bugs/underlaydir_file_expose.mdwn @@ -1,4 +1,12 @@ If a file in the srcdir is removed, exposing a file in the underlaydir, -ikiwiki will notice the removal and delete the page from the destdir. The +ikiwiki will not notice the removal, and the page from the underlay will not be built. (However, it will be if the wiki gets rebuilt.) + +> This problem is caused by ikiwiki storing only filenames relative to +> the srcdir or underlay, and mtime comparison not handling this case. + +> 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. +> --[[Joey]] -- cgit v1.2.3 From 57e56828f5b03f8fb31631f36731f989d4335607 Mon Sep 17 00:00:00 2001 From: Joey Hess <joey@kitenet.net> 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 'doc/bugs') 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