return $page;
}
+sub urlabs ($$) {
+ my $url=shift;
+ my $urlbase=shift;
+
+ return $url unless defined $urlbase && length $urlbase;
+
+ eval q{use URI};
+ URI->new_abs($url, $urlbase)->as_string;
+}
+
sub abs2rel ($$) {
# Work around very innefficient behavior in File::Spec if abs2rel
# is passed two relative paths. It's much faster if paths are
template_depends(shift, undef, @_);
}
-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 => $page,
- destpage => $page,
- template => $template,
- );
- });
- templateactions($template, "");
-
- $template->param(
- dynamic => 1,
- title => $title,
- wikiname => $config{wikiname},
- content => $content,
- baseurl => baseurl(),
- html5 => $config{html5},
- %params,
- );
-
- return $template->output;
-}
-
sub templateactions ($$) {
my $template=shift;
my $page=shift;
$hooks{rcs}{rcs_recentchanges}{call}->(@_);
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
$hooks{rcs}{rcs_diff}{call}->(@_);
}
my $cgi=shift;
printheader($session);
- print misctemplate($form->title, $form->render(submit => $buttons), @_);
+ print cgitemplate($cgi, $form->title,
+ $form->render(submit => $buttons), @_);
+}
+
+sub cgitemplate ($$$;@) {
+ my $cgi=shift;
+ my $title=shift;
+ my $content=shift;
+ my %params=@_;
+
+ my $template=template("page.tmpl");
+
+ my $topurl = defined $cgi ? $cgi->url : $config{url};
+
+ my $page="";
+ if (exists $params{page}) {
+ $page=delete $params{page};
+ $params{forcebaseurl}=urlabs(urlto($page), $topurl);
+ }
+ run_hooks(pagetemplate => sub {
+ shift->(
+ page => $page,
+ destpage => $page,
+ template => $template,
+ );
+ });
+ templateactions($template, "");
+
+ $template->param(
+ dynamic => 1,
+ title => $title,
+ wikiname => $config{wikiname},
+ content => $content,
+ baseurl => urlabs(urlto(""), $topurl),
+ html5 => $config{html5},
+ %params,
+ );
+
+ return $template->output;
}
sub redirect ($$) {
my $q=shift;
eval q{use URI};
- my $url=URI->new(shift);
+ my $url=URI->new(urlabs(shift, $q->url));
if (! $config{w3mmode}) {
print $q->redirect($url);
}
my $message=shift;
print "Content-type: text/html\n\n";
- print misctemplate(gettext("Error"),
+ print cgitemplate(undef, gettext("Error"),
"<p class=\"error\">".gettext("Error").": $message</p>");
die $@;
}
use HTML::Parser;
use HTML::Tagset;
use HTML::Entities;
-use URI;
use open qw{:utf8 :std};
my %feeds;
$template->param(url => $feed->{url});
$template->param(copyright => $params{copyright})
if defined $params{copyright} && length $params{copyright};
- $template->param(permalink => urlabs($params{link}, $feed->{feedurl}))
+ $template->param(permalink => IkiWiki::urlabs($params{link}, $feed->{feedurl}))
if defined $params{link};
if (ref $feed->{tags}) {
$template->param(tags => [map { tag => $_ }, @{$feed->{tags}}]);
return encode_entities(shift, '\[\]');
}
-sub urlabs ($$) {
- my $url=shift;
- my $urlbase=shift;
-
- URI->new_abs($url, $urlbase)->as_string;
-}
-
sub htmlabs ($$) {
# Convert links in html from relative to absolute.
# Note that this is a heuristic, which is not specified by the rss
next unless $v_offset; # 0 v_offset means no value
my $v = substr($text, $v_offset, $v_len);
$v =~ s/^([\'\"])(.*)\1$/$2/;
- my $new_v=urlabs($v, $urlbase);
+ my $new_v=IkiWiki::urlabs($v, $urlbase);
$new_v =~ s/\"/"/g; # since we quote with ""
substr($text, $v_offset, $v_len) = qq("$new_v");
}
# Add the toggle javascript; the attachments interface uses
# it to toggle visibility.
require IkiWiki::Plugin::toggle;
- $form->tmpl_param("javascript" => IkiWiki::Plugin::toggle::include_javascript($params{page}, 1));
+ $form->tmpl_param("javascript" => IkiWiki::Plugin::toggle::include_javascript($params{page}));
# Start with the attachments interface toggled invisible,
# but if it was used, keep it open.
if ($form->submitted ne "Upload Attachment" &&
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $taintedrev=shift;
+ my $maxlines=shift;
my ($rev) = $taintedrev =~ /^(\d+(\.\d+)*)$/; # untaint
my $prevspec = "before:" . $rev;
"--new", $config{srcdir},
"-r", $prevspec . ".." . $revspec);
open (my $out, "@cmdline |");
-
- my @lines = <$out>;
+ my @lines;
+ while (my $line=<$out>) {
+ last if defined $maxlines && @lines == $maxlines;
+ push @lines, $line;
+ }
if (wantarray) {
return @lines;
}
error(gettext("bad page name"));
}
- my $baseurl = urlto($page);
-
$form->title(sprintf(gettext("commenting on %s"),
IkiWiki::pagetitle(IkiWiki::basename($page))));
if ($form->submitted eq CANCEL) {
# bounce back to the page they wanted to comment on, and exit.
- IkiWiki::redirect($cgi, $baseurl);
+ IkiWiki::redirect($cgi, urlto($page));
exit;
}
IkiWiki::saveindex();
IkiWiki::printheader($session);
- print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")),
+ print IkiWiki::cgitemplate($cgi, gettext(gettext("comment stored for moderation")),
"<p>".
gettext("Your comment will be posted after moderator review").
"</p>");
}
else {
- IkiWiki::showform ($form, \@buttons, $session, $cgi,
- forcebaseurl => $baseurl, page => $page);
+ IkiWiki::showform($form, \@buttons, $session, $cgi,
+ page => $page);
}
exit;
IkiWiki::run_hooks(format => sub {
$out = shift->(page => "", content => $out);
});
- print IkiWiki::misctemplate(gettext("comment moderation"), $out);
+ print IkiWiki::cgitemplate($cgi, gettext("comment moderation"), $out);
exit;
}
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=IkiWiki::possibly_foolish_untaint(int(shift));
+ my $maxlines=shift;
local $CWD = $config{srcdir};
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=shift;
+ my $maxlines=shift;
my @lines;
foreach my $line (silentsystem("darcs", "diff", "--match", "hash ".$rev)) {
if (@lines || $line=~/^diff/) {
+ last if defined $maxlines && @lines == $maxlines;
push @lines, $line."\n";
}
}
$form->title(sprintf(gettext("editing %s"), pagetitle(basename($page))));
}
- showform($form, \@buttons, $session, $q,
- forcebaseurl => $baseurl, page => $page);
+ showform($form, \@buttons, $session, $q, page => $page);
}
else {
# save page
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
showform($form, \@buttons, $session, $q,
- forcebaseurl => $baseurl, page => $page);
+ page => $page);
exit;
}
elsif ($form->field("do") eq "create" && $exists) {
"\n\n\n".$form->field("editcontent"),
force => 1);
showform($form, \@buttons, $session, $q,
- forcebaseurl => $baseurl, page => $page);
+ page => $page);
exit;
}
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
showform($form, \@buttons, $session, $q,
- forcebaseurl => $baseurl, page => $page);
+ page => $page);
exit;
}
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
showform($form, \@buttons, $session, $q,
- forcebaseurl => $baseurl, page => $page);
+ page => $page);
}
else {
# The trailing question mark tries to avoid broken
IkiWiki::cgi_custom_failure(
$cgi,
"404 Not Found",
- IkiWiki::misctemplate(gettext("missing page"),
+ IkiWiki::cgitemplate($cgi, gettext("missing page"),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
if (! defined pagetype($pagesources{$page})) {
IkiWiki::cgi_custom_failure(
$cgi->header(-status => "403 Forbidden"),
- IkiWiki::misctemplate(gettext("not a page"),
+ IkiWiki::cgitemplate($cgi, gettext("not a page"),
"<p>".
sprintf(gettext("%s is an attachment, not a page."),
htmllink("", "", $page)).
}
sub safe_git (&@) {
- # Start a child process safely without resorting /bin/sh.
- # Return command output or success state (in scalar context).
+ # Start a child process safely without resorting to /bin/sh.
+ # Returns command output (in list content) or success state
+ # (in scalar context), or runs the specified data handler.
- my ($error_handler, @cmdline) = @_;
+ my ($error_handler, $data_handler, @cmdline) = @_;
my $pid = open my $OUT, "-|";
chomp;
- push @lines, $_;
+ if (! defined $data_handler) {
+ push @lines, $_;
+ }
+ else {
+ last unless $data_handler->($_);
+ }
}
close $OUT;
return wantarray ? @lines : ($? == 0);
}
# Convenient wrappers.
-sub run_or_die ($@) { safe_git(\&error, @_) }
-sub run_or_cry ($@) { safe_git(sub { warn @_ }, @_) }
-sub run_or_non ($@) { safe_git(undef, @_) }
+sub run_or_die ($@) { safe_git(\&error, undef, @_) }
+sub run_or_cry ($@) { safe_git(sub { warn @_ }, undef, @_) }
+sub run_or_non ($@) { safe_git(undef, undef, @_) }
sub merge_past ($$$) {
return @rets;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=shift;
+ my $maxlines=shift;
my ($sha1) = $rev =~ /^($sha1_pattern)$/; # untaint
my @lines;
- foreach my $line (run_or_non("git", "show", $sha1)) {
- if (@lines || $line=~/^diff --git/) {
- push @lines, $line."\n";
- }
- }
+ my $addlines=sub {
+ my $line=shift;
+ return if defined $maxlines && @lines == $maxlines;
+ push @lines, $line."\n"
+ if (@lines || $line=~/^diff --git/);
+ return 1;
+ };
+ safe_git(undef, $addlines, "git", "show", $sha1);
if (wantarray) {
return @lines;
}
# in order to see all changes.
my ($subdir, $rootdir) = git_find_root();
$git_dir=$rootdir;
- my @commits=git_commit_info($sha1, 1);
- $git_dir=undef;
+ my @commits=git_commit_info($sha1, 1);
if (! @commits) {
error "unknown commit"; # just in case
}
error gettext("you are not allowed to revert a merge");
}
- return git_parse_changes(@commits);
+ my @ret=git_parse_changes(@commits);
+
+ $git_dir=undef;
+ return @ret;
}
sub rcs_revert ($) {
IkiWiki::cgi_custom_failure(
$q,
"404 Not Found",
- IkiWiki::misctemplate(gettext("missing page"),
+ IkiWiki::cgitemplate($q, gettext("missing page"),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
#!/usr/bin/perl
package IkiWiki::Plugin::highlight;
+# This has been tested with highlight 2.16 and highlight 3.2+svn19.
+# In particular version 3.2 won't work. It detects the different
+# versions by the presence of the the highlight::DataDir class.
+
use warnings;
use strict;
use IkiWiki 3.00;
use Encode;
+my $data_dir;
+
sub import {
hook(type => "getsetup", id => "highlight", call => \&getsetup);
hook(type => "checkconfig", id => "highlight", call => \&checkconfig);
}
sub checkconfig () {
+
+ eval q{use highlight};
+ if ($@) {
+ print STDERR "Failed to load highlight. Configuring anyway.\n";
+ };
+
+ if (highlight::DataDir->can('new')){
+ $data_dir=new highlight::DataDir();
+ $data_dir->searchDataDir("");
+ } else {
+ $data_dir=undef;
+ }
+
if (! exists $config{filetypes_conf}) {
- $config{filetypes_conf}="/etc/highlight/filetypes.conf";
+ $config{filetypes_conf}=
+ ($data_dir ? $data_dir->getConfDir() : "/etc/highlight/")
+ . "filetypes.conf";
}
if (! exists $config{langdefdir}) {
- $config{langdefdir}="/usr/share/highlight/langDefs";
+ $config{langdefdir}=
+ ($data_dir ? $data_dir->getLangPath("")
+ : "/usr/share/highlight/langDefs");
+
}
- if (exists $config{tohighlight}) {
+ if (exists $config{tohighlight} && read_filetypes()) {
foreach my $file (split ' ', $config{tohighlight}) {
my @opts = $file=~s/^\.// ?
(keepextension => 1) :
# Parse highlight's config file to get extension => language mappings.
sub read_filetypes () {
- open (my $f, $config{filetypes_conf}) || error("$config{filetypes_conf}: $!");
+ my $f;
+ if (!open($f, $config{filetypes_conf})) {
+ warn($config{filetypes_conf}.": ".$!);
+ return 0;
+ };
+
local $/=undef;
my $config=<$f>;
close $f;
}
}
- $filetypes_read=1;
+ return $filetypes_read=1;
}
my $gen;
if (! exists $highlighters{$langfile}) {
- $gen = highlightc::CodeGenerator_getInstance($highlightc::XHTML);
+ $gen = highlight::CodeGenerator::getInstance($highlight::XHTML);
$gen->setFragmentCode(1); # generate html fragment
$gen->setHTMLEnclosePreTag(1); # include stylish <pre>
- $gen->initTheme("/dev/null"); # theme is not needed because CSS is not emitted
- $gen->initLanguage($langfile); # must come after initTheme
+ if ($data_dir){
+ # new style, requires a real theme, but has no effect
+ $gen->initTheme($data_dir->getThemePath("seashell.theme"));
+ } else {
+ # old style, anything works.
+ $gen->initTheme("/dev/null");
+ }
+ $gen->loadLanguage($langfile); # must come after initTheme
$gen->setEncoding("utf-8");
$highlighters{$langfile}=$gen;
}
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
# TODO
}
if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
}
+ foreach my $field (qw{permalink}) {
+ $template->param($field => IkiWiki::urlabs($pagestate{$page}{meta}{$field}, $config{url}))
+ if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
+ }
+
foreach my $field (qw{description}) {
$template->param($field => HTML::Entities::encode_numeric($pagestate{$page}{meta}{$field}))
if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
my $version=undef;
while (<MTN>) {
- if (/^monotone (\d+\.\d+) /) {
+ if (/^monotone (\d+\.\d+)(?:(?:\.\d+){0,2}|dev)? /) {
$version=$1;
}
}
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=shift;
+ my $maxlines=shift;
my ($sha1) = $rev =~ /^($sha1_pattern)$/; # untaint
chdir $config{srcdir}
exec("mtn", "diff", "--root=$config{mtnrootdir}", "-r", "p:".$sha1, "-r", $sha1) || error("mtn diff $sha1 failed to run");
}
- my (@lines) = <MTNDIFF>;
+ my @lines;
+ while (my $line=<MTNDIFF>) {
+ last if defined $maxlines && @lines == $maxlines;
+ push @lines, $line;
+ }
close MTNDIFF || debug("mtn diff $sha1 exited $?");
sub rcs_recentchanges ($) {
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
}
sub rcs_getctime ($) {
);
IkiWiki::printheader($session);
- print IkiWiki::misctemplate("signin", $template->output);
+ print IkiWiki::cgitemplate($q, "signin", $template->output);
exit;
}
}
elsif ($form->submitted ne 'Cancel') {
$form->title(sprintf(gettext("confirm reversion of %s"), $rev));
- $form->tmpl_param(diff => encode_entities(scalar IkiWiki::rcs_diff($rev)));
+ $form->tmpl_param(diff => encode_entities(scalar IkiWiki::rcs_diff($rev, 200)));
$form->field(name => "rev", type => "hidden", value => $rev, force => 1);
IkiWiki::showform($form, $buttons, $session, $q);
exit 0;
else {
$_->{link} = pagetitle($_->{page});
}
- $_->{baseurl}=IkiWiki::baseurl(undef) if length $config{url};
$_;
} @{$change->{pages}}
wikiname => $config{wikiname},
);
- $template->param(permalink => urlto($config{recentchangespage}, undef)."#change-".titlepage($change->{rev}))
+ $template->param(permalink => urlto($config{recentchangespage})."#change-".titlepage($change->{rev}))
if exists $config{url};
IkiWiki::run_hooks(pagetemplate => sub {
my $template=$params{template};
if ($config{rcs} && exists $params{rev} && length $params{rev} &&
$template->query(name => "diff")) {
- my @lines=IkiWiki::rcs_diff($params{rev});
+ my @lines=IkiWiki::rcs_diff($params{rev}, $maxlines+1);
if (@lines) {
my $diff;
if (@lines > $maxlines) {
- # only include so many lines of diff
$diff=join("", @lines[0..($maxlines-1)])."\n".
gettext("(Diff truncated)");
}
"database_dir .\n".
"template_dir ./templates\n");
- # Avoid omega interpreting anything in the misctemplate
+ # Avoid omega interpreting anything in the cgitemplate
# as an omegascript command.
- my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0",
+ eval q{use IkiWiki::CGI};
+ my $template=IkiWiki::cgitemplate(undef, gettext("search"), "\0",
searchform => "", # avoid showing the small search form
);
eval q{use HTML::Entities};
error $@ if $@;
- $misctemplate=encode_entities($misctemplate, '\$');
+ $template=encode_entities($template, '\$');
my $querytemplate=readfile(IkiWiki::template_file("searchquery.tmpl"));
- $misctemplate=~s/\0/$querytemplate/;
+ $template=~s/\0/$querytemplate/;
writefile("query", $config{wikistatedir}."/xapian/templates",
- $misctemplate);
+ $template);
$setup=1;
}
}
return @ret;
}
-sub rcs_diff ($) {
+sub rcs_diff ($;$) {
my $rev=IkiWiki::possibly_foolish_untaint(int(shift));
+ my $maxlines=shift;
return `svnlook diff $config{svnrepo} -r$rev --no-diff-deleted`;
}
return $tag;
}
+# Returns a tag name from a tag link
+sub tagname ($) {
+ my $tag=shift;
+ if (defined $config{tagbase}) {
+ $tag =~ s!^/\Q$config{tagbase}\E/!!;
+ } else {
+ $tag =~ s!^\.?/!!;
+ }
+ return pagetitle($tag, 1);
+}
+
sub htmllink_tag ($$$;@) {
my $page=shift;
my $destpage=shift;
debug($message);
my $template=template("autotag.tmpl");
- $template->param(tagname => IkiWiki::basename($tag));
+ $template->param(tagname => tagname($tag));
$template->param(tag => $tag);
writefile($tagfile, $config{srcdir}, $template->output);
if ($config{rcs}) {
$template->param(tags => [
map {
- link => htmllink_tag($page, $destpage, $_, rel => "tag")
+ link => htmllink_tag($page, $destpage, $_,
+ rel => "tag", linktext => tagname($_))
}, 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 (defined $tags && %$tags) {
- $template->param(categories => [map { category => $_ },
+ $template->param(categories => [map { category => tagname($_) },
sort keys %$tags]);
}
}
--- /dev/null
+#!/usr/bin/perl
+package IkiWiki::Plugin::transient;
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+ hook(type => "getsetup", id => "transient", call => \&getsetup);
+ hook(type => "checkconfig", id => "transient", call => \&checkconfig);
+ hook(type => "change", id => "transient", call => \&change);
+}
+
+sub getsetup () {
+ return
+ plugin => {
+ # this plugin is safe but only makes sense as a
+ # dependency; similarly, it needs a rebuild but
+ # only if something else does
+ safe => 0,
+ rebuild => 0,
+ },
+}
+
+our $transientdir;
+
+sub checkconfig () {
+ eval q{use Cwd 'abs_path'};
+ error($@) if $@;
+ $transientdir = abs_path($config{wikistatedir})."/transient";
+ add_underlay($transientdir);
+}
+
+sub change (@) {
+ foreach my $file (@_) {
+ # If the corresponding file exists in the transient underlay
+ # and isn't actually being used, we can get rid of it.
+ # Assume that the file that just changed has the same extension
+ # as the obsolete transient version: this'll be true for web
+ # edits, and avoids invoking File::Find.
+ my $casualty = "$transientdir/$file";
+ if (srcfile($file) ne $casualty && -e $casualty) {
+ debug(sprintf(gettext("removing transient version of %s"), $file));
+ IkiWiki::prune($casualty);
+ }
+ }
+}
+
+1;
IkiWiki::saveindex();
IkiWiki::unlockwiki();
- # Print the top part of a standard misctemplate,
+ # Print the top part of a standard cgitemplate,
# then show the rebuild or refresh, live.
my $divider="\0";
- my $html=IkiWiki::misctemplate("setup", $divider);
+ my $html=IkiWiki::cgitemplate($cgi, "setup", $divider);
IkiWiki::printheader($session);
my ($head, $tail)=split($divider, $html, 2);
print $head."<pre>\n";
push @envsave, qw{REMOTE_ADDR QUERY_STRING REQUEST_METHOD REQUEST_URI
CONTENT_TYPE CONTENT_LENGTH GATEWAY_INTERFACE
HTTP_COOKIE REMOTE_USER HTTPS REDIRECT_STATUS
+ HTTP_HOST SERVER_PORT HTTPS
REDIRECT_URL} if $config{cgi};
my $envsave="";
foreach my $var (@envsave) {
-ikiwiki (3.20101202) UNRELEASED; urgency=low
+ikiwiki (3.20110105) unstable; urgency=low
+
+ * tag: Do not include tagbase in rss/atom category tags. (Giuseppe Bilotta)
+ * tag: Improve display of tags with a slash in their names.
+ (Giuseppe Bilotta)
+ * Fix redirect to use a full url. Was broken (in theory) by baseurl
+ changes in last release.
+ * Fix `<base>` output by cgi to have a full url again, broken by last
+ release.
+ * Fix permalinks to recentchanges items and comments, broken by last
+ release.
+ * Export three cgi env vars needed for CGI->url to work. Fixed
+ openid breakage from last release.
+ * Removed `IkiWiki::misctemplate()` function. Any plugins using
+ it should use `IkiWiki::cgitemplate()` instead.
+
+ -- Joey Hess <joeyh@debian.org> Wed, 05 Jan 2011 17:33:05 -0400
+
+ikiwiki (3.20101231) unstable; urgency=low
* Better support for serving the same site on multiple urls. (Such as
a http and a https url, or a ipv4 and an ipv6 url.)
comment.
* teximg: Use `\[` and `\]` instead of not recommended `$$`. (Paul Menzel)
Closes: #596084
-
- -- Joey Hess <joeyh@debian.org> Mon, 29 Nov 2010 14:44:13 -0400
+ * monotone: Improve version parsing to support patch and development
+ versions of the monotone binary. (tommyd3mdi)
+ * highlight: Support highlight 3.2+svn19 (note that released version 3.2
+ is not supported). Closes: #605779 (David Bremner)
+ * Add a second parameter to the rcs_diff hook, and avoid bloating memory
+ reading in enormous commits.
+ * git: Fix bug involving attempting to web revert a commit that included
+ changes to attachments.
+
+ -- Joey Hess <joeyh@debian.org> Fri, 31 Dec 2010 21:23:37 -0400
ikiwiki (3.20101201) unstable; urgency=low
--- /dev/null
+default_pageext in the setup file does not work for me.
+
+I tried to set it as 'txt' and as a custom plugin I am developing but when I edit a page it only ever loads with Markdown selected.
+
+Yes I am only trying to set it to loaded and working plugins.
+
+ikiwiki version 3.20101129
--- /dev/null
+The edit page CGI defines a `base` tag with an URL which is not
+absolute, which can break the preview function in some circumstances
+(with e.g. images not showing). The trivial [[patch]] that fixes
+it can be found [[here|http://sprunge.us/EPHT]] as well as on [[my
+git|http://git.oblomov.eu/ikiwiki]].
+
+> That patch does mean that if you're accessing the CGI via HTTPS but your
+> $config{url} and $config{cgiurl} are HTTP, you'll get preview images loaded
+> via HTTP, causing the browser to complain. See
+> [[todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both]]
+> for background.
+>
+> Perhaps the CGI could form its `<base>` URL by using
+> `URI->new_abs(urlto(...), $cgi->url)` instead?
+>
+> You'd also need to change `IkiWiki/Wrapper.pm` to pass at least the
+> SERVER_NAME and SERVER_PORT through the environment, probably.
+>
+> Joey's last comment on
+> [[todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both]]
+> suggests that this might already work, but I'm not quite sure how - I'd
+> expect it to need more environment variables? --[[smcv]]
+>
+>> `CGI::url` uses `REQUEST_URI`. So it could be used, but I don't see
+>> how to get from the `CGI::url` to an url to the page that is being
+>> edited. --[[Joey]]
+>>> (The right rune seems to be: `URI->new_abs(urlto($params{page}), $cgi->url))` --[[Joey]]
+
+---
+
+Update: This bug is worse than it first appeared, and does not only affect
+previewing. The cgi always has a `<base>` url, and it's always relative,
+and that can break various links etc. For example, when the 404 plugin
+displays a missing page, it has a Recentchanges link, which would be broken
+if the cgi was in an unusual place.
+
+`misctemplate` needs to *always* set an absolute baseurl. Which is a problem,
+since `misctemplate` is not currently passed a cgi object from which to
+construct one. --[[Joey]]
+
+Update: Worse and worse. `baseurl(undef)` can be a relative url, but
+nearly every use of it I can find actually needs to be absolute.
+the numerous `redirect($q, baseurl(undef))` all need to be absolute
+according to `CGI` documentation.
+
+So, I'm seriously thinking about reverting the part of
+[[todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both]]
+that made `baseurl(undef)` relative.
+And I suppose, re-opening that todo. :( --[[Joey]]
--- /dev/null
+The use of typed links for tags and some of the consequent changes
+introduced some unwanted functionality variations in the tag system. Two
+problems in particular could be observed, when compared to the use of
+tags in older versions of IkiWiki:
+
+* tags in feeds (both rss and atom) would use the file path as their
+ name (e.g. you would have `<category term="tags/sometag" />` in an atom
+ item for a page tagged sometag with a tagbase of tags), whereas they
+ appeared pure before
+* tags containing a slash character would appear without the slash
+ character but be used with the slash character in other circumstances
+ (effect visible by tagging a page with a name such as "with/slash")
+
+I've written a [[patch]] to fix this issues by introducing a `tagname()` function that reverts `taglink()`, and it's available [[here|http://sprunge.us/SHRj]] as well as on my [[git|http://git.oblomov.eu/ikiwiki]]
+
+> [[Applied|done]], with some regexp improvements. --[[Joey]]
--- /dev/null
+jackie chan vs chuck norris.
--- /dev/null
+[Flowplayer](http://flowplayer.org) is the open source flash video player plugin. [My site](http://mcfrisk.kapsi.fi) has raw html enabled to work with old content so I was able to use the raw html and javascript [examples](http://flowplayer.org/documentation/installation/index.html) in blog posts, but some of them fail when combined on the [aggregate page](http://mcfrisk.kapsi.fi/skiing/). Any hints on how to properly use Flowplayer with ikiwiki?
--- /dev/null
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawkIfDOOUJ0h_niLRZZL5HsHHOuQfUrVcQo"
+ nickname="Carl"
+ subject="Works with mathjax, with a little help"
+ date="2011-01-02T22:59:27Z"
+ content="""
+Yes, mathjax works with ikiwiki. The main trouble I ran into was markdown trying to parse the math. For example markdown and tex both use underscores. I wrote a quick plugin to replace all the TeX with strip markers in the 'filter' phase and put it back in the 'sanitize' phase (just replacing all the TeX content with its Base64 representation temporarily) and that seems to have fixed the problem well enough.
+"""]]
+++ /dev/null
-ikiwiki 3.20100926 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * meta: Ensure that the url specified by xrds-location is absolute.
- * attachment: Fix attachment file size display.
- * Propigate PATH into wrapper.
- * htmlbalance: Fix compatibility with HTML::Tree 4.0. (smcv)"""]]
\ No newline at end of file
+++ /dev/null
-ikiwiki 3.20101019 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * Fix test suite failure on other side of date line.
- * htmltidy: Allow configuring tidy parameters in setup file.
- (W. Trevor King)
- * Updated French program translation. Closes: #[598918](http://bugs.debian.org/598918)
- * git: Added new rcs\_revert and rcs\_preprevert hooks.
- * recentchanges: Add revert buttons to RecentChanges page, and
- implement web-based reversion interface.
- * Thanks to Peter Gammie for his assistance with the web-based reversion
- feature.
- * actiontabs: More consistent styling of Hn tags.
- * websetup: Fix saving of advanced mode changes.
- * websetup: Fix defaults of checkboxes in advanced mode.
- * monotone: Fix recentchanges page when the srcdir is not at the top
- of the monotone workspace. Thanks, tommyd.
- * img: If a class is specified, don't also put the img in the img
- class.
- * auto-blog.setup: Don't enable opendiscussion by default; require users be
- logged in to post comments."""]]
\ No newline at end of file
+++ /dev/null
-ikiwiki 3.20101023 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * Fix typo that broke anonymous git push.
- * Fix web reversion when the srcdir is in a subdir of the git repo."""]]
\ No newline at end of file
--- /dev/null
+ikiwiki 3.20101231 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * Better support for serving the same site on multiple urls. (Such as
+ a http and a https url, or a ipv4 and an ipv6 url.)
+ (Thanks, smcv)
+ * API: urlto without a defined second parameter now generates an url
+ that starts with "/" (when possible; eg when the site's url and cgiurl
+ are on the same domain).
+ * Now when users log in via https, ikiwiki sends a secure cookie, that can
+ only be used over https. If the user switches to using http, they will
+ need to re-login. (smcv)
+ * inline: Display feed buttons for nested inlines, linking to the inlined
+ page's feed. (Giuseppe Bilotta)
+ * goldtype: New theme, based on blueview, contributed by Lars Wirzenius.
+ * po: do not override homepage title when it was overridden. (intrigeri)
+ * Set HTML::Template's parent\_global\_vars option to allow using parameters
+ like title\_overridden that do not appear on the template. (intrigeri)
+ (See https://rt.cpan.org/Public/Bug/Display.html?id=64158)
+ * inline: Force an absolute page location when the inline postform is used.
+ * editpage, comment: Clean up title when editing or creating a page or
+ comment.
+ * teximg: Use `\[` and `\]` instead of not recommended `$$`. (Paul Menzel)
+ Closes: #[596084](http://bugs.debian.org/596084)
+ * monotone: Improve version parsing to support patch and development
+ versions of the monotone binary. (tommyd3mdi)
+ * highlight: Support highlight 3.2+svn19 (note that released version 3.2
+ is not supported). Closes: #[605779](http://bugs.debian.org/605779) (David Bremner)
+ * Add a second parameter to the rcs\_diff hook, and avoid bloating memory
+ reading in enormous commits.
+ * git: Fix bug involving attempting to web revert a commit that included
+ changes to attachments."""]]
\ No newline at end of file
--- /dev/null
+ikiwiki 3.20110105 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * tag: Do not include tagbase in rss/atom category tags. (Giuseppe Bilotta)
+ * tag: Improve display of tags with a slash in their names.
+ (Giuseppe Bilotta)
+ * Fix redirect to use a full url. Was broken (in theory) by baseurl
+ changes in last release.
+ * Fix `<base>` output by cgi to have a full url again, broken by last
+ release.
+ * Fix permalinks to recentchanges items and comments, broken by last
+ release.
+ * Export three cgi env vars needed for CGI->url to work. Fixed
+ openid breakage from last release.
+ * Removed `IkiWiki::misctemplate()` function. Any plugins using
+ it should use `IkiWiki::cgitemplate()` instead."""]]
\ No newline at end of file
behavior. (Right?) -- [[StevenBlack]]
> Great idea! Just implemented that and also relative years. --[[Joey]]
+
+Anyone know of a way to generate a link to the previous and next calendar pages for archive browsing? In the worst case, that requires regenerating pages on either side of the current one when something is inserted in the history, and I can't quite figure that much out. --[[JasonRiedy]]
+
+> Well, the calendar directive puts such links on the calendars. They're
+> the arrows to either side of the month or year at the top. --[[Joey]]
+
+>> Thanks. I either missed them or they appeared on an upgrade. I might make them a bit more obvious with
+>> "Previous Month" / "Next Month" links above and below the text. Someday.--[[JasonRiedy]]
+*For discussion and the branch please see [[todo/transient pages]]. If this
+plugin is merged, this page can be renamed to act as its documentation. --[[smcv]]*
+
[[!template id=plugin name=transient author="[[Simon_McVittie|smcv]]"]]
-[[!template id=gitbranch branch=smcv/ready/transient author="[[Simon_McVittie|smcv]]"]]
[[!tag type/special-purpose]]
-The `transient` plugin is an implementation of [[todo/transient pages]]
-in an underlay. It's mostly useful as something other plugins can depend on;
-[[plugins/contrib/album]] puts photo-album "viewer" pages there,
-and the versions of [[plugins/autoindex]] and [[plugins/tag]] on the
-same branch optionally put their auto-generated pages there.
+The `transient` plugin adds an underlay in `.ikiwiki/transient`, which is
+intended for pages that are automatically created and should not be committed
+to the [[RCS]]. It works in the same way as the [[basewiki]] and the underlays
+set up by the [[plugins/underlay]] plugin, so if a page in the transient
+underlay is edited via the web, the edited version is committed to the RCS
+as usual. Unlike other underlays, if a page in the transient underlay is
+superseded by an edited version in the RCS, the old transient version
+is deleted automatically.
+
+This plugin is mostly useful as something that other plugins can depend on:
+
+* [[plugins/contrib/album]] always writes photo-album "viewer" pages to the
+ transient underlay
+
+Likely future users of this plugin (the appropriate branches need to be
+merged first):
+
+* with a patch (which exists but hasn't yet been tested), [[plugins/aggregate]]
+ always writes aggregated posts into the transient underlay
+* with a patch, [[plugins/autoindex]] can be configured to auto-create missing
+ pages that have a [[ikiwiki/subpage]] or an [[plugins/attachment]], but not
+ commit them, in which case they go in the transient underlay
+* [[plugins/comments]] can be configured to not commit comments: if so, it
+ should probably put them in the transient underlay
+* with a patch, [[plugins/recentchanges]] always writes new changes into the
+ transient underlay
+* with a patch, [[plugins/tag]] can be configured to auto-create missing
+ tag pages but not commit them, in which case they go in the transient
+ underlay
],
}
-#### `rcs_diff($)`
+#### `rcs_diff($;$)`
+
+The first parameter is the rev from `rcs_recentchanges`.
+The optional second parameter is how many lines to return (default: all).
-The parameter is the rev from `rcs_recentchanges`.
Should return a list of lines of the diff (including \n) in list
-context, and the whole diff in scalar context.
+context, and a string containing the whole diff in scalar context.
#### `rcs_getctime($)`
I wonder how org-mode would look once formatted with ikiwiki..
+----
+
+# header1
+
+## header2
+
+### header3
+
+#### header4
+
+##### header 5
+
+**bold**
+
+ * bullet
+
+ 1 list
+
+ 2 list
+
+ 3 list
+
+[[link]]
+
+_italic_
+
+
+
----
This **SandBox** is also a [[blog]]!
ikiwiki is installed under a debian lenny system. but without write acces to /etc/ikiwiki (obvious) i am coming not far.
Or do i miss something which is probably hidden deeper in the documentation ?
+----
+Perhaps it's worth noting that when installing ikiwiki with apt on Debian stable, you need to use the backports version in order to follow the setup instructions.
by writing to the RCS as the page's contents can change depending on which
other pages claim it as an alias. --[[chrysn]]
-I agree with [[chrysn]]. In fact, is there any good reason that the core tag plugin doesn't do this? The current usability is horrible, to the point that I have gone 2.5 years with Ikiwiki and haven't yet started using tags. --
+I agree with [[chrysn]]. In fact, is there any good reason that the core tag
+plugin doesn't do this? The current usability is horrible, to the point that
+I have gone 2.5 years with Ikiwiki and haven't yet started using tags.
+--[Eric](http://wiki.pdxhub.org/people/eric)
> See [[todo/transient_pages]] for progress on this. --[[smcv]]
`add_autofile` is a generic version of [[plugins/autoindex]]'s code,
so the latter should probably use the former. --[[smcv]]
-> See [[todo/transient_pages]] for progress on this. --[[smcv]]
+----
+
+[[!template id=gitbranch branch=smcv/autoindex-autofile author="[[smcv]]"]]
+
+I'm having trouble fixing this:
+
+ # FIXME: some of this is probably redundant with add_autofile now, and
+ # the rest should perhaps be added to the autofile machinery
+
+By "a generic version of" above, it seems I mean "almost, but not
+quite, entirely unlike".
+
+> As long as it's not Tea. ;) --[[Joey]]
+
+I tried digging through the git history for the
+reasoning behind the autofile and autoindex implementations, but now I'm
+mostly confused.
+
+## autofile
+
+The autofile machinery records a list of every file that has ever been proposed
+as an autofile: for instance, the tag plugin has a list of every tag that
+has ever been named in a \[[!tag]] or \[[!taglink]], even if no file was
+actually needed (e.g. because it already existed). Checks for files that
+already exist (or whatever) are deferred until after this list has been
+updated, and files in this list are never auto-created again unless the wiki
+is rebuilt.
+
+This avoids re-creating the tag `create-del` in this situation, which is
+the third one that I noted on
+[[todo/auto-create tag pages according to a template]]:
+
+* create tags/create-del manually
+* tag a page as create-del
+* delete tags/create-del
+
+and also avoids re-creating `auto-del` in this similar situation (which I
+think is probably the most important one to get right):
+
+* tag a page as auto-del, which is created automatically
+* delete tags/auto-del
+
+I think both of these are desirable.
+
+However, this infrastructure also results in the tag page not being
+re-created in either of these situations (the first and second that I noted
+on the other page):
+
+* tag a page as auto-del-create-del, which is created automatically
+* delete tags/auto-del-create-del
+* create tags/auto-del-create-del manually
+* delete tags/auto-del-create-del again
+
+or
+
+* create tags/create-del-auto
+* delete tags/create-del-auto
+* tag a page as create-del-auto
+
+I'm less sure that these shouldn't create the tag page: we deleted the
+manually-created version, but that doesn't necessarily mean we don't want
+*something* to exist.
+
+> That could be argued, but it's a very DWIM thing. Probably best to keep
+> the behavior simple and predictable, so one only needs to remember that
+> when a page is deleted, nothing will ever re-create it behind ones back.
+> --[[Joey]]
+
+## autoindex
+
+The autoindex machinery records a more complex set. Items are added to the
+set when they are deleted, but would otherwise have been added as an autoindex
+(don't exist, do have children (by which I mean subpages or attachments),
+and are a directory in the srcdir). They're removed if this particular run
+wouldn't have added them as an autoindex (they exist, or don't have children).
+
+Here's what happens in situations mirroring those above.
+
+The "create-del" case still doesn't create the page:
+
+* create create-del manually
+* create create-del/child
+* delete create-del
+* it's added to `%deleted` and not re-created
+
+Neither does the "auto-del" case:
+
+* create auto-del/child, resulting in auto-del being created automatically
+* delete auto-del
+* it's added to `%deleted` and not re-created
+
+However, unlike the generic autofile infrastructure, `autoindex` forgets
+that it shouldn't re-create the deleted page in the latter two situations:
+
+* create auto-del-create-del/child, resulting in auto-del-create-del being
+ created automatically
+* delete auto-del-create-del; it's added to `%deleted` and not re-created
+* create auto-del-create-del manually; it's removed from `%deleted`
+* delete auto-del-create-del again (it's re-created)
+
+and
+
+* create create-del-auto
+* delete create-del-auto; it's not added to `%deleted` because there's no
+ child that would cause it to exist
+* create create-del-auto/child
+
+> I doubt there is any good reason for this behavior. These are probably
+> bugs. --[[Joey]]
--- /dev/null
+[[!template id=gitbranch branch=GiuseppeBilotta/inlinestuff author="Giuseppe Bilotta"]]
+
+A few patches to clean up and improve feed management for inline pages.
+
+* the first patch simply replaces the id attribute in the default template for feedlinks with a class attribute by the same name. This is necessary in pages with multiple inlines to guarantee correctness
+* the second patch tries to define the default description for a feed based not only on the wiki name, but also on the current page name. The actual way this is built might not be the optimal one, so I'm open to suggestions
+* the third patch passes the feed titles to the templates, changing the default templates to use these as title attributes for the links. a rel="alternate" attribute is also included
+* the fourth patch introduces a feedlinks parameter to the inline directive, to allow for the specifications of the locations where the feed links should appear. Currently, two options are allowed (head and body), plus both and none with obvious significance
+++ /dev/null
-The attachment plugin's Insert Links button currently only knows
-how to insert plain wikilinks and img directives (for images).
-
-[[wishlist]]: Generalize this, so a plugin can cause arbitrary text
-to be inserted for a particular file. --[[Joey]]
-
-Design:
-
-Add an insertlinks hook. Each plugin using the hook would be called,
-and passed the filename of the attachment. If it knows how to handle
-the file type, it returns a the text that should be inserted on the page.
-If not, it returns undef, and the next plugin is tried.
-
-This would mean writing plugins in order to handle links for
-special kinds of attachments. To avoid that for simple stuff,
-a fallback plugin could run last and look for a template
-named like `templates/embed_$extension`, and insert a directive like:
-
- \[[!template id=embed_vp8 file=my_movie.vp8]]
-
-Then to handle a new file type, a user could just make a template
-that expands to some relevant html. In the example above,
-`templates/embed_vp8` could make a html5 video tag, possibly with some
-flash fallback code even.
--- /dev/null
+The attachment plugin's Insert Links button currently only knows
+how to insert plain wikilinks and img directives (for images).
+
+[[wishlist]]: Generalize this, so a plugin can cause arbitrary text
+to be inserted for a particular file. --[[Joey]]
+
+Design:
+
+Add an insertlinks hook. Each plugin using the hook would be called,
+and passed the filename of the attachment. If it knows how to handle
+the file type, it returns a the text that should be inserted on the page.
+If not, it returns undef, and the next plugin is tried.
+
+This would mean writing plugins in order to handle links for
+special kinds of attachments. To avoid that for simple stuff,
+a fallback plugin could run last and look for a template
+named like `templates/embed_$extension`, and insert a directive like:
+
+ \[[!template id=embed_vp8 file=my_movie.vp8]]
+
+Then to handle a new file type, a user could just make a template
+that expands to some relevant html. In the example above,
+`templates/embed_vp8` could make a html5 video tag, possibly with some
+flash fallback code even.
--- /dev/null
+I have a client server setup so I can I edit/preview on my laptop/desktop and push to a server. I therefore have two almost identical setup files that reasonably often I let get out of sync. I'd like to be able into include the common parts into the two setup files. Currently the following works, but it relies on knowing the implementation of IkiWiki::Setup::Standard
+
+use IkiWiki::Setup::Standard { specific stuff };
+require "/path/to/common_setup";
+
+where common_setup contains a call to IkiWiki::Setup::merge
+
+To see that this is fragile, note that the require must come second, or ikiwiki will try to load a module called IkiWiki::Setup::merge
+
+DavidBremner
--------------------------
[[!template id=gitbranch branch=smcv/ready/transient author="[[smcv]]"]]
+[[!template id=gitbranch branch=smcv/ready/transient-recentchanges author="[[smcv]]"]]
+[[!template id=gitbranch branch=smcv/ready/transient-tag author="[[smcv]]"]]
[[!tag patch]]
I think this branch is now enough to be useful. It adds the following:
I erred on the side of more plugins; I think it's "on the edge of the core",
like goto.
-Pages with the default extension in the transient underlay are automatically
+Pages in the transient underlay are automatically
deleted if a page of the same name is created in the srcdir (or an underlay
closer to the srcdir in stacking order).
+With the additional `ready/transient-tag` branch,
`tag` enables `transient`, and if `tag_autocreate_commit` is set to 0
(default 1), autocreated tags are written to the transient underlay.
There is a regression test.
+With the additional `transient-autoindex` branch,
`autoindex` uses autofiles. It also enables `transient`, and if
`autoindex_commit` is set to 0 (default 1), autoindexes are written to
-the transient underlay. There is a regression test.
+the transient underlay. There is a regression test. However, this branch
+is blocked by working out what the desired behaviour is, on
+[[todo/autoindex_should_use_add__95__autofile]].
> I wonder why this needs to be configurable? I suppose that gets back to
> whether it makes sense to check these files in or not. The benefits of
> commit clutter is really worth it.
>> According to the last section of
->> [[todo/auto-create_tag_pages_according_to_a_template]], chrysn and
+>> [[todo/auto-create_tag_pages_according_to_a_template]], [[chrysn]] and
>> Eric both feel rather strongly that it should be possible to
->> not commit any tags. I made it configurable because, as you point out,
+>> not commit any tags; in [[plugins/autoindex/discussion]],
+>> lollipopman and [[JoeRayhawk]] both requested the same for autoindex.
+>> I made it configurable because, as you point out,
>> there are also reasons why it makes sense to check these
>> automatically-created files in. I'm neutral on this, personally.
>>
>> If this is a point of contention, would you accept a branch that
>> just adds `transient` and uses it for [[plugins/recentchanges]],
->> which aren't checked in and never have been?
+>> which aren't checked in and never have been? I've split the
+>> branch up in the hope that *some* of it can get merged.
+>>
+>>> I will be happy to merge transient-recentchanges when it's ready.
+>>> I see no obstacle to merging transient-tag either, and am not
+>>> really against using it for autoindex or aggregate either
+>>> once they get completed.
+>>> I just wanted to think through why configurability is needed.
+>>> --[[Joey]]
>>
>> One potentially relevant point is that configuration clutter only
>> affects the site admin whereas commit clutter is part of the whole
> Anyway, the configurability
> appears subtly broken; the default is only 1 if a new setup file is
-> generated. With an existing setup file, the 'default' values in
+> generated. (Correction: It was not even the default then --[[Joey]])
+> With an existing setup file, the 'default' values in
> `getsetup` don't take effect, so it will default to undef, which
> is treated the same as 0. --[[Joey]]
->> Fixed in the branch, hopefully. (How disruptive would it be to have
+>> Fixed in the branches, hopefully. (How disruptive would it be to have
>> defaults take effect whenever the setup file doesn't set a value, btw?
>> It seems pretty astonishing to have them work as they do at the moment.) --s
+>>> Well, note that default is not actually a documented field in
+>>> getsetup hooks at all! (It is used in IkiWiki.pm's own `getsetup()`, and
+>>> the concept may have leaked out into one or two plugins (comments,
+>>> transient)).
+>>>
+>>> Running getsetup at plugin load time is something I have considered
+>>> doing. It would simplify some checkconfig hooks that just set hardcoded
+>>> defaults. Although since dying is part of the getsetup hook's API, it
+>>> could be problimaric.
+>>> --[[Joey]]
+
autoindex ignores pages in the transient underlay when deciding whether
to generate an index.
-New recent changes go in the transient underlay; I tested this manually.
+With the additional `ready/transient-recentchanges` branch, new recent
+changes go in the transient underlay; I tested this manually.
Not done yet (in that branch, at least):
>> Here are some other things I'd like to think about first: --[[Joey]]
>>
>> * There's a FIXME in autoindex.
-
->>> Right, the extra logic for preventing autoindex pages from being
->>> re-created. I've started on regression tests for this, but I'll
->>> need to rummage through the commit log for the exact requirements
->>> and the reasoning behind them, so it could take a while. --s
+>>
+>> > Right, the extra logic for preventing autoindex pages from being
+>> > re-created. This is taking a while, so I'm going to leave out the
+>> > autoindex part for the moment. The FIXME is only relevant
+>> > because I tried to solve
+>> > [[todo/autoindex should use add__95__autofile]] first, but
+>> > strictly speaking, that's an orthogonal change. --s
>> * Suggest making recentchanges unlink the transient page
>> first, and only unlink from the old location if it wasn't
>> in the transient location. Ok, it only saves 1 syscall :)
+>>
+>> > Is an unlink() really that expensive? But, OK, fixed in the
+>> > `ready/transient-recentchanges` branch. --s
->>> Is an unlink() really that expensive? But, OK, fixed in the
->>> updated branch. --s
+>> >> It's not, but it's easy. :) --[[Joey]]
>> * Similarly it's a bit worrying for performance that it
>> needs to pull in and use `Cwd` on every ikiwiki startup now.
>> I really don't see the need; `wikistatedir` should
>> mostly be absolute, and ikiwiki should not chdir in ways
>> that break it anyway.
-
->>> The reason to make it absolute is that relative underlays
->>> are interpreted as relative to the base underlay directory,
->>> not the cwd.
->>>
->>> The updated branch only loads `Cwd` if the path is relative;
->>> an extra commit on branch `smcv/transient-relative` goes
->>> behind `add_underlay`'s back to allow use of a cwd-relative
->>> underlay. Which direction would you prefer? --s
+>>
+>> > The reason to make it absolute is that relative underlays
+>> > are interpreted as relative to the base underlay directory,
+>> > not the cwd, by `add_underlay`.
+>> >
+>> > The updated `ready/transient-only` branch only loads `Cwd` if
+>> > the path is relative; an extra commit on branch
+>> > `smcv/transient-relative` goes behind `add_underlay`'s
+>> > back to allow use of a cwd-relative underlay. Which direction
+>> > would you prefer?
+>> >
+>> > I note in passing that [[plugins/autoindex]] and `IkiWiki::Render`
+>> > both need to use `Cwd` and `File::Find` on every refresh, so
+>> > there's only any point in avoiding `Cwd` for runs that don't
+>> > actually refresh, like simple uses of the CGI. --s
+
+>> >> Oh, right, I'd forgotten about the horrificness of File::Find
+>> >> that required a chdir for security. Ugh. Can we just avoid
+>> >> it for those simple cases then? (demand-calculate wikistatedir)
+>> >> --[[Joey]]
>> * Unsure about the use of `default_pageext` in the `change`
>> hook. Is everything in the transientdir really going
>> to use that pageext? Would it be better to look up the
>> complete source filename?
-
->>> At the moment everything in the transientdir will either
->>> have the `default_pageext` or be internal, although I
->>> did wonder whether to make [[plugins/contrib/album]]
->>> viewer pages optionally be `html`, for better performance
->>> when there's a very large number of photos.
->>>
->>> A more thorough garbage-collection mechanism would be to
->>> use File::Find on the transient directory; I'll get there
->>> eventually. --s
+>>
+>> > I've updated `ready/transient` to do a more thorough GC by
+>> > using File::Find on the transient directory. This does
+>> > require `File::Find` and `Cwd`, but only when pages change,
+>> > and `refresh` loads both of those in that situation anyway.
+>> >
+>> > At the moment everything in the transientdir will either
+>> > have the `default_pageext` or be internal, although I
+>> > did wonder whether to make [[plugins/contrib/album]]
+>> > viewer pages optionally be `html`, for better performance
+>> > when there's a very large number of photos. --s
+
+>> >> Oh, ugh, more File::Find... Couldn't it just assume that the
+>> >> transient page has the same extension as its replacement?
+>> >> --[[Joey]]
--------------------------
+## current status
+
+[[done]] again! :)
+
+Actually, there are two places where the configured url is still hardcoded:
+
+1. When searching, all the links will use it. This is annoying to fix,
+ and we deem it not a problem.
+2. When ikiwiki dies with an error, the links on the error page will
+ use it. Too bad :)
+
+------
+
+## semi-old
+
+
+* CGI pages, with the exception of edit pages, set `<base>` to
+ `$config{url}`
+
+ I had to revert using `baseurl(undef)` for that, because it needs
+ to be a full url.
+
+ Ideally, baseurl would return an absolute url derived from the url
+ being used to access the cgi, but that needs access to the CGI object,
+ which it does not currently have. Similarly, `misctemplate`
+ does not have access to the CGI object, so it cannot use it to
+ generate a better baseurl. Not sure yet what to do; may have to thread
+ a cgi parameter through all the calls to misctemplate. --[[Joey]]
+
+ > Fixed, cgitemplate is used now. --[[Joey]]
+
+* Using `do=goto` to go to a comment or recentchanges item
+ will redirect to the `$config{url}`-based url, since the
+ permalinks are made to be absolute urls now.
+
+ Fixing this would seem to involve making meta force permalinks
+ to absolute urls when fulling out templates, while allowing them
+ to be left as partial urls internally, for use by goto. --[[Joey]]
+
+ > This reversion has now been fixed. --[[Joey]]
+
+## old attempt
+
It looks like all links in websites are absolute paths, this has some limitations:
* If connecting to website via https://... all links will take you back to http://
>> and 5 in plugins, since I used it for things like redirection back
>> to the top of the wiki --[[smcv]]
-[[merged|done]] --[[Joey]]
+merged|done --[[Joey]] (But reopened, see above.)
----
--- /dev/null
+I'm over [thattaway](http://lovesgoodfood.com/jason).
Name: ikiwiki
-Version: 3.20101201
+Version: 3.20110105
Release: 1%{?dist}
Summary: A wiki compiler
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-12-01 20:29-0400\n"
+"POT-Creation-Date: 2011-01-05 18:09-0400\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"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: ../IkiWiki/CGI.pm:162
+#: ../IkiWiki/CGI.pm:200
msgid ""
"probable misconfiguration: sslcookie is set, but you are attempting to login "
"via http, not https"
msgstr ""
-#: ../IkiWiki/CGI.pm:165
+#: ../IkiWiki/CGI.pm:203
msgid "login failed, perhaps you need to turn on cookies?"
msgstr ""
-#: ../IkiWiki/CGI.pm:184 ../IkiWiki/CGI.pm:335
+#: ../IkiWiki/CGI.pm:222 ../IkiWiki/CGI.pm:373
msgid "Your login session has expired."
msgstr ""
-#: ../IkiWiki/CGI.pm:205
+#: ../IkiWiki/CGI.pm:243
msgid "Login"
msgstr ""
-#: ../IkiWiki/CGI.pm:206
+#: ../IkiWiki/CGI.pm:244
msgid "Preferences"
msgstr ""
-#: ../IkiWiki/CGI.pm:207
+#: ../IkiWiki/CGI.pm:245
msgid "Admin"
msgstr ""
-#: ../IkiWiki/CGI.pm:247
+#: ../IkiWiki/CGI.pm:285
msgid "Preferences saved."
msgstr ""
-#: ../IkiWiki/CGI.pm:299
+#: ../IkiWiki/CGI.pm:337
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1370
+#: ../IkiWiki/CGI.pm:464 ../IkiWiki/CGI.pm:465 ../IkiWiki.pm:1424
msgid "Error"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:84
+#: ../IkiWiki/Plugin/aggregate.pm:83
msgid "Aggregation triggered via web."
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:93
+#: ../IkiWiki/Plugin/aggregate.pm:92
msgid "Nothing to do right now, all feeds are up-to-date!"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:222
+#: ../IkiWiki/Plugin/aggregate.pm:221
#, perl-format
msgid "missing %s parameter"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:257
+#: ../IkiWiki/Plugin/aggregate.pm:256
msgid "new feed"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:271
+#: ../IkiWiki/Plugin/aggregate.pm:270
msgid "posts"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:273
+#: ../IkiWiki/Plugin/aggregate.pm:272
msgid "new"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:457
+#: ../IkiWiki/Plugin/aggregate.pm:456
#, perl-format
msgid "expiring %s (%s days old)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:464
+#: ../IkiWiki/Plugin/aggregate.pm:463
#, perl-format
msgid "expiring %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:491
+#: ../IkiWiki/Plugin/aggregate.pm:490
#, perl-format
msgid "last checked %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:495
+#: ../IkiWiki/Plugin/aggregate.pm:494
#, perl-format
msgid "checking feed %s ..."
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:500
+#: ../IkiWiki/Plugin/aggregate.pm:499
#, perl-format
msgid "could not find feed at %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:519
+#: ../IkiWiki/Plugin/aggregate.pm:518
msgid "feed not found"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:530
+#: ../IkiWiki/Plugin/aggregate.pm:529
#, perl-format
msgid "(invalid UTF-8 stripped from feed)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:538
+#: ../IkiWiki/Plugin/aggregate.pm:537
#, perl-format
msgid "(feed entities escaped)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:546
+#: ../IkiWiki/Plugin/aggregate.pm:545
msgid "feed crashed XML::Feed!"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:632
+#: ../IkiWiki/Plugin/aggregate.pm:631
#, perl-format
msgid "creating new page %s"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:652 ../IkiWiki/Plugin/edittemplate.pm:135
+#: ../IkiWiki/Plugin/aggregate.pm:651 ../IkiWiki/Plugin/edittemplate.pm:135
msgid "failed to process template:"
msgstr ""
msgid "bad page name"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:377
+#: ../IkiWiki/Plugin/comments.pm:375
#, perl-format
msgid "commenting on %s"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:395
+#: ../IkiWiki/Plugin/comments.pm:392
#, perl-format
msgid "page '%s' doesn't exist, so you can't comment"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:402
+#: ../IkiWiki/Plugin/comments.pm:399
#, perl-format
msgid "comments on page '%s' are closed"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:510
+#: ../IkiWiki/Plugin/comments.pm:507
msgid "comment stored for moderation"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:512
+#: ../IkiWiki/Plugin/comments.pm:509
msgid "Your comment will be posted after moderator review"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:525
+#: ../IkiWiki/Plugin/comments.pm:522
msgid "Added a comment"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:529
+#: ../IkiWiki/Plugin/comments.pm:526
#, perl-format
msgid "Added a comment: %s"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:573 ../IkiWiki/Plugin/websetup.pm:269
+#: ../IkiWiki/Plugin/comments.pm:570 ../IkiWiki/Plugin/websetup.pm:269
msgid "you are not logged in as an admin"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:625
+#: ../IkiWiki/Plugin/comments.pm:622
msgid "Comment moderation"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:665
+#: ../IkiWiki/Plugin/comments.pm:663
msgid "comment moderation"
msgstr ""
-#: ../IkiWiki/Plugin/comments.pm:828
+#: ../IkiWiki/Plugin/comments.pm:826
#, perl-format
msgid "%i comment"
msgid_plural "%i comments"
#. translators: Here "Comment" is a verb;
#. translators: the user clicks on it to
#. translators: post a comment.
-#: ../IkiWiki/Plugin/comments.pm:838
+#: ../IkiWiki/Plugin/comments.pm:836
msgid "Comment"
msgstr ""
msgid "creating %s"
msgstr ""
-#: ../IkiWiki/Plugin/editpage.pm:312 ../IkiWiki/Plugin/editpage.pm:332
-#: ../IkiWiki/Plugin/editpage.pm:343 ../IkiWiki/Plugin/editpage.pm:388
-#: ../IkiWiki/Plugin/editpage.pm:430
+#: ../IkiWiki/Plugin/editpage.pm:312 ../IkiWiki/Plugin/editpage.pm:331
+#: ../IkiWiki/Plugin/editpage.pm:342 ../IkiWiki/Plugin/editpage.pm:387
+#: ../IkiWiki/Plugin/editpage.pm:429
#, perl-format
msgid "editing %s"
msgstr ""
msgid "%s is an attachment, not a page."
msgstr ""
-#: ../IkiWiki/Plugin/git.pm:766 ../IkiWiki/Plugin/git.pm:829
-#: ../IkiWiki.pm:1580
+#: ../IkiWiki/Plugin/git.pm:776 ../IkiWiki/Plugin/git.pm:839
+#: ../IkiWiki.pm:1634
#, perl-format
msgid "you are not allowed to change %s"
msgstr ""
-#: ../IkiWiki/Plugin/git.pm:788
+#: ../IkiWiki/Plugin/git.pm:798
#, perl-format
msgid "you cannot act on a file with mode %s"
msgstr ""
-#: ../IkiWiki/Plugin/git.pm:792
+#: ../IkiWiki/Plugin/git.pm:802
msgid "you are not allowed to change file modes"
msgstr ""
-#: ../IkiWiki/Plugin/git.pm:863
+#: ../IkiWiki/Plugin/git.pm:872
msgid "you are not allowed to revert a merge"
msgstr ""
-#: ../IkiWiki/Plugin/git.pm:879
+#: ../IkiWiki/Plugin/git.pm:891
#, perl-format
msgid "Failed to revert commit %s"
msgstr ""
msgid "prog not a valid graphviz program"
msgstr ""
-#: ../IkiWiki/Plugin/highlight.pm:64
+#: ../IkiWiki/Plugin/highlight.pm:88
#, perl-format
msgid "tohighlight contains unknown file type '%s'"
msgstr ""
-#: ../IkiWiki/Plugin/highlight.pm:75
+#: ../IkiWiki/Plugin/highlight.pm:99
#, perl-format
msgid "Source code: %s"
msgstr ""
-#: ../IkiWiki/Plugin/highlight.pm:155
+#: ../IkiWiki/Plugin/highlight.pm:184
msgid ""
"warning: highlight perl module not available; falling back to pass through"
msgstr ""
msgid "redir cycle is not allowed"
msgstr ""
-#: ../IkiWiki/Plugin/meta.pm:400
+#: ../IkiWiki/Plugin/meta.pm:405
msgid "sort=meta requires a parameter"
msgstr ""
"po_link_to=default"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:455
+#: ../IkiWiki/Plugin/po.pm:456
msgid "updated PO files"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:478
+#: ../IkiWiki/Plugin/po.pm:479
msgid ""
"Can not remove a translation. If the master page is removed, however, its "
"translations will be removed as well."
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:498
+#: ../IkiWiki/Plugin/po.pm:499
msgid ""
"Can not rename a translation. If the master page is renamed, however, its "
"translations will be renamed as well."
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:935
+#: ../IkiWiki/Plugin/po.pm:941
#, perl-format
msgid "POT file (%s) does not exist"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:949
+#: ../IkiWiki/Plugin/po.pm:955
#, perl-format
msgid "failed to copy underlay PO file to %s"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:958
+#: ../IkiWiki/Plugin/po.pm:964
#, perl-format
msgid "failed to update %s"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:964
+#: ../IkiWiki/Plugin/po.pm:970
#, perl-format
msgid "failed to copy the POT file to %s"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1000
+#: ../IkiWiki/Plugin/po.pm:1006
msgid "N/A"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1011
+#: ../IkiWiki/Plugin/po.pm:1017
#, perl-format
msgid "failed to translate %s"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1090
+#: ../IkiWiki/Plugin/po.pm:1096
msgid "removed obsolete PO files"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1147 ../IkiWiki/Plugin/po.pm:1159
-#: ../IkiWiki/Plugin/po.pm:1198
+#: ../IkiWiki/Plugin/po.pm:1153 ../IkiWiki/Plugin/po.pm:1165
+#: ../IkiWiki/Plugin/po.pm:1204
#, perl-format
msgid "failed to write %s"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1157
+#: ../IkiWiki/Plugin/po.pm:1163
msgid "failed to translate"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1210
+#: ../IkiWiki/Plugin/po.pm:1216
msgid "invalid gettext data, go back to previous page to continue edit"
msgstr ""
-#: ../IkiWiki/Plugin/po.pm:1252
+#: ../IkiWiki/Plugin/po.pm:1258
#, perl-format
msgid "%s has invalid syntax: must use CODE|NAME"
msgstr ""
msgid "confirm reversion of %s"
msgstr ""
-#: ../IkiWiki/Plugin/recentchangesdiff.pm:37
+#: ../IkiWiki/Plugin/recentchangesdiff.pm:36
msgid "(Diff truncated)"
msgstr ""
msgid "need Digest::SHA to index %s"
msgstr ""
-#: ../IkiWiki/Plugin/search.pm:232
+#: ../IkiWiki/Plugin/search.pm:233
msgid "search"
msgstr ""
msgid "parse fail at line %d: %s"
msgstr ""
-#: ../IkiWiki/Plugin/tag.pm:83
+#: ../IkiWiki/Plugin/tag.pm:94
#, perl-format
msgid "creating tag page %s"
msgstr ""
msgstr ""
#. translators: The parameter is a C filename.
-#: ../IkiWiki/Wrapper.pm:219
+#: ../IkiWiki/Wrapper.pm:220
#, perl-format
msgid "failed to compile %s"
msgstr ""
#. translators: The parameter is a filename.
-#: ../IkiWiki/Wrapper.pm:239
+#: ../IkiWiki/Wrapper.pm:240
#, perl-format
msgid "successfully generated %s"
msgstr ""
msgid "Discussion"
msgstr ""
-#: ../IkiWiki.pm:538
+#: ../IkiWiki.pm:544
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
-#: ../IkiWiki.pm:584
+#: ../IkiWiki.pm:616
msgid "cannot use multiple rcs plugins"
msgstr ""
-#: ../IkiWiki.pm:614
+#: ../IkiWiki.pm:646
#, perl-format
msgid "failed to load external plugin needed for %s plugin: %s"
msgstr ""
-#: ../IkiWiki.pm:1352
+#: ../IkiWiki.pm:1406
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1536
+#: ../IkiWiki.pm:1590
#, perl-format
msgid "bad file name %s"
msgstr ""
-#: ../IkiWiki.pm:1836
+#: ../IkiWiki.pm:1890
#, perl-format
msgid "template %s not found"
msgstr ""
-#: ../IkiWiki.pm:2118
+#: ../IkiWiki.pm:2140
msgid "yes"
msgstr ""
-#: ../IkiWiki.pm:2195
+#: ../IkiWiki.pm:2217
#, perl-format
msgid "invalid sort type %s"
msgstr ""
-#: ../IkiWiki.pm:2216
+#: ../IkiWiki.pm:2238
#, perl-format
msgid "unknown sort type %s"
msgstr ""
-#: ../IkiWiki.pm:2352
+#: ../IkiWiki.pm:2374
#, perl-format
msgid "cannot match pages: %s"
msgstr ""