From 30b3b00f4f9a7e1ce3b460697cb347df9cc6b6ff Mon Sep 17 00:00:00 2001
From: Simon McVittie
Date: Sun, 13 Jul 2008 15:33:44 +0100
Subject: [PATCH 01/18] Mark bug "clear: both for .page*?" as [[done]]
---
...ar:_both__39____39___for___96__.page__42____39____63__.mdwn | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn b/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
index e30bf33e8..a1b5ba94a 100644
--- a/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
+++ b/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
@@ -30,7 +30,6 @@ adding this `clear: both`?
>> Then sites could choose whether to set clear:both on the inlinefooter
>> or not, and this would be separate from the same styling on whole pages.
>>
->> Implemented in [my repository](http://git.debian.org/?p=users/smcv/ikiwiki.git);
->> see the "css" branch. --[[smcv]]
+>> [[done]] --[[smcv]]
[[patch]]
From 2bd4dea7f029f30b4b07ba2e91358f5c3bf04a10 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Sun, 13 Jul 2008 13:59:36 -0400
Subject: [PATCH 02/18] changelog
---
debian/changelog | 1 +
1 file changed, 1 insertion(+)
diff --git a/debian/changelog b/debian/changelog
index f10200a52..375ae6078 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,7 @@ ikiwiki (2.54) UNRELEASED; urgency=low
uuid in feeds. (smcv)
* Move yesno function out of inline and into IkiWiki core, not exported.
* meta: fix title() PageSpec (smcv)
+ * Some footer style changes. (smcv)
-- Josh Triplett Wed, 09 Jul 2008 21:30:33 -0700
From edb59cd5b949de7a68f3b74e7949bf3893b23c6a Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Sun, 13 Jul 2008 14:41:40 -0400
Subject: [PATCH 03/18] Error handling improvement for preprocess hooks. It's
now safe to call error() from such hooks; it will cause a nicely formatted
error message to be inserted into the page.
---
IkiWiki.pm | 33 +++++++++++++++++++++------------
debian/changelog | 3 +++
doc/plugins/write.mdwn | 13 +++++++------
3 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/IkiWiki.pm b/IkiWiki.pm
index d4e19c388..80e317110 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -768,21 +768,30 @@ sub preprocess ($$$;$$) { #{{{
}
my $ret;
if (! $scan) {
- $ret=$hooks{preprocess}{$command}{call}->(
- @params,
- page => $page,
- destpage => $destpage,
- preview => $preprocess_preview,
- );
+ $ret=eval {
+ $hooks{preprocess}{$command}{call}->(
+ @params,
+ page => $page,
+ destpage => $destpage,
+ preview => $preprocess_preview,
+ );
+ };
+ if ($@) {
+ chomp $@;
+ $ret="[[!$command ".
+ gettext("Error").": $@"."]]";
+ }
}
else {
# use void context during scan pass
- $hooks{preprocess}{$command}{call}->(
- @params,
- page => $page,
- destpage => $destpage,
- preview => $preprocess_preview,
- );
+ eval {
+ $hooks{preprocess}{$command}{call}->(
+ @params,
+ page => $page,
+ destpage => $destpage,
+ preview => $preprocess_preview,
+ );
+ };
$ret="";
}
$preprocessing{$page}--;
diff --git a/debian/changelog b/debian/changelog
index 375ae6078..d5b64df34 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ ikiwiki (2.54) UNRELEASED; urgency=low
* Move yesno function out of inline and into IkiWiki core, not exported.
* meta: fix title() PageSpec (smcv)
* Some footer style changes. (smcv)
+ * Error handling improvement for preprocess hooks. It's now safe to call
+ error() from such hooks; it will cause a nicely formatted error message
+ to be inserted into the page.
-- Josh Triplett Wed, 09 Jul 2008 21:30:33 -0700
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index 6b49ec58d..4dc55e302 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -412,12 +412,13 @@ Aborts with an error message. If the second parameter is passed, it is a
function that is called after the error message is printed, to do any final
cleanup.
-Note that while any plugin can use this for a fatal error, plugins should
-try to avoid dying on bad input when building a page, as that will halt
-the entire wiki build and make the wiki unusable. So for example, if a
-[[ikiwiki/PreProcessorDirective]] is passed bad parameters, it's better to
-return an error message, which can appear on the wiki page, rather than
-calling error().
+If called inside a preprocess hook, error() does not abort the entire
+wiki build, but instead replaces the [[ikiwiki/PreProcessorDirective]] with
+a version containing the error message.
+
+In other hooks, error() is a fatal error, so use with care. Try to avoid
+dying on bad input when building a page, as that will halt
+the entire wiki build and make the wiki unusable.
#### `template($;@)`
From ffc99f5904934e6e7532bb8cfdebb44ad9ecd913 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Sun, 13 Jul 2008 15:05:34 -0400
Subject: [PATCH 04/18] switch preprocess hooks to use error function
---
IkiWiki/Plugin/aggregate.pm | 2 +-
IkiWiki/Plugin/conditional.pm | 2 +-
IkiWiki/Plugin/edittemplate.pm | 8 +++++---
IkiWiki/Plugin/fortune.pm | 2 +-
IkiWiki/Plugin/googlecalendar.pm | 2 +-
IkiWiki/Plugin/graphviz.pm | 4 ++--
IkiWiki/Plugin/img.pm | 14 ++++++-------
IkiWiki/Plugin/inline.pm | 2 +-
IkiWiki/Plugin/linkmap.pm | 4 +---
IkiWiki/Plugin/meta.pm | 6 +++---
IkiWiki/Plugin/pagetemplate.pm | 2 +-
IkiWiki/Plugin/pinger.pm | 2 +-
IkiWiki/Plugin/polygen.pm | 4 ++--
IkiWiki/Plugin/postsparkline.pm | 6 +++---
IkiWiki/Plugin/shortcut.pm | 2 +-
IkiWiki/Plugin/sparkline.pm | 16 +++++++--------
IkiWiki/Plugin/table.pm | 6 +++---
IkiWiki/Plugin/template.pm | 4 ++--
IkiWiki/Plugin/testpagespec.pm | 2 +-
IkiWiki/Plugin/teximg.pm | 6 +++---
doc/plugins/write/tutorial.mdwn | 4 ++--
po/ikiwiki.pot | 34 ++++++++++++++++----------------
22 files changed, 67 insertions(+), 67 deletions(-)
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index b5354a823..f61804237 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -131,7 +131,7 @@ sub preprocess (@) { #{{{
foreach my $required (qw{name url}) {
if (! exists $params{$required}) {
- return "[[aggregate ".sprintf(gettext("missing %s parameter"), $required)."]]";
+ error sprintf(gettext("missing %s parameter"), $required)
}
}
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index 57db01054..6be52eaa6 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -15,7 +15,7 @@ sub preprocess_if (@) { #{{{
foreach my $param (qw{test then}) {
if (! exists $params{$param}) {
- return "[[if ".sprintf(gettext('%s parameter is required'), $param)."]]";
+ error sprintf(gettext('%s parameter is required'), $param);
}
}
diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm
index 76c1cd42a..d1716a315 100644
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
@@ -38,10 +38,10 @@ sub preprocess (@) { #{{{
return "" if $params{page} ne $params{destpage};
if (! exists $params{template} || ! length($params{template})) {
- return "[[meta ".gettext("template not specified")."]]";
+ error gettext("template not specified")
}
if (! exists $params{match} || ! length($params{match})) {
- return "[[meta ".gettext("match not specified")."]]";
+ error gettext("match not specified")
}
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -108,7 +108,9 @@ sub filltemplate ($$) { #{{{
);
};
if ($@) {
- return "[[pagetemplate ".gettext("failed to process")." $@]]";
+ # Indicate that the earlier preprocessor directive set
+ # up a template that doesn't work.
+ return "[[!pagetemplate ".gettext("failed to process")." $@]]";
}
$template->param(name => $page);
diff --git a/IkiWiki/Plugin/fortune.pm b/IkiWiki/Plugin/fortune.pm
index a3b13f687..a78a73d5f 100644
--- a/IkiWiki/Plugin/fortune.pm
+++ b/IkiWiki/Plugin/fortune.pm
@@ -15,7 +15,7 @@ sub preprocess (@) { #{{{
my $f = `fortune 2>/dev/null`;
if ($?) {
- return "[[".gettext("fortune failed")."]]";
+ error gettext("fortune failed");
}
else {
return "$f
\n";
diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm
index c6409e5e6..7efa1daa3 100644
--- a/IkiWiki/Plugin/googlecalendar.pm
+++ b/IkiWiki/Plugin/googlecalendar.pm
@@ -19,7 +19,7 @@ sub preprocess (@) { #{{{
# Avoid XSS attacks..
my ($url)=$params{html}=~m#iframe\s+src="http://www\.google\.com/calendar/embed\?([^"<>]+)"#;
if (! defined $url || ! length $url) {
- return "[[googlecalendar ".gettext("failed to find url in html")."]]";
+ error gettext("failed to find url in html")
}
my ($height)=$params{html}=~m#height="(\d+)"#;
my ($width)=$params{html}=~m#width="(\d+)"#;
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index fe3559857..b13d15fa6 100644
--- a/IkiWiki/Plugin/graphviz.pm
+++ b/IkiWiki/Plugin/graphviz.pm
@@ -55,7 +55,7 @@ sub render_graph (\%) { #{{{
waitpid $pid, 0;
$SIG{PIPE}="DEFAULT";
- return "[[graph ".gettext("failed to run graphviz")."]]" if ($sigpipe);
+ error gettext("failed to run graphviz") if $sigpipe;
if (! $params{preview}) {
writefile($dest, $config{destdir}, $png, 1);
@@ -82,7 +82,7 @@ sub graph (@) { #{{{
$params{src} = "" unless defined $params{src};
$params{type} = "digraph" unless defined $params{type};
$params{prog} = "dot" unless defined $params{prog};
- return "[[graph ".gettext("prog not a valid graphviz program")."]]" unless $graphviz_programs{$params{prog}};
+ error gettext("prog not a valid graphviz program") unless $graphviz_programs{$params{prog}};
return render_graph(%params);
} # }}}
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 49e1d57d6..17a9367d3 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -46,14 +46,14 @@ sub preprocess (@) { #{{{
my $base = IkiWiki::basename($file);
eval q{use Image::Magick};
- return "[[img ".gettext("Image::Magick not installed")."]]" if $@;
+ error gettext("Image::Magick is not installed") if $@;
my $im = Image::Magick->new;
my $imglink;
my $r;
if ($params{size} ne 'full') {
my ($w, $h) = ($params{size} =~ /^(\d+)x(\d+)$/);
- return "[[img ".sprintf(gettext('bad size "%s"'), $params{size})."]]"
+ error sprintf(gettext('bad size "%s"'), $params{size})
unless (defined $w && defined $h);
my $outfile = "$config{destdir}/$dir/${w}x${h}-$base";
@@ -63,14 +63,14 @@ sub preprocess (@) { #{{{
if (-e $outfile && (-M srcfile($file) >= -M $outfile)) {
$r = $im->Read($outfile);
- return "[[img ".sprintf(gettext("failed to read %s: %s"), $outfile, $r)."]]" if $r;
+ error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
}
else {
$r = $im->Read(srcfile($file));
- return "[[img ".sprintf(gettext("failed to read %s: %s"), $file, $r)."]]" if $r;
+ error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
$r = $im->Resize(geometry => "${w}x${h}");
- return "[[img ".sprintf(gettext("failed to resize: %s"), $r)."]]" if $r;
+ error sprintf(gettext("failed to resize: %s"), $r) if $r;
# don't actually write file in preview mode
if (! $params{preview}) {
@@ -84,7 +84,7 @@ sub preprocess (@) { #{{{
}
else {
$r = $im->Read(srcfile($file));
- return "[[img ".sprintf(gettext("failed to read %s: %s"), $file, $r)."]]" if $r;
+ error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
$imglink = $file;
}
@@ -101,7 +101,7 @@ sub preprocess (@) { #{{{
}
if (! defined($im->Get("width")) || ! defined($im->Get("height"))) {
- return "[[img ".sprintf(gettext("failed to determine size of image %s"), $file)."]]";
+ error sprintf(gettext("failed to determine size of image %s"), $file)
}
my $imgtag=' sub {
if (substr($File::Find::name, -length($grammar)) eq $grammar) {
@@ -48,7 +48,7 @@ sub preprocess (@) { #{{{
}
if ($?) {
- $res="[[".gettext("polygen failed")."]]";
+ error gettext("command failed");
}
# Strip trailing spaces and newlines so that we flow well with the
diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm
index 9e885741e..6fc96f8b3 100644
--- a/IkiWiki/Plugin/postsparkline.pm
+++ b/IkiWiki/Plugin/postsparkline.pm
@@ -29,14 +29,14 @@ sub preprocess (@) { #{{{
}
if (! exists $params{formula}) {
- return "[[postsparkline ".gettext("missing formula")."]]";
+ error gettext("missing formula")
}
my $formula=$params{formula};
$formula=~s/[^a-zA-Z0-9]*//g;
$formula=IkiWiki::possibly_foolish_untaint($formula);
if (! length $formula ||
! IkiWiki::Plugin::postsparkline::formula->can($formula)) {
- return "[[postsparkline ".gettext("unknown formula")."]]";
+ error gettext("unknown formula");
}
add_depends($params{page}, $params{pages});
@@ -53,7 +53,7 @@ sub preprocess (@) { #{{{
my @data=eval qq{IkiWiki::Plugin::postsparkline::formula::$formula(\\\%params, \@list)};
if ($@) {
- return "[[postsparkline error $@]]";
+ error $@;
}
if (! @data) {
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm
index f1a38ea48..8df60cfe2 100644
--- a/IkiWiki/Plugin/shortcut.pm
+++ b/IkiWiki/Plugin/shortcut.pm
@@ -24,7 +24,7 @@ sub preprocess_shortcut (@) { #{{{
my %params=@_;
if (! defined $params{name} || ! defined $params{url}) {
- return "[[shortcut ".gettext("missing name or url parameter")."]]";
+ error gettext("missing name or url parameter");
}
hook(type => "preprocess", no_override => 1, id => $params{name},
diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm
index 69b3512c2..bcff46aeb 100644
--- a/IkiWiki/Plugin/sparkline.pm
+++ b/IkiWiki/Plugin/sparkline.pm
@@ -60,13 +60,13 @@ sub preprocess (@) { #{{{
}
}
elsif (! length $value) {
- return "[[sparkline ".gettext("parse error")." \"$key\"]]";
+ error gettext("parse error")." \"$key\"";
}
elsif ($key eq 'featurepoint') {
my ($x, $y, $color, $diameter, $text, $location)=
split(/\s*,\s*/, $value);
if (! defined $diameter || $diameter < 0) {
- return "[[sparkline ".gettext("bad featurepoint diameter")."]]";
+ error gettext("bad featurepoint diameter");
}
$x=int($x);
$y=int($y);
@@ -76,7 +76,7 @@ sub preprocess (@) { #{{{
if (defined $location) {
$location=$locmap{$location};
if (! defined $location) {
- return "[[sparkline ".gettext("bad featurepoint location")."]]";
+ error gettext("bad featurepoint location");
}
}
$php.=qq{\$sparkline->SetFeaturePoint($x, $y, '$color', $diameter};
@@ -87,23 +87,23 @@ sub preprocess (@) { #{{{
}
if ($c eq 0) {
- return "[[sparkline ".gettext("missing values")."]]";
+ error gettext("missing values");
}
my $height=int($params{height} || 20);
if ($height < 2 || $height > 100) {
- return "[[sparkline ".gettext("bad height value")."]]";
+ error gettext("bad height value");
}
if ($style eq "Bar") {
$php.=qq{\$sparkline->Render($height);\n};
}
else {
if (! exists $params{width}) {
- return "[[sparkline ".gettext("missing width parameter")."]]";
+ error gettext("missing width parameter");
}
my $width=int($params{width});
if ($width < 2 || $width > 1024) {
- return "[[sparkline ".gettext("bad width value")."]]";
+ error gettext("bad width value");
}
$php.=qq{\$sparkline->RenderResampled($width, $height);\n};
}
@@ -141,7 +141,7 @@ sub preprocess (@) { #{{{
waitpid $pid, 0;
$SIG{PIPE}="DEFAULT";
if ($sigpipe) {
- return "[[sparkline ".gettext("failed to run php")."]]";
+ error gettext("failed to run php");
}
if (! $params{preview}) {
diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm
index 11474c8f0..892ea182e 100644
--- a/IkiWiki/Plugin/table.pm
+++ b/IkiWiki/Plugin/table.pm
@@ -19,7 +19,7 @@ sub preprocess (@) { #{{{
if (exists $params{file}) {
if (! $pagesources{$params{file}}) {
- return "[[table ".gettext("cannot find file")."]]";
+ error gettext("cannot find file");
}
$params{data} = readfile(srcfile($params{file}));
add_depends($params{page}, $params{file});
@@ -61,7 +61,7 @@ sub preprocess (@) { #{{{
defined $params{delimiter} ? $params{delimiter} : "|",);
}
else {
- return "[[table ".gettext("unknown data format")."]]";
+ error gettext("unknown data format");
}
my $header;
@@ -69,7 +69,7 @@ sub preprocess (@) { #{{{
$header=shift @data;
}
if (! @data) {
- return "[[table ".gettext("empty data")."]]";
+ error gettext("empty data");
}
my @lines;
diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index aa1f57c07..c33dbbb83 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -16,7 +16,7 @@ sub preprocess (@) { #{{{
my %params=@_;
if (! exists $params{id}) {
- return "[[template ".gettext("missing id parameter")."]]";
+ error gettext("missing id parameter")
}
my $template_page="templates/$params{id}";
@@ -42,7 +42,7 @@ sub preprocess (@) { #{{{
);
};
if ($@) {
- return "[[template ".gettext("failed to process:")." $@]]";
+ error gettext("failed to process:")." $@"
}
$params{basename}=IkiWiki::basename($params{page});
diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm
index f9ec90d87..4faef7be1 100644
--- a/IkiWiki/Plugin/testpagespec.pm
+++ b/IkiWiki/Plugin/testpagespec.pm
@@ -14,7 +14,7 @@ sub preprocess (@) { #{{{
foreach my $param (qw{match pagespec}) {
if (! exists $params{$param}) {
- return "[[testpagespec $param parameter is required]]";
+ error sprintf(gettext("%s parameter is required"), $param);
}
}
diff --git a/IkiWiki/Plugin/teximg.pm b/IkiWiki/Plugin/teximg.pm
index 8c3e88c69..6a6bdd4fa 100644
--- a/IkiWiki/Plugin/teximg.pm
+++ b/IkiWiki/Plugin/teximg.pm
@@ -27,14 +27,14 @@ sub preprocess (@) { #{{{
my $code = $params{code};
if (! defined $code && ! length $code) {
- return "[[teximg ".gettext("missing tex code"). "]]";
+ error gettext("missing tex code");
}
if (check($code)) {
return create($code, check_height($height), \%params);
}
else {
- return "[[teximg ".gettext("code includes disallowed latex commands"). "]]";
+ error gettext("code includes disallowed latex commands")
}
} #}}}
@@ -85,7 +85,7 @@ sub create ($$$) { #{{{
.qq{" class="teximg" />};
}
else {
- return qq{[[teximg }.gettext("failed to generate image from code")."]]";
+ error qq{}.gettext("failed to generate image from code")."";
}
} #}}}
diff --git a/doc/plugins/write/tutorial.mdwn b/doc/plugins/write/tutorial.mdwn
index 8b12fd183..94b72c763 100644
--- a/doc/plugins/write/tutorial.mdwn
+++ b/doc/plugins/write/tutorial.mdwn
@@ -169,7 +169,7 @@ be a guard on how high it will go.
}
my $num=$last{$page}++;
if ($num > 25) {
- return "[[fib will only calculate the first 25 numbers in the sequence]]";
+ error "can only calculate the first 25 numbers in the sequence";
}
return fib($num);
}
@@ -182,7 +182,7 @@ does for numbers less than 1. Or for any number that's not an integer. In
either case, it will run forever. Here's one way to fix that:
if (int($num) != $num || $num < 1) {
- return "[[fib positive integers only, please]]";
+ error "positive integers only, please";
}
As these security problems have demonstrated, even a simple input from the
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index f94f5bdd3..71cddfdd0 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: 2008-07-12 23:07-0400\n"
+"POT-Creation-Date: 2008-07-13 15:04-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -71,7 +71,7 @@ msgstr ""
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759
+#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:782
msgid "Error"
msgstr ""
@@ -194,7 +194,7 @@ msgstr ""
msgid "There are no broken links!"
msgstr ""
-#: ../IkiWiki/Plugin/conditional.pm:18
+#: ../IkiWiki/Plugin/conditional.pm:18 ../IkiWiki/Plugin/testpagespec.pm:17
#, perl-format
msgid "%s parameter is required"
msgstr ""
@@ -212,7 +212,7 @@ msgstr ""
msgid "edittemplate %s registered for %s"
msgstr ""
-#: ../IkiWiki/Plugin/edittemplate.pm:111
+#: ../IkiWiki/Plugin/edittemplate.pm:113
msgid "failed to process"
msgstr ""
@@ -233,7 +233,7 @@ msgid "prog not a valid graphviz program"
msgstr ""
#: ../IkiWiki/Plugin/img.pm:49
-msgid "Image::Magick not installed"
+msgid "Image::Magick is not installed"
msgstr ""
#: ../IkiWiki/Plugin/img.pm:56
@@ -287,7 +287,7 @@ msgstr ""
msgid "RPC::XML::Client not found, not pinging"
msgstr ""
-#: ../IkiWiki/Plugin/linkmap.pm:98
+#: ../IkiWiki/Plugin/linkmap.pm:97
msgid "failed to run dot"
msgstr ""
@@ -408,7 +408,7 @@ msgid "polygen not installed"
msgstr ""
#: ../IkiWiki/Plugin/polygen.pm:51
-msgid "polygen failed"
+msgid "command failed"
msgstr ""
#: ../IkiWiki/Plugin/postsparkline.pm:32
@@ -612,47 +612,47 @@ msgstr ""
msgid "getctime not implemented"
msgstr ""
-#: ../IkiWiki/Render.pm:286 ../IkiWiki/Render.pm:307
+#: ../IkiWiki/Render.pm:290 ../IkiWiki/Render.pm:311
#, perl-format
msgid "skipping bad filename %s"
msgstr ""
-#: ../IkiWiki/Render.pm:361
+#: ../IkiWiki/Render.pm:365
#, perl-format
msgid "removing old page %s"
msgstr ""
-#: ../IkiWiki/Render.pm:401
+#: ../IkiWiki/Render.pm:405
#, perl-format
msgid "scanning %s"
msgstr ""
-#: ../IkiWiki/Render.pm:406
+#: ../IkiWiki/Render.pm:410
#, perl-format
msgid "rendering %s"
msgstr ""
-#: ../IkiWiki/Render.pm:427
+#: ../IkiWiki/Render.pm:431
#, perl-format
msgid "rendering %s, which links to %s"
msgstr ""
-#: ../IkiWiki/Render.pm:448
+#: ../IkiWiki/Render.pm:452
#, perl-format
msgid "rendering %s, which depends on %s"
msgstr ""
-#: ../IkiWiki/Render.pm:487
+#: ../IkiWiki/Render.pm:491
#, perl-format
msgid "rendering %s, to update its backlinks"
msgstr ""
-#: ../IkiWiki/Render.pm:499
+#: ../IkiWiki/Render.pm:503
#, perl-format
msgid "removing %s, no longer rendered by %s"
msgstr ""
-#: ../IkiWiki/Render.pm:523
+#: ../IkiWiki/Render.pm:527
#, perl-format
msgid "ikiwiki: cannot render %s"
msgstr ""
@@ -729,6 +729,6 @@ msgstr ""
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1203
+#: ../IkiWiki.pm:1212
msgid "yes"
msgstr ""
From 9957c7fd5d17afdc2e7e4248ca8a961731048d51 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Sun, 13 Jul 2008 15:46:20 -0400
Subject: [PATCH 05/18] Cut the size of the binary package in half by excluding
pages for bugs and todo items from the html shipped in it.
---
debian/changelog | 2 ++
docwiki.setup | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index d5b64df34..3c535fd5f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ ikiwiki (2.54) UNRELEASED; urgency=low
* Error handling improvement for preprocess hooks. It's now safe to call
error() from such hooks; it will cause a nicely formatted error message
to be inserted into the page.
+ * Cut the size of the binary package in half by excluding pages for bugs
+ and todo items from the html shipped in it.
-- Josh Triplett Wed, 09 Jul 2008 21:30:33 -0700
diff --git a/docwiki.setup b/docwiki.setup
index 0a6a86678..ba3dd680d 100644
--- a/docwiki.setup
+++ b/docwiki.setup
@@ -9,7 +9,7 @@ use IkiWiki::Setup::Standard {
underlaydir => "underlays/basewiki",
wrappers => [],
discussion => 0,
- exclude => qr/\/discussion/,
+ exclude => qr/\/discussion|bugs\/*|todo\/*/,
locale => '',
verbose => 1,
syslog => 0,
From 219e7e29a49a55a02e5ec6213a41aa82afdad5a0 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 10:14:13 -0400
Subject: [PATCH 06/18] web commit by intrigeri: initial pedigree plugin
proposal
---
doc/todo/pedigree_plugin.mdwn | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 doc/todo/pedigree_plugin.mdwn
diff --git a/doc/todo/pedigree_plugin.mdwn b/doc/todo/pedigree_plugin.mdwn
new file mode 100644
index 000000000..2ff9487f1
--- /dev/null
+++ b/doc/todo/pedigree_plugin.mdwn
@@ -0,0 +1,30 @@
+After realizing (thanks to
+[[Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename]])
+that I needed some kind of "parentlinks on steroids", I wrote a new
+plugin, called pedigree.
+
+This plugin provides a bunch of loops that one can use in his/her
+`HTML::Template`'s to iterate over all or a subset of a page's
+parents. Inside these loops, half a dozen variables are made
+available, in addition to `PAGE` and `URL` that are already provided
+by parentlinks.
+
+Amongst many possibilities, one can e.g. simply use this plugin to
+give every parent link a different `class=` attribute, depending
+either on its depth in the path leading to the current page, or on its
+distance to it.
+
+The code and documentation (including simple and complex usage
+examples) are in the 'pedigree' Git branch in this repo:
+
+ git://repo.or.cz/ikiwiki/intrigeri.git
+
+Seems there is also a [gitweb](http://repo.or.cz/w/ikiwiki/intrigeri.git).
+
+Any opinions on the idea/design/implementation?
+
+What needs to be changed so that it's possible to include it in
+mainline ikiwiki?
+
+(I'll try never to rebase this branch, but writing this plugin has
+been a pretext for me to start learning Git, so...)
From a3c8465565cdee1f5d71c4a537329e21593c750a Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 10:15:37 -0400
Subject: [PATCH 07/18] web commit by http://ptecza.myopenid.com/: * Broken URL
---
doc/bugs/Broken_URL_to_your_blog_script.mdwn | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 doc/bugs/Broken_URL_to_your_blog_script.mdwn
diff --git a/doc/bugs/Broken_URL_to_your_blog_script.mdwn b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
new file mode 100644
index 000000000..0099104d4
--- /dev/null
+++ b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
@@ -0,0 +1,8 @@
+Joey, I would like to see your blog script I've found
+at [[Tips|tips/blog_script]] page, but it seems that the URL
+(http://git.kitenet.net/?p=joey/home;a=blob_plain;f=bin/blog)
+to its Git repo is broken:
+
+ 403 Forbidden - No such project
+
+--[[Paweł|ptecza]]
From 59ad1a440aa71be06f2db8fdd1edb98f3f0bd39b Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 10:15:53 -0400
Subject: [PATCH 08/18] web commit by intrigeri: added link to pedigree_plugin
---
...to_include_part_of_the_path_in_addition_to_the_basename.mdwn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn b/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
index 27d238ecd..b97c81efa 100644
--- a/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
+++ b/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
@@ -75,5 +75,5 @@ a dedicated plugin, called `genealogictitle` or whatever, and :
>> Well, it seems I once more designed a solution before clearly
>> defining my problem... What I really need is more generic, can be
->> done as a plugin, and deserves its own todo item (yet to come), so
+>> done as a plugin, and deserves its own [[todo|pedigree_plugin]], so
>> I'm tagging this one wontfix^W [[done]]. I'm sorry. -- intrigeri
From 5f4c424f3b549571330f43109eb022ddd16f35ba Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 10:18:50 -0400
Subject: [PATCH 09/18] web commit by intrigeri: added suggestion to move
functionnality from the core to pedigree plugin
---
doc/todo/pedigree_plugin.mdwn | 2 ++
1 file changed, 2 insertions(+)
diff --git a/doc/todo/pedigree_plugin.mdwn b/doc/todo/pedigree_plugin.mdwn
index 2ff9487f1..fb1e2a4e5 100644
--- a/doc/todo/pedigree_plugin.mdwn
+++ b/doc/todo/pedigree_plugin.mdwn
@@ -28,3 +28,5 @@ mainline ikiwiki?
(I'll try never to rebase this branch, but writing this plugin has
been a pretext for me to start learning Git, so...)
+
+To finish with, it seems no plugin bundled with ikiwiki uses the current parentlinks implementation, so one could event think of moving it from the core to this plugin (which should then be enabled by default, since the default templates do use parentlinks ;).
From f8de860a44eabe5f954641d48d0bdf2e804519d7 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 11:29:19 -0400
Subject: [PATCH 10/18] web commit by http://ptecza.myopenid.com/: * Request
for color plugin
---
doc/todo/color_plugin.mdwn | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 doc/todo/color_plugin.mdwn
diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn
new file mode 100644
index 000000000..f8fd11091
--- /dev/null
+++ b/doc/todo/color_plugin.mdwn
@@ -0,0 +1,16 @@
+Recently I've wanted to colour some piece of text on my Ikiwiki page.
+It seems that Markdown can do it only using HTML tags, so I used
+<span class="color">foo bar baz</span>.
+
+However, in my opinion mixing Markdown syntax and HTML tags is rather ugly,
+so maybe we should create a new color plugin to add more color to Ikiwiki ;)
+I know that another Wikis have similar plugin, for example
+[WikiDot](http://www.wikidot.com/).
+
+I've noticed that htmlscrubber plugin strips `style` attribute, because of
+security, so probably we need to use `class` attribute of HTML. But then
+we have to customize our `local.css` file to add all color we want to use.
+It's not as easy in usage like color name or definition as plugin argument,
+but I don't have a better idea right now.
+
+What do you think about it? --[[Paweł|ptecza]]
From d0d9ae5f8c548f87ba3ad3bdb2271b69920cf7cc Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 14:07:36 -0400
Subject: [PATCH 11/18] response
---
doc/todo/pedigree_plugin.mdwn | 39 ++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/doc/todo/pedigree_plugin.mdwn b/doc/todo/pedigree_plugin.mdwn
index fb1e2a4e5..100d94b83 100644
--- a/doc/todo/pedigree_plugin.mdwn
+++ b/doc/todo/pedigree_plugin.mdwn
@@ -21,12 +21,45 @@ examples) are in the 'pedigree' Git branch in this repo:
Seems there is also a [gitweb](http://repo.or.cz/w/ikiwiki/intrigeri.git).
+> Ok, I'll take a look. BTW, could you allow user joey on repo.or.cz
+> push access to the main ikiwiki repo you set up there? --[[Joey]]
+
Any opinions on the idea/design/implementation?
-What needs to be changed so that it's possible to include it in
-mainline ikiwiki?
+> Seems that there should be a more generic way to do `PEDIGREE_BUT_ROOT`
+> and `PEDIGREE_BUT_TWO_OLDEST` (also `is_second_ancestor`,
+> `is_grand_mother` etc). One way would be to include in `PEDIGREE`
+> a set of values like `depth_1`, `depth_2`, etc. The one corresponding
+> to the `absdepth` would be true. This would allow a template like this:
+
+
+
+
+
+
+ /* only showing pages 2 levels deep */
+
+
+
+
+> The only missing information would be `reldepth`, but in the above
+> example the author of that template knows that it's `absdepth - 1`
+> (Things would be a lot nicer if `HTML::Template` had equality tests!)
+>
+> Since this would make it more generic and also fix your one documented
+> bug, I can see no reason not to do it. ;-) --[[Joey]]
(I'll try never to rebase this branch, but writing this plugin has
been a pretext for me to start learning Git, so...)
-To finish with, it seems no plugin bundled with ikiwiki uses the current parentlinks implementation, so one could event think of moving it from the core to this plugin (which should then be enabled by default, since the default templates do use parentlinks ;).
+To finish with, it seems no plugin bundled with ikiwiki uses the current
+parentlinks implementation, so one could event think of moving it from the
+core to this plugin (which should then be enabled by default, since the
+default templates do use parentlinks ;).
+
+> I think that moving parentlinks out to a plugin is a good idea.
+> However, if it's done, I think the plugin should be named parentlinks,
+> and should continue to use the same template variables as are used now,
+> to avoid needing to change custom templates. Pedigree is a quite nice
+> name, but renaming it to parentlinks seems to be the way to go to me.
+> --[[Joey]]
From 5d027102f50f5a6fb74d67c7a04e88fde542d7b3 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 15:20:37 -0400
Subject: [PATCH 12/18] fix link
---
doc/bugs/Broken_URL_to_your_blog_script.mdwn | 2 ++
doc/tips/blog_script.mdwn | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/bugs/Broken_URL_to_your_blog_script.mdwn b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
index 0099104d4..3d6661d9c 100644
--- a/doc/bugs/Broken_URL_to_your_blog_script.mdwn
+++ b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
@@ -6,3 +6,5 @@ to its Git repo is broken:
403 Forbidden - No such project
--[[Paweł|ptecza]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/tips/blog_script.mdwn b/doc/tips/blog_script.mdwn
index b0f5f14c1..1dfd71538 100644
--- a/doc/tips/blog_script.mdwn
+++ b/doc/tips/blog_script.mdwn
@@ -1,4 +1,4 @@
-I have a [blog](http://git.kitenet.net/?p=joey/home;a=blob_plain;f=bin/blog)
+I have a [blog](http://git.kitenet.net/?p=joey/home.git;a=blob_plain;f=bin/blog)
program that I use to write blog posts in a text editor. The first line I
enter is used as the title, and it automatically comes up with a unique page
name based on the title and handles all the details of posting to my blog.
From aa92d75b4a2e8f6fd6dc38e3fb898f4667cd6f70 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 15:53:09 -0400
Subject: [PATCH 13/18] web commit by XTaran: Correct information about hooks
---
doc/rcs/mercurial.mdwn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/rcs/mercurial.mdwn b/doc/rcs/mercurial.mdwn
index 5eaae1997..5123b2c7b 100644
--- a/doc/rcs/mercurial.mdwn
+++ b/doc/rcs/mercurial.mdwn
@@ -2,7 +2,7 @@
system developed by Matt Mackall. Ikiwiki supports storing a wiki in a
mercurial repository.
-Ikiwiki can run as a post-update hook to update a wiki whenever commits
+Ikiwiki can run as a post-commit and/or install hook to update a wiki whenever commits or remote pushes
come in. When running as a [[cgi]] with Mercurial, ikiwiki automatically
commits edited pages, and uses the Mercurial history to generate the
[[RecentChanges]] page.
From f6e01e53fdbfd8369ffd5860424cbb02b4dbc39c Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 15:57:11 -0400
Subject: [PATCH 14/18] web commit by XTaran: Cross reference to todo/mercurial
---
doc/rcs/mercurial.mdwn | 2 ++
1 file changed, 2 insertions(+)
diff --git a/doc/rcs/mercurial.mdwn b/doc/rcs/mercurial.mdwn
index 5123b2c7b..020edfc12 100644
--- a/doc/rcs/mercurial.mdwn
+++ b/doc/rcs/mercurial.mdwn
@@ -6,3 +6,5 @@ Ikiwiki can run as a post-commit and/or install hook to update a wiki whenever c
come in. When running as a [[cgi]] with Mercurial, ikiwiki automatically
commits edited pages, and uses the Mercurial history to generate the
[[RecentChanges]] page.
+
+See also [[todo/mercurial|todo/mercurial]]
From be16270a09329f51ff85f9d9def6058b38c27b6e Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 16:05:10 -0400
Subject: [PATCH 15/18] web commit by XTaran: Example hgrc, some markup, one
correction of one of my previous changes
---
doc/rcs/mercurial.mdwn | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/doc/rcs/mercurial.mdwn b/doc/rcs/mercurial.mdwn
index 020edfc12..b4baf07f4 100644
--- a/doc/rcs/mercurial.mdwn
+++ b/doc/rcs/mercurial.mdwn
@@ -2,9 +2,17 @@
system developed by Matt Mackall. Ikiwiki supports storing a wiki in a
mercurial repository.
-Ikiwiki can run as a post-commit and/or install hook to update a wiki whenever commits or remote pushes
+Ikiwiki can run as a `post-commit` and/or `incoming` hook to update a wiki whenever commits or remote pushes
come in. When running as a [[cgi]] with Mercurial, ikiwiki automatically
commits edited pages, and uses the Mercurial history to generate the
[[RecentChanges]] page.
+Example for a `.hg/hgrc` file in `$SRCDIR`:
+
+ [hooks]
+ post-commit = /home/abe/bin/rebuildwiki
+ incoming = /home/abe/bin/rebuildwiki
+
+Do not use `commit` or `precommit` hooks or ikiwiki will run into a dead lock when committing in `$SRCDIR`
+
See also [[todo/mercurial|todo/mercurial]]
From 901487df5ed213c7e82bf176d369617fdd1fbda3 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 16:10:47 -0400
Subject: [PATCH 16/18] web commit by XTaran: post-commit hooks work fine here
at least with recent ikwiki versions and hg 1.0.x -> remove it from todo list
---
doc/todo/mercurial.mdwn | 2 --
1 file changed, 2 deletions(-)
diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn
index 0a1098f70..77b538c02 100644
--- a/doc/todo/mercurial.mdwn
+++ b/doc/todo/mercurial.mdwn
@@ -1,5 +1,3 @@
-* Need to get post commit hook working (or an example of how to use it.)
- * See below. --[[bma]]
* rcs_notify is not implemented (not needed in this branch --[[Joey]])
* Is the code sufficiently robust? It just warns when mercurial fails.
* When rcs_commit is called with a $user that is an openid, it will be
From aecfebc26d000ab228cd406f5ac51df69352fbae Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 16:08:54 -0400
Subject: [PATCH 17/18] response
---
doc/todo/color_plugin.mdwn | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn
index f8fd11091..ac6eb8c51 100644
--- a/doc/todo/color_plugin.mdwn
+++ b/doc/todo/color_plugin.mdwn
@@ -14,3 +14,15 @@ It's not as easy in usage like color name or definition as plugin argument,
but I don't have a better idea right now.
What do you think about it? --[[Paweł|ptecza]]
+
+> Making a plugin preserve style attributes can be done, it just has to add
+> them after the sanitize step, which strips them. The general method is
+> adding placeholders first, and replacing them with the real html later.
+>
+> The hard thing to me seems to be finding a syntax that is better than a
+> ``. A preprocessor directive is not really any less ugly than html
+> tags, though at least it could play nicely with nested markdown: --[[Joey]]
+>
+> \[[color red,green """
+> Xmas-colored markdown here
+> """]]
From 66053f6fc7b300c9b49a5c69d2c7a1eeec841743 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Mon, 14 Jul 2008 17:22:06 -0400
Subject: [PATCH 18/18] web commit by intrigeri: pedigree: (begining of) answer
---
doc/todo/pedigree_plugin.mdwn | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/doc/todo/pedigree_plugin.mdwn b/doc/todo/pedigree_plugin.mdwn
index 100d94b83..8214385d2 100644
--- a/doc/todo/pedigree_plugin.mdwn
+++ b/doc/todo/pedigree_plugin.mdwn
@@ -24,6 +24,10 @@ Seems there is also a [gitweb](http://repo.or.cz/w/ikiwiki/intrigeri.git).
> Ok, I'll take a look. BTW, could you allow user joey on repo.or.cz
> push access to the main ikiwiki repo you set up there? --[[Joey]]
+>> I did not. The main ikiwiki repo on repo.or.cz seems to have been
+>> been setup by johannes.schindelin@gmx.de ; mine is what they call
+>> a "fork" (but it's not, obviously).
+
Any opinions on the idea/design/implementation?
> Seems that there should be a more generic way to do `PEDIGREE_BUT_ROOT`
@@ -49,6 +53,11 @@ Any opinions on the idea/design/implementation?
> Since this would make it more generic and also fix your one documented
> bug, I can see no reason not to do it. ;-) --[[Joey]]
+>> Thanks for your comments. I'll answer soon. (Grrr, I really
+>> need to find a way to edit this wiki offline, every minute
+>> online costs bucks to me, my old modem gently weeps,
+>> and I hate webbrowsers.) -- intrigeri
+
(I'll try never to rebase this branch, but writing this plugin has
been a pretext for me to start learning Git, so...)
@@ -63,3 +72,5 @@ default templates do use parentlinks ;).
> to avoid needing to change custom templates. Pedigree is a quite nice
> name, but renaming it to parentlinks seems to be the way to go to me.
> --[[Joey]]
+
+>> Agreed. -- intrigeri