aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-11-17 16:16:34 -0500
committerJoey Hess <joey@kodama.kitenet.net>2007-11-17 16:16:34 -0500
commit6ccd9313d2659f4b3d55cd784cefee7af0e0b5c0 (patch)
tree7671e85fc9caab8111e89c1fec24c650204df451
parent6d7202a01400e2ba5dd546f8a3923aa78b04dc0b (diff)
downloadikiwiki-6ccd9313d2659f4b3d55cd784cefee7af0e0b5c0.tar
ikiwiki-6ccd9313d2659f4b3d55cd784cefee7af0e0b5c0.tar.gz
* More compact output for the brokenlinks plugin.
-rw-r--r--IkiWiki/Plugin/brokenlinks.pm27
-rw-r--r--debian/changelog3
-rw-r--r--doc/todo/brokenlinks_should_group_links_to_a_page.mdwn2
-rw-r--r--po/ikiwiki.pot6
4 files changed, 27 insertions, 11 deletions
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index a4da7161e..ef5837a58 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
@@ -18,7 +18,7 @@ sub preprocess (@) { #{{{
# register a dependency.
add_depends($params{page}, $params{pages});
- my @broken;
+ my %broken;
foreach my $page (keys %links) {
if (pagespec_match($page, $params{pages}, location => $params{page})) {
my $discussion=gettext("discussion");
@@ -26,16 +26,29 @@ sub preprocess (@) { #{{{
next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion};
my $bestlink=bestlink($page, $link);
next if length $bestlink;
- push @broken, sprintf(gettext("%s from %s"),
- htmllink($page, $params{destpage}, $link, noimageinline => 1),
- htmllink($params{page}, $params{destpage}, $page, noimageinline => 1));
+ push @{$broken{$link}}, $page;
}
}
}
+
+ my @broken;
+ foreach my $link (keys %broken) {
+ my $page=$broken{$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}}));
+ }
- return gettext("There are no broken links!") unless @broken;
- my %seen;
- return "<ul>\n".join("\n", map { "<li>$_</li>" } grep { ! $seen{$_}++ } sort @broken)."</ul>\n";
+ return gettext("There are no broken links!") unless %broken;
+ return "<ul>\n"
+ .join("\n",
+ map {
+ "<li>$_</li>"
+ }
+ sort @broken)
+ ."</ul>\n";
} # }}}
1
diff --git a/debian/changelog b/debian/changelog
index cf7063f40..c8a9fbdbc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,8 +16,9 @@ ikiwiki (2.13) UNRELEASED; urgency=low
* Better error message when a setup file has a syntax error.
Closes: #451666
* Fix mercurial historyurl in example setup file.
+ * More compact output for the brokenlinks plugin.
- -- Joey Hess <joeyh@debian.org> Sat, 17 Nov 2007 14:43:26 -0500
+ -- Joey Hess <joeyh@debian.org> Sat, 17 Nov 2007 15:59:54 -0500
ikiwiki (2.12) unstable; urgency=low
diff --git a/doc/todo/brokenlinks_should_group_links_to_a_page.mdwn b/doc/todo/brokenlinks_should_group_links_to_a_page.mdwn
index 3f2c14404..8d7c9eb7a 100644
--- a/doc/todo/brokenlinks_should_group_links_to_a_page.mdwn
+++ b/doc/todo/brokenlinks_should_group_links_to_a_page.mdwn
@@ -17,3 +17,5 @@ target.
> that the user both won't take much care which link is clicked on
> to create it, and that both pages really meant to link to the same page
> anyway. --[[Joey]]
+
+[[done]]
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index c20db1ac4..b1842d546 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-11-14 09:23-0500\n"
+"POT-Creation-Date: 2007-11-17 16:11-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -127,12 +127,12 @@ msgstr ""
msgid "creating new page %s"
msgstr ""
-#: ../IkiWiki/Plugin/brokenlinks.pm:29
+#: ../IkiWiki/Plugin/brokenlinks.pm:37
#, perl-format
msgid "%s from %s"
msgstr ""
-#: ../IkiWiki/Plugin/brokenlinks.pm:36
+#: ../IkiWiki/Plugin/brokenlinks.pm:44
msgid "There are no broken links!"
msgstr ""