push @{$links{$page}}, $link
unless grep { $_ eq $link } @{$links{$page}};
+
+ if (defined $type) {
+ $typedlinks{$page}{$type}{$link} = 1;
+ }
}
+ sub sortspec_translate ($) {
+ my $spec = shift;
+
+ my $code = "";
+ my @data;
+ while ($spec =~ m{
+ \s*
+ (-?) # group 1: perhaps negated
+ \s*
+ ( # group 2: a word
+ \w+\([^\)]*\) # command(params)
+ |
+ [^\s]+ # or anything else
+ )
+ \s*
+ }gx) {
+ my $negated = $1;
+ my $word = $2;
+ my $params = undef;
+
+ if ($word =~ m/^(\w+)\((.*)\)$/) {
+ # command with parameters
+ $params = $2;
+ $word = $1;
+ }
+ elsif ($word !~ m/^\w+$/) {
+ error(sprintf(gettext("invalid sort type %s"), $word));
+ }
+
+ if (length $code) {
+ $code .= " || ";
+ }
+
+ if ($negated) {
+ $code .= "-";
+ }
+
+ if (exists $IkiWiki::SortSpec::{"cmp_$word"}) {
+ if (defined $params) {
+ push @data, $params;
+ $code .= "IkiWiki::SortSpec::cmp_$word(\$data[$#data])";
+ }
+ else {
+ $code .= "IkiWiki::SortSpec::cmp_$word(undef)";
+ }
+ }
+ else {
+ error(sprintf(gettext("unknown sort type %s"), $word));
+ }
+ }
+
+ if (! length $code) {
+ # undefined sorting method... sort arbitrarily
+ return sub { 0 };
+ }
+
+ no warnings;
+ return eval 'sub { '.$code.' }';
+ }
+
sub pagespec_translate ($) {
my $spec=shift;
-ikiwiki (3.20100320) UNRELEASED; urgency=low
+ikiwiki (3.20100406) unstable; urgency=low
++
++ The title_natural sort method (as used by the inline directive, etc)
++ have been moved to the new sortnaturally plugin, which is not enabled
++ by default since it requires the Sort::Naturally perl module.
- The sort="title_natural" option on [[!inline]] etc. now requires the
- new sortnaturally plugin. This is not enabled by default, because it requires
- the Sort::Naturally module.
+ Starting from this version, the `tagged()` pagespec only matches tags,
+ not regular wikilinks. If your wiki accidentially relied on the old,
+ buggy behavior, you might need to change pagespecs to use `link()`.
- -- Simon McVittie <smcv@debian.org> Sat, 03 Apr 2010 13:46:08 +0100
+ To support the above change, all wikis need to be rebuilt on upgrade to
+ this version. If you listed your wiki in /etc/ikiwiki/wikilist this will
+ be done automatically when the Debian package is upgraded. Or use
+ ikiwiki-mass-rebuild to force a rebuild.
+
+ -- Simon McVittie <smcv@debian.org> Tue, 06 Apr 2010 20:53:07 +0100
ikiwiki (3.20091017) unstable; urgency=low