From 9e2c8a96cd3f54644f38d43d7beb347edda0684c Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Thu, 13 Aug 2009 17:14:32 -0400 Subject: [PATCH 001/180] add me new repo, yarrr --- doc/git.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/git.mdwn b/doc/git.mdwn index 18fbd238b..1cd91e532 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -46,6 +46,7 @@ into [[Joey]]'s working tree. This is recommended. :-) * [[arpitjain]] `git://github.com/arpitjain11/ikiwiki.git` * [[chrysn]] `git://github.com/github076986099/ikiwiki.git` * [[simonraven]] `git://github.com/kjikaqawej/ikiwiki-simon.git` +* [[schmonz]] `git://github.com/schmonz/ikiwiki.git` ## branches From d512d5802273faac184d133d64965336a68cd603 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 17:48:36 -0400 Subject: [PATCH 002/180] response --- doc/forum/google_openid_broken__63__.mdwn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/forum/google_openid_broken__63__.mdwn b/doc/forum/google_openid_broken__63__.mdwn index 2ca339c3c..890bba4d9 100644 --- a/doc/forum/google_openid_broken__63__.mdwn +++ b/doc/forum/google_openid_broken__63__.mdwn @@ -3,3 +3,8 @@ when I login via to this wiki (or ours) via Google's OpenID, I get this error: Error: OpenID failure: no_identity_server: The provided URL doesn't declare its OpenID identity server. Any idea how to fix this?? + +> Google is [doing things with openid that are not in the spec](http://googledataapis.blogspot.com/2008/10/federated-login-for-google-account.html) +> and it's not clear to me that they intend regular openid to work at all. +> What is your google openid URL so I can take a look at the data they are +> providing? --[[Joey]] From 8ba32abaf27110d86a52720bcb738402bf90fadb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 17:55:01 -0400 Subject: [PATCH 003/180] review: question --- doc/plugins/contrib/cvs/discussion | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/plugins/contrib/cvs/discussion diff --git a/doc/plugins/contrib/cvs/discussion b/doc/plugins/contrib/cvs/discussion new file mode 100644 index 000000000..e2411af63 --- /dev/null +++ b/doc/plugins/contrib/cvs/discussion @@ -0,0 +1,5 @@ +I've started reviewing this, and the main thing I don't like is the +post-commit wrapper wrapper that ikiwiki-makerepo is patched to set up. +That just seems unnecessarily complicated. Why can't ikiwiki itself detect +the "cvs add " call and avoid doing anything in that case? +--[[Joey]] From 3401dc6110ac785c1df3f447d2f1de017be92538 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 18:12:28 -0400 Subject: [PATCH 004/180] fix name --- doc/plugins/contrib/cvs/{discussion => discussion.mdwn} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/plugins/contrib/cvs/{discussion => discussion.mdwn} (100%) diff --git a/doc/plugins/contrib/cvs/discussion b/doc/plugins/contrib/cvs/discussion.mdwn similarity index 100% rename from doc/plugins/contrib/cvs/discussion rename to doc/plugins/contrib/cvs/discussion.mdwn From 46c2d66fd37b12c2d02466118cb206000174f1b4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 19:05:27 -0400 Subject: [PATCH 005/180] disable pagecount here, sorta of excessive since the bug has been done --- doc/bugs/pagecount_is_broken.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/bugs/pagecount_is_broken.mdwn b/doc/bugs/pagecount_is_broken.mdwn index 101230d94..57df6b75d 100644 --- a/doc/bugs/pagecount_is_broken.mdwn +++ b/doc/bugs/pagecount_is_broken.mdwn @@ -1,3 +1,4 @@ -The [[plugins/pagecount]] plugin seems to be broken, as it claims there are [[!pagecount ]] pages in this wiki. (if it's not 0, the bug is fixed) +The [[plugins/pagecount]] plugin seems to be broken, as it claims there are +\[[!pagecount ]] pages in this wiki. (if it's not 0, the bug is fixed) [[fixed|done]] --[[Joey]] From 159c0c043cdd4009562087144a37fdda38eb6409 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 21:04:19 -0400 Subject: [PATCH 006/180] optimise gettext calls --- IkiWiki/Plugin/brokenlinks.pm | 2 +- IkiWiki/Plugin/inline.pm | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index cf8f25281..f8d44892b 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -28,9 +28,9 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my %broken; + my $discussion=gettext("Discussion"); foreach my $page (pagespec_match_list([keys %links], $params{pages}, location => $params{page})) { - my $discussion=gettext("Discussion"); my %seen; foreach my $link (@{$links{$page}}) { next if $seen{$link}; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 04ad6ed23..2fbb45e02 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -348,6 +348,9 @@ sub preprocess_inline (@) { } my $template=HTML::Template->new(@params) unless $raw; + my $discussionlink=lc(gettext("Discussion")) + if $config{discussion}; + foreach my $page (@list) { my $file = $pagesources{$page}; my $type = pagetype($file); @@ -371,7 +374,6 @@ sub preprocess_inline (@) { my $file = $pagesources{$page}; my $type = pagetype($file); if ($config{discussion}) { - my $discussionlink=lc(gettext("Discussion")); if ($page !~ /.*\/\Q$discussionlink\E$/ && (length $config{cgiurl} || exists $links{$page."/".$discussionlink})) { From fed73d8d922ec4d52457a99f652c1d0d26ba67c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 21:05:07 -0400 Subject: [PATCH 007/180] change PROFILE to use Devel::NYTProf --- Makefile.PL | 2 +- README | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 602d8fb5c..020813177 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -27,7 +27,7 @@ PROBABLE_INST_LIB=$(shell \\ 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:Profile"; fi) +extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:NYTProf"; fi) ikiwiki.out: ikiwiki.in ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out diff --git a/README b/README index 408ab666a..a4dc0d641 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ available online at A few special variables you can set while using the Makefile: PROFILE=1 turns on profiling for the build of the doc wiki. - (Uses Devel::Profile) + (Uses Devel::NYTProf) NOTAINT=0 turns on the taint flag in the ikiwiki program. (Not recommended unless your perl is less buggy than mine -- see From 2007005cd2497ff10defa3e3e9cc91890df1c5d8 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 13 Aug 2009 21:09:24 -0400 Subject: [PATCH 008/180] removed --- doc/ikiwiki/markdown/discussion.mdwn | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/ikiwiki/markdown/discussion.mdwn diff --git a/doc/ikiwiki/markdown/discussion.mdwn b/doc/ikiwiki/markdown/discussion.mdwn deleted file mode 100644 index d3affec34..000000000 --- a/doc/ikiwiki/markdown/discussion.mdwn +++ /dev/null @@ -1 +0,0 @@ -Is anyone else having trouble using the definition list feature of multimarkdown? If not, then I could use some help figuring out why it's not working on my text site. Version is 3.141~bpo50+1 (debian backports), multimarkdown and mdwn support enabled in preferences. Any pointers to the obvious thing I'm missing would be appreciated. - dave From 830c9e59b2c4d5c90e4316d8e81558e1aeb132f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 21:41:33 -0400 Subject: [PATCH 009/180] Add discussionpage configuration setting By adding this setting, we get both more configurability, and a minor optimisation too, since gettext does not need to be called continually to get the Discussion value. --- IkiWiki.pm | 7 +++++++ IkiWiki/Plugin/brokenlinks.pm | 3 +-- IkiWiki/Plugin/editpage.pm | 5 +++-- IkiWiki/Plugin/inline.pm | 9 +++------ IkiWiki/Plugin/opendiscussion.pm | 3 +-- IkiWiki/Plugin/orphans.pm | 3 +-- IkiWiki/Render.pm | 9 ++++----- debian/changelog | 2 ++ 8 files changed, 22 insertions(+), 19 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index a11b330f2..b47da966e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -220,6 +220,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + discussionpage => { + type => "string", + default => gettext("Discussion"), + description => "name of Discussion pages", + safe => 1, + rebuild => 1, + }, sslcookie => { type => "boolean", default => 0, diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index f8d44892b..5ad4c917c 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -28,14 +28,13 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my %broken; - my $discussion=gettext("Discussion"); foreach my $page (pagespec_match_list([keys %links], $params{pages}, location => $params{page})) { my %seen; foreach my $link (@{$links{$page}}) { next if $seen{$link}; $seen{$link}=1; - next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion}; + next if $link =~ /.*\/\Q$config{discussionpage}\E/i && $config{discussion}; my $bestlink=bestlink($page, $link); next if length $bestlink; push @{$broken{$link}}, $page; diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 467cd9ed5..fca970c60 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -229,8 +229,9 @@ sub cgi_editpage ($$) { my $dir=$from."/"; $dir=~s![^/]+/+$!!; - if ((defined $form->field('subpage') && length $form->field('subpage')) || - $page eq lc(gettext('Discussion'))) { + if ((defined $form->field('subpage') && + length $form->field('subpage')) || + $page eq lc($config{discussionpage})) { $best_loc="$from/$page"; } else { diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 2fbb45e02..704fa711d 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -348,9 +348,6 @@ sub preprocess_inline (@) { } my $template=HTML::Template->new(@params) unless $raw; - my $discussionlink=lc(gettext("Discussion")) - if $config{discussion}; - foreach my $page (@list) { my $file = $pagesources{$page}; my $type = pagetype($file); @@ -374,14 +371,14 @@ sub preprocess_inline (@) { my $file = $pagesources{$page}; my $type = pagetype($file); if ($config{discussion}) { - if ($page !~ /.*\/\Q$discussionlink\E$/ && + if ($page !~ /.*\/\Q$config{discussionpage}\E$/ && (length $config{cgiurl} || - exists $links{$page."/".$discussionlink})) { + exists $links{$page."/".$config{discussionpage}})) { $template->param(have_actions => 1); $template->param(discussionlink => htmllink($page, $params{destpage}, - gettext("Discussion"), + $config{discussionpage}, noimageinline => 1, forcesubpage => 1)); } diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 60b193eca..1bec4b013 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -23,8 +23,7 @@ sub canedit ($$) { my $cgi=shift; my $session=shift; - my $discussion=lc(gettext("Discussion")); - return "" if $page=~/(\/|^)\Q$discussion\E$/; + return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/; return undef; } diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 7c938ef74..02f5d2524 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -34,7 +34,6 @@ sub preprocess (@) { } my @orphans; - my $discussion=lc(gettext("Discussion")); foreach my $page (pagespec_match_list( [ grep { ! $linkedto{$_} && $_ ne 'index' } keys %pagesources ], @@ -43,7 +42,7 @@ sub preprocess (@) { # indirectly linked to a page via that page's backlinks. next if grep { length $_ && - ($_ !~ /\/\Q$discussion\E$/i || ! $config{discussion}) && + ($_ !~ /\/\Q$config{discussionpage}\E$/i || ! $config{discussion}) && bestlink($page, $_) !~ /^(\Q$page\E|)$/ } @{$links{$page}}; push @orphans, $page; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index fc8f287ce..d5e81f1b9 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -83,11 +83,10 @@ sub genpage ($$) { $actions++; } if ($config{discussion}) { - my $discussionlink=lc(gettext("Discussion")); - if ($page !~ /.*\/\Q$discussionlink\E$/ && + if ($page !~ /.*\/\Q$config{discussionpage}\E$/ && (length $config{cgiurl} || - exists $links{$page."/".$discussionlink})) { - $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), noimageinline => 1, forcesubpage => 1)); + exists $links{$page."/".$config{discussionpage}})) { + $template->param(discussionlink => htmllink($page, $page, $config{discussionpage}, noimageinline => 1, forcesubpage => 1)); $actions++; } } @@ -153,7 +152,7 @@ sub scan ($) { if ($config{discussion}) { # Discussion links are a special case since they're # not in the text of the page, but on its template. - $links{$page}=[ $page."/".lc(gettext("Discussion")) ]; + $links{$page}=[ $page."/".lc($config{discussionpage}) ]; } else { $links{$page}=[]; diff --git a/debian/changelog b/debian/changelog index ed7854e8a..5e5149927 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.141593) UNRELEASED; urgency=low the old version, but continue. Closes: #541205 * inline: Avoid use of my $_ as it fails with older perls. Closes: #541215 + * Add discussionpage configuration setting. + * Small optimisations. -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 From 949eb252e9f918bd57e58b75479ed3b4c017f87d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Aug 2009 21:41:48 -0400 Subject: [PATCH 010/180] po: use discussionpage config setting This was tricky. $links{$page/discussion} must be checked; with it in lowercase. --- IkiWiki/Plugin/po.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 52677076e..b8967058e 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -284,17 +284,16 @@ sub pagetemplate (@) { map add_depends($page, $_), (values %{otherlanguages($page)}); } if ($config{discussion} && istranslation($page)) { - my $discussionlink=gettext("discussion"); - if ($page !~ /.*\/\Q$discussionlink\E$/i && + if ($page !~ /.*\/\Q$config{discussionpage}\E$/i && (length $config{cgiurl} || - exists $links{$masterpage."/".$discussionlink})) { + exists $links{$masterpage."/".lc($config{discussionpage})})) { $template->param('discussionlink' => htmllink( $page, $destpage, - $masterpage . '/' . gettext("Discussion"), + $masterpage . '/' . $config{discussionpage}, noimageinline => 1, forcesubpage => 0, - linktext => gettext("Discussion"), + linktext => $config{discussionpage}, )); } } From f486271009142ec7e04e1a62c1e94ad9e51b6d39 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 Aug 2009 00:51:52 -0400 Subject: [PATCH 011/180] orphans: Reuse backlinks info This plugin was building essentially the same data that is built to handle backlinks, so reuse that as an optimisation. --- IkiWiki/Plugin/orphans.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 02f5d2524..711226772 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -27,15 +27,9 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my %linkedto; - foreach my $p (keys %links) { - map { $linkedto{bestlink($p, $_)}=1 if length $_ } - @{$links{$p}}; - } - my @orphans; foreach my $page (pagespec_match_list( - [ grep { ! $linkedto{$_} && $_ ne 'index' } + [ grep { ! IkiWiki::backlink_pages($_) && $_ ne 'index' } keys %pagesources ], $params{pages}, location => $params{page})) { # If the page has a link to some other page, it's From 82bb3af579db809b884c7be5f49012469902bf52 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 Aug 2009 01:11:53 -0400 Subject: [PATCH 012/180] optimise brokenlinks by gathering the data when calculating backlinks During backlink calulation, all links are examined and broken links can be detected for free, so store a list of broken links and have brokenlinks use it. Exposing the %brokenlinks structure is a bit ugly, but the speedup seems worth it: Around 1 second for wikis the size of the doc wiki that use brokenlinks. --- IkiWiki/Plugin/brokenlinks.pm | 32 ++++++++++++++------------------ IkiWiki/Render.pm | 23 ++++++++++++++--------- debian/changelog | 3 ++- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index 5ad4c917c..eb698b0be 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -27,31 +27,27 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my %broken; - foreach my $page (pagespec_match_list([keys %links], - $params{pages}, location => $params{page})) { - my %seen; - foreach my $link (@{$links{$page}}) { - next if $seen{$link}; - $seen{$link}=1; - next if $link =~ /.*\/\Q$config{discussionpage}\E/i && $config{discussion}; - my $bestlink=bestlink($page, $link); - next if length $bestlink; - push @{$broken{$link}}, $page; - } - } - my @broken; - foreach my $link (keys %broken) { - my $page=$broken{$link}->[0]; + foreach my $link (keys %IkiWiki::brokenlinks) { + next if $link =~ /.*\/\Q$config{discussionpage}\E/i && $config{discussion}; + + my @pages; + foreach my $page (@{$IkiWiki::brokenlinks{$link}}) { + push @pages, $page + if pagespec_match($page, $params{pages}, location => $params{page}); + } + next unless @pages; + + my $page=$IkiWiki::brokenlinks{$link}->[0]; push @broken, sprintf(gettext("%s from %s"), htmllink($page, $params{destpage}, $link, noimageinline => 1), join(", ", map { htmllink($params{page}, $params{destpage}, $_, noimageinline => 1) - } @{$broken{$link}})); + } @pages) + ); } - return gettext("There are no broken links!") unless %broken; + return gettext("There are no broken links!") unless @broken; return "