Merge commit 'upstream/master' into prv/po

Conflicts:

	IkiWiki/Plugin/editpage.pm
	debian/control
	debian/copyright
	doc/todo/need_global_renamepage_hook.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
master
intrigeri 2009-03-08 09:50:27 +01:00
commit ae474d8e14
125 changed files with 3353 additions and 1564 deletions

View File

@ -16,17 +16,17 @@ perl -MCPAN -e 'install Bundle::IkiWiki'
=head1 CONTENTS
XML::Simple
Text::Markdown
Date::Parse
HTML::Template
HTML::Scrubber
CGI
HTML::Template
HTML::Parser
URI
XML::Simple
Date::Parse
CGI::FormBuilder
CGI::Session
Mail::Sendmail
HTML::Parser
URI
CGI
Data::Dumper
=head1 AUTHOR

View File

@ -31,6 +31,10 @@ Text::Textile
Text::WikiFormat
XML::Feed
Net::Amazon::S3
Text::WikiCreole
Term::ReadLine::Gnu
HTML::Tree
Authen::Passphrase
=head1 AUTHOR

View File

@ -627,27 +627,32 @@ sub dirname ($) {
return $file;
}
sub pagetype ($) {
my $page=shift;
if ($page =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
}
return;
}
sub isinternal ($) {
my $page=shift;
return exists $pagesources{$page} &&
$pagesources{$page} =~ /\._([^.]+)$/;
}
sub pagetype ($) {
my $file=shift;
if ($file =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
}
elsif ($hooks{htmlize}{basename($file)}{noextension}) {
return basename($file);
}
return;
}
sub pagename ($) {
my $file=shift;
my $type=pagetype($file);
my $page=$file;
$page=~s/\Q.$type\E*$// if defined $type && !$hooks{htmlize}{$type}{keepextension};
$page=~s/\Q.$type\E*$//
if defined $type && !$hooks{htmlize}{$type}{keepextension}
&& !$hooks{htmlize}{$type}{noextension};
if ($config{indexpages} && $page=~/(.*)\/index$/) {
$page=$1;
}
@ -1293,6 +1298,70 @@ sub indexlink () {
return "<a href=\"$config{url}\">$config{wikiname}</a>";
}
sub check_canedit ($$$;$) {
my $page=shift;
my $q=shift;
my $session=shift;
my $nonfatal=shift;
my $canedit;
run_hooks(canedit => sub {
return if defined $canedit;
my $ret=shift->($page, $q, $session);
if (defined $ret) {
if ($ret eq "") {
$canedit=1;
}
elsif (ref $ret eq 'CODE') {
$ret->() unless $nonfatal;
$canedit=0;
}
elsif (defined $ret) {
error($ret) unless $nonfatal;
$canedit=0;
}
}
});
return defined $canedit ? $canedit : 1;
}
sub check_content (@) {
my %params=@_;
return 1 if ! exists $hooks{checkcontent}; # optimisation
if (exists $pagesources{$params{page}}) {
my @diff;
my %old=map { $_ => 1 }
split("\n", readfile(srcfile($pagesources{$params{page}})));
foreach my $line (split("\n", $params{content})) {
push @diff, $line if ! exists $old{$_};
}
$params{content}=join("\n", @diff);
}
my $ok;
run_hooks(checkcontent => sub {
return if defined $ok;
my $ret=shift->(%params);
if (defined $ret) {
if ($ret eq "") {
$ok=1;
}
elsif (ref $ret eq 'CODE') {
$ret->() unless $params{nonfatal};
$ok=0;
}
elsif (defined $ret) {
error($ret) unless $params{nonfatal};
$ok=0;
}
}
});
return defined $ok ? $ok : 1;
}
my $wikilock;
sub lockwiki () {

View File

@ -142,7 +142,12 @@ sub cgi_postsignin ($$) {
exit;
}
else {
error(gettext("login failed, perhaps you need to turn on cookies?"));
if ($config{sslcookie} && ! $q->https()) {
error(gettext("probable misconfiguration: sslcookie is set, but you are attepting to login via http, not https"));
}
else {
error(gettext("login failed, perhaps you need to turn on cookies?"));
}
}
}
@ -229,6 +234,20 @@ sub cgi_prefs ($$) {
showform($form, $buttons, $session, $q);
}
sub cgi_custom_failure ($$) {
my $header=shift;
my $message=shift;
print $header;
print $message;
# Internet Explod^Hrer won't show custom 404 responses
# unless they're >= 512 bytes
print ' ' x 512;
exit;
}
sub check_banned ($$) {
my $q=shift;
my $session=shift;
@ -236,11 +255,11 @@ sub check_banned ($$) {
my $name=$session->param("name");
if (defined $name) {
if (grep { $name eq $_ } @{$config{banned_users}}) {
print $q->header(-status => "403 Forbidden");
$session->delete();
print gettext("You are banned.");
cgi_savesession($session);
exit;
cgi_custom_failure(
$q->header(-status => "403 Forbidden"),
gettext("You are banned."));
}
}
}
@ -317,7 +336,7 @@ sub cgi (;$$) {
error("\"do\" parameter missing");
}
}
# Need to lock the wiki before getting a session.
lockwiki();
loadindex();

View File

@ -0,0 +1,77 @@
#!/usr/bin/perl
# Copyright © 2009 Simon McVittie <http://smcv.pseudorandom.co.uk/>
# Licensed under the GNU GPL, version 2, or any later version published by the
# Free Software Foundation
package IkiWiki::Plugin::404;
use warnings;
use strict;
use IkiWiki 3.00;
sub import {
hook(type => "cgi", id => '404', call => \&cgi);
IkiWiki::loadplugin("goto");
}
sub getsetup () {
return
plugin => {
# not really a matter of safety, but enabling/disabling
# through a web interface is useless - it needs web
# server admin action too
safe => 0,
rebuild => 0,
}
}
sub cgi_page_from_404 ($$$) {
my $path = shift;
my $baseurl = shift;
my $usedirs = shift;
# fail if missing from environment or whatever
return undef unless defined $path;
return undef unless defined $baseurl;
# with usedirs on, path is like /~fred/foo/bar/ or /~fred/foo/bar or
# /~fred/foo/bar/index.html
# with usedirs off, path is like /~fred/foo/bar.html
# baseurl is like 'http://people.example.com/~fred'
# convert baseurl to ~fred
unless ($baseurl =~ s{^https?://[^/]+/?}{}) {
return undef;
}
# convert path to /~fred/foo/bar
if ($usedirs) {
$path =~ s/\/*(?:index\.$config{htmlext})?$//;
}
else {
$path =~ s/\.$config{htmlext}$//;
}
# remove /~fred/
unless ($path =~ s{^/*\Q$baseurl\E/*}{}) {
return undef;
}
# special case for the index
unless ($path) {
return 'index';
}
return $path;
}
sub cgi ($) {
my $cgi=shift;
if ($ENV{REDIRECT_STATUS} eq '404') {
my $page = cgi_page_from_404($ENV{REDIRECT_URL},
$config{url}, $config{usedirs});
IkiWiki::Plugin::goto::cgi_goto($cgi, $page);
}
}
1;

View File

@ -534,6 +534,11 @@ sub aggregate (@) {
}
foreach my $entry ($f->entries) {
# XML::Feed doesn't work around XML::Atom's bizarre
# API, so we will. Real unicode strings? Yes please.
# See [[bugs/Aggregated_Atom_feeds_are_double-encoded]]
local $XML::Atom::ForceUnicode = 1;
my $c=$entry->content;
# atom feeds may have no content, only a summary
if (! defined $c && ref $entry->summary) {

View File

@ -255,6 +255,26 @@ sub rcs_recentchanges ($) {
return @ret;
}
sub rcs_diff ($) {
my $taintedrev=shift;
my ($rev) = $taintedrev =~ /^(\d+(\.\d+)*)$/; # untaint
my $prevspec = "before:" . $rev;
my $revspec = "revno:" . $rev;
my @cmdline = ("bzr", "diff", "--old", $config{srcdir},
"--new", $config{srcdir},
"-r", $prevspec . ".." . $revspec);
open (my $out, "@cmdline |");
my @lines = <$out>;
if (wantarray) {
return @lines;
}
else {
return join("", @lines);
}
}
sub rcs_getctime ($) {
my ($file) = @_;

View File

@ -25,8 +25,9 @@ sub import {
hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
hook(type => "htmlize", id => "_comment", call => \&htmlize);
hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
hook(type => "cgi", id => "comments", call => \&linkcgi);
hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup);
# Load goto to fix up user page links for logged-in commenters
IkiWiki::loadplugin("goto");
IkiWiki::loadplugin("inline");
}
@ -167,7 +168,7 @@ sub preprocess {
}
else {
$commentauthorurl = IkiWiki::cgiurl(
do => 'commenter',
do => 'goto',
page => (length $config{userdir}
? "$config{userdir}/$commentuser"
: "$commentuser"));
@ -235,35 +236,6 @@ sub preprocess {
return $content;
}
# This is exactly the same as recentchanges_link :-(
sub linkcgi ($) {
my $cgi=shift;
if (defined $cgi->param('do') && $cgi->param('do') eq "commenter") {
my $page=decode_utf8($cgi->param("page"));
if (! defined $page) {
error("missing page parameter");
}
IkiWiki::loadindex();
my $link=bestlink("", $page);
if (! length $link) {
print "Content-type: text/html\n\n";
print IkiWiki::misctemplate(gettext(gettext("missing page")),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
"</p>");
}
else {
IkiWiki::redirect($cgi, urlto($link, undef, 1));
}
exit;
}
}
sub sessioncgi ($$) {
my $cgi=shift;
my $session=shift;
@ -477,7 +449,7 @@ sub editcomment ($$) {
IkiWiki::printheader($session);
print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")),
"<p>".
gettext("Your comment will be posted after moderator review"),
gettext("Your comment will be posted after moderator review").
"</p>");
exit;
}
@ -633,7 +605,8 @@ sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
if ($form->title eq "preferences") {
if ($form->title eq "preferences" &&
IkiWiki::is_admin($params{session}->param("name"))) {
push @{$params{buttons}}, "Comment Moderation";
if ($form->submitted && $form->submitted eq "Comment Moderation") {
commentmoderation($params{cgi}, $params{session});

View File

@ -51,73 +51,9 @@ sub refresh () {
# Back to ikiwiki namespace for the rest, this code is very much
# internal to ikiwiki even though it's separated into a plugin,
# and other plugins use the functions below.
# and other plugins use the function below.
package IkiWiki;
sub check_canedit ($$$;$) {
my $page=shift;
my $q=shift;
my $session=shift;
my $nonfatal=shift;
my $canedit;
run_hooks(canedit => sub {
return if defined $canedit;
my $ret=shift->($page, $q, $session);
if (defined $ret) {
if ($ret eq "") {
$canedit=1;
}
elsif (ref $ret eq 'CODE') {
$ret->() unless $nonfatal;
$canedit=0;
}
elsif (defined $ret) {
error($ret) unless $nonfatal;
$canedit=0;
}
}
});
return defined $canedit ? $canedit : 1;
}
sub check_content (@) {
my %params=@_;
return 1 if ! exists $hooks{checkcontent}; # optimisation
if (exists $pagesources{$params{page}}) {
my @diff;
my %old=map { $_ => 1 }
split("\n", readfile(srcfile($pagesources{$params{page}})));
foreach my $line (split("\n", $params{content})) {
push @diff, $line if ! exists $old{$_};
}
$params{diff}=join("\n", @diff);
}
my $ok;
run_hooks(checkcontent => sub {
return if defined $ok;
my $ret=shift->(%params);
if (defined $ret) {
if ($ret eq "") {
$ok=1;
}
elsif (ref $ret eq 'CODE') {
$ret->() unless $params{nonfatal};
$ok=0;
}
elsif (defined $ret) {
error($ret) unless $params{nonfatal};
$ok=0;
}
}
});
return defined $ok ? $ok : 1;
}
sub cgi_editpage ($$) {
my $q=shift;
my $session=shift;

View File

@ -0,0 +1,75 @@
#!/usr/bin/perl
package IkiWiki::Plugin::goto;
use warnings;
use strict;
use IkiWiki 3.00;
sub import {
hook(type => "cgi", id => 'goto', call => \&cgi);
}
sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 0,
}
}
# cgi_goto(CGI, [page])
# Redirect to a specified page, or display "not found". If not specified,
# the page param from the CGI object is used.
sub cgi_goto ($;$) {
my $q = shift;
my $page = shift;
if (!defined $page) {
$page = IkiWiki::decode_utf8($q->param("page"));
if (!defined $page) {
error("missing page parameter");
}
}
IkiWiki::loadindex();
# If the page is internal (like a comment), see if it has a
# permalink. Comments do.
if (IkiWiki::isinternal($page) &&
defined $pagestate{$page}{meta}{permalink}) {
IkiWiki::redirect($q, $pagestate{$page}{meta}{permalink});
}
my $link = bestlink("", $page);
if (! length $link) {
IkiWiki::cgi_custom_failure(
$q->header(-status => "404 Not Found"),
IkiWiki::misctemplate(gettext("missing page"),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
"</p>")
)
}
else {
IkiWiki::redirect($q, urlto($link, undef, 1));
}
exit;
}
sub cgi ($) {
my $cgi=shift;
my $do = $cgi->param('do');
if (defined $do && ($do eq 'goto' || $do eq 'commenter' ||
$do eq 'recentchanges_link')) {
# goto is the preferred name for this; recentchanges_link and
# commenter are for compatibility with any saved URLs
cgi_goto($cgi);
}
}
1;

View File

@ -45,7 +45,7 @@ sub render_graph (\%) {
if (! -e "$config{destdir}/$dest") {
my $pid;
my $sigpipe=0;;
my $sigpipe=0;
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "$params{prog} -Tpng");

View File

@ -519,9 +519,15 @@ sub genfeed ($$$$$@) {
mdate_3339 => date_3339($pagemtime{$p}),
);
if (exists $pagestate{$p} &&
exists $pagestate{$p}{meta}{guid}) {
$itemtemplate->param(guid => $pagestate{$p}{meta}{guid});
if (exists $pagestate{$p}) {
if (exists $pagestate{$p}{meta}{guid}) {
$itemtemplate->param(guid => $pagestate{$p}{meta}{guid});
}
if (exists $pagestate{$p}{meta}{updated}) {
$itemtemplate->param(mdate_822 => date_822($pagestate{$p}{meta}{updated}));
$itemtemplate->param(mdate_3339 => date_3339($pagestate{$p}{meta}{updated}));
}
}
if ($itemtemplate->query(name => "enclosure")) {

View File

@ -128,6 +128,13 @@ sub preprocess (@) {
$IkiWiki::pagectime{$page}=$time if defined $time;
}
}
elsif ($key eq 'updated') {
eval q{use Date::Parse};
if (! $@) {
my $time = str2time($value);
$pagestate{$page}{meta}{updated}=$time if defined $time;
}
}
if (! defined wantarray) {
# avoid collecting duplicate data during scan pass

View File

@ -13,7 +13,8 @@ sub import {
hook(type => "refresh", id => "recentchanges", call => \&refresh);
hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate);
hook(type => "htmlize", id => "_change", call => \&htmlize);
hook(type => "cgi", id => "recentchanges", call => \&cgi);
# Load goto to fix up links from recentchanges
IkiWiki::loadplugin("goto");
}
sub getsetup () {
@ -79,48 +80,6 @@ sub htmlize (@) {
return $params{content};
}
sub cgi ($) {
my $cgi=shift;
if (defined $cgi->param('do') && $cgi->param('do') eq "recentchanges_link") {
# This is a link from a change page to some
# other page. Since the change pages are only generated
# once, statically, links on them won't be updated if the
# page they link to is deleted, or newly created, or
# changes for whatever reason. So this CGI handles that
# dynamic linking stuff.
my $page=decode_utf8($cgi->param("page"));
if (!defined $page) {
error("missing page parameter");
}
IkiWiki::loadindex();
# If the page is internal (like a comment), see if it has a
# permalink. Comments do.
if (IkiWiki::isinternal($page) &&
defined $pagestate{$page}{meta}{permalink}) {
IkiWiki::redirect($cgi,
$pagestate{$page}{meta}{permalink});
exit;
}
my $link=bestlink("", $page);
if (! length $link) {
print "Content-type: text/html\n\n";
print IkiWiki::misctemplate(gettext(gettext("missing page")),
"<p>".
sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)).
"</p>");
}
else {
IkiWiki::redirect($cgi, urlto($link, undef, 1));
}
exit;
}
}
sub store ($$$) {
my $change=shift;
@ -138,7 +97,7 @@ sub store ($$$) {
if (length $config{cgiurl}) {
$_->{link} = "<a href=\"".
IkiWiki::cgiurl(
do => "recentchanges_link",
do => "goto",
page => $_->{page}
).
"\" rel=\"nofollow\">".

View File

@ -20,14 +20,20 @@ sub getsetup () {
}
sub checkconfig () {
if (defined $config{srcdir}) {
if (defined $config{srcdir} && length $config{srcdir}) {
# Preprocess the shortcuts page to get all the available shortcuts
# defined before other pages are rendered.
my $srcfile=srcfile("shortcuts.mdwn", 1);
my $srcfile=srcfile("shortcuts.".$config{default_pageext}, 1);
if (! defined $srcfile) {
error(gettext("shortcut plugin will not work without a shortcuts.mdwn"));
$srcfile=srcfile("shortcuts.mdwn", 1);
}
if (! defined $srcfile) {
print STDERR sprintf(gettext("shortcut plugin will not work without %s"),
"shortcuts.".$config{default_pageext})."\n";
}
else {
IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
}
IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile));
}
}

View File

@ -130,7 +130,7 @@ sub preprocess (@) {
if (! -e "$config{destdir}/$fn") {
my $pid;
my $sigpipe=0;;
my $sigpipe=0;
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "php");

View File

@ -125,4 +125,12 @@ sub pagetemplate (@) {
}
}
package IkiWiki::PageSpec;
sub match_tagged ($$;@) {
my $page = shift;
my $glob = shift;
return match_link($page, IkiWiki::Plugin::tag::tagpage($glob));
}
1

View File

@ -10,7 +10,8 @@ use Encode;
sub import {
hook(type => "getsetup", id => "template", call => \&getsetup);
hook(type => "preprocess", id => "template", call => \&preprocess);
hook(type => "preprocess", id => "template", call => \&preprocess,
scan => 1);
}
sub getsetup () {

View File

@ -0,0 +1,40 @@
#!/usr/bin/perl
package IkiWiki::Plugin::underlay;
# Copyright © 2008 Simon McVittie <http://smcv.pseudorandom.co.uk/>
# Licensed under the GNU GPL, version 2, or any later version published by the
# Free Software Foundation
use warnings;
use strict;
use IkiWiki 3.00;
sub import {
hook(type => "getsetup", id => "underlay", call => \&getsetup);
hook(type => "checkconfig", id => "underlay", call => \&checkconfig);
}
sub getsetup () {
return
plugin => {
safe => 0,
rebuild => undef,
},
add_underlays => {
type => "string",
default => [],
description => "extra underlay directories to add",
advanced => 1,
safe => 0,
rebuild => 1,
},
}
sub checkconfig () {
return unless exists $config{add_underlays};
foreach my $dir (@{$config{add_underlays}}) {
add_underlay($dir);
}
}
1;

View File

@ -0,0 +1,44 @@
#!/usr/bin/perl
package IkiWiki::Plugin::wmd;
use warnings;
use strict;
use IkiWiki 3.00;
use POSIX;
use Encode;
sub import {
add_underlay("wmd");
hook(type => "getsetup", id => "wmd", call => \&getsetup);
hook(type => "formbuilder_setup", id => "wmd", call => \&formbuilder_setup);
}
sub getsetup () {
return
plugin => {
safe => 1,
},
}
sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
return if ! defined $form->field("do");
return unless (($form->field("do") eq "edit") ||
($form->field("do") eq "create"));
$form->tmpl_param("wmd_preview", "<div class=\"wmd-preview\"></div>\n".
include_javascript(undef, 1));
}
sub include_javascript ($;$) {
my $page=shift;
my $absolute=shift;
return '<script src="'.urlto("wmd.js", $page, $absolute).
'" type="text/javascript"></script>'."\n";
}
1

View File

@ -110,11 +110,20 @@ sub import (@) {
next if $admin=~/^http\?:\/\//; # openid
# Prompt for password w/o echo.
my ($password, $password2);
system('stty -echo 2>/dev/null');
local $|=1;
print "\n\nCreating wiki admin $admin ...\n";
print "Choose a password: ";
chomp(my $password=<STDIN>);
for (;;) {
print "Choose a password: ";
chomp($password=<STDIN>);
print "Confirm password: ";
chomp($password2=<STDIN>);
last if $password2 eq $password;
print "Password mismatch.\n\n";
}
print "\n\n\n";
system('stty sane 2>/dev/null');

View File

@ -28,7 +28,8 @@ sub gen_wrapper () {
my @envsave;
push @envsave, qw{REMOTE_ADDR QUERY_STRING REQUEST_METHOD REQUEST_URI
CONTENT_TYPE CONTENT_LENGTH GATEWAY_INTERFACE
HTTP_COOKIE REMOTE_USER HTTPS} if $config{cgi};
HTTP_COOKIE REMOTE_USER HTTPS REDIRECT_STATUS
REDIRECT_URL} if $config{cgi};
my $envsave="";
foreach my $var (@envsave) {
$envsave.=<<"EOF";
@ -92,10 +93,7 @@ EOF
$configstring=~s/"/\\"/g;
$configstring=~s/\n/\\n/g;
#translators: The first parameter is a filename, and the second is
#translators: a (probably not translated) error message.
open(OUT, ">$wrapper.c") || error(sprintf(gettext("failed to write %s: %s"), "$wrapper.c", $!));;
print OUT <<"EOF";
writefile(basename("$wrapper.c"), dirname($wrapper), <<"EOF");
/* A wrapper for ikiwiki, can be safely made suid. */
#include <stdio.h>
#include <sys/types.h>

View File

@ -42,7 +42,7 @@ extra_build: ikiwiki.out ikiwiki.setup docwiki
./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
./mdwn2man ikiwiki-transition 1 doc/ikiwiki-transition.mdwn > ikiwiki-transition.man
./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
$(MAKE) -C po mo
$(MAKE) -C po
docwiki: ikiwiki.out
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh
@ -57,7 +57,7 @@ extra_install:
for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir || \
cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
done; \
done
@ -71,11 +71,11 @@ extra_install:
done
# Install example sites.
for dir in `cd doc/examples; find -type d ! -regex '.*\.svn.*'`; do \
for dir in `cd doc/examples; find . -type d ! -regex '.*\.svn.*'`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
done
for file in `cd doc/examples; find -type f ! -regex '.*\.svn.*'`; do \
cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file || \
for file in `cd doc/examples; find . -type f ! -regex '.*\.svn.*'`; do \
cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \
install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
done
@ -87,10 +87,10 @@ extra_install:
done
install -d $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins
for file in `find plugins -maxdepth 1 -type f ! -wholename plugins/.\* ! -name \*demo\* -name \*.py`; do \
for file in `find plugins -maxdepth 1 -type f ! -path plugins/.\* ! -name \*demo\* -name \*.py`; do \
install -m 644 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
done
for file in `find plugins -maxdepth 1 -type f ! -wholename plugins/.\* ! -name \*demo\* ! -name \*.py ! -name \*.pyc`; do \
for file in `find plugins -maxdepth 1 -type f ! -path plugins/.\* ! -name \*demo\* ! -name \*.py ! -name \*.pyc`; do \
install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
done

69
debian/changelog vendored
View File

@ -1,17 +1,70 @@
ikiwiki (3.03) UNRELEASED; urgency=low
ikiwiki (3.07) UNRELEASED; urgency=low
* Updated German translation (Kai Wasserbäch). Closes: #518377
* Updated French translation (Jean-Luc Coulon). Closes: #518510
* Avoid feeding decoded unicode to Term::ReadLine.
Closes: 512169
-- Joey Hess <joeyh@debian.org> Thu, 05 Mar 2009 15:43:02 -0500
ikiwiki (3.06) unstable; urgency=low
* Setup automator: Fix bug in password comparison. Closes: #517654
-- Joey Hess <joeyh@debian.org> Sun, 01 Mar 2009 15:02:30 -0500
ikiwiki (3.05) unstable; urgency=low
* debhelper v7(.0.50); rules file minimisation.
* template: Load templates in scan mode.
This is potentially expensive, but is necessary so that meta and tag
directives, and other links on templates affect the page using the
template reliably.
* goto: Fix redirect to comments.
* Add noextension parameter to htmlize hooks to support, eg, Makefile.
* Add tagged() PageSpec.
* Updated German translation (Kai Wasserbäch). Closes: #516770
* Setup automator: Prompt for password twice. Closes: #516973
* bzr: Add missing rcs_diff. (liw)
* comments: Avoid showing comment moderation button in prefs to non-admins.
* goto: Fix typo that broke recentchanges_link compatibility.
-- Joey Hess <joeyh@debian.org> Fri, 27 Feb 2009 15:48:39 -0500
ikiwiki (3.04) unstable; urgency=low
* 404: New plugin which lets you use the IkiWiki CGI script as
an Apache 404 handler, to give the behaviour of various other wiki
engines where visiting a nonexistent page provides you with a link
to create it. (smcv)
* Factor out redundant code into goto plugin. (smcv)
* Work around XML::Atom strangeness that results in double-encoded posts.
(smcv)
* Fix unusual --setup --post-commit command line option combo.
* Create any missing directory necessary to put the wrapper
file into. Closes: #514384
* shortcut: If default_pageext is set, first look for
shortcuts.default_pageext.
* Allow comments, rename, remove, and attachment plugins to be used
even if the editpage plugin is disabled.
-- Joey Hess <joeyh@debian.org> Sat, 14 Feb 2009 02:27:14 -0500
ikiwiki (3.03) unstable; urgency=low
* Avoid feeding decoded unicode to Term::ReadLine. Closes: 512169
* blogspam: Log spam info on failure in debug mode.
* Remove nonstandard css. Closes: #512378
* blogspam: Fix use of blogspam_options and blogspam_server
config settings.
* blogspam: Fix use of blogspam_options and blogspam_server config settings.
* comments: If comment content checks fail, store the comment
(in .ikiwiki/comments_pending) for moderator review.
* comments: Add a moderation web interface.
* git: Fix malformed utf8 recieved from git.
* comments: Add a moderation web interface, which admins can
access via their Preferences page.
* git: Fix malformed utf8 received from git.
* meta: New "updated" metadata specifies a fake modification time for a
page, to be output into RSS and Atom feeds. (smcv)
* underlay: New plugin, allows pulling in additional files not
in version control. (smcv)
-- Joey Hess <joeyh@debian.org> Sun, 18 Jan 2009 14:50:57 -0500
-- Joey Hess <joeyh@debian.org> Thu, 29 Jan 2009 14:36:58 -0500
ikiwiki (3.02) unstable; urgency=low

2
debian/compat vendored
View File

@ -1 +1 @@
5
7

6
debian/control vendored
View File

@ -1,7 +1,7 @@
Source: ikiwiki
Section: web
Priority: optional
Build-Depends: perl, debhelper (>= 5)
Build-Depends: perl, debhelper (>= 7.0.50)
Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl, libtext-markdown-perl | markdown, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, wdg-html-validator, libhtml-parser-perl, liburi-perl, perlmagick
Maintainer: Joey Hess <joeyh@debian.org>
Uploaders: Josh Triplett <josh@freedesktop.org>
@ -12,9 +12,9 @@ Vcs-Browser: http://git.ikiwiki.info/?p=ikiwiki
Package: ikiwiki
Architecture: all
Depends: ${perl:Depends}, libtext-markdown-perl | markdown, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl
Depends: ${misc:Depends}, ${perl:Depends}, libtext-markdown-perl | markdown, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl
Recommends: gcc | c-compiler, libc6-dev | libc-dev, subversion | git-core (>= 1:1.5.0) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38), libxml-simple-perl, libnet-openid-consumer-perl, liblwpx-paranoidagent-perl, libtimedate-perl, libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1), libmail-sendmail-perl, libauthen-passphrase-perl, libterm-readline-gnu-perl
Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng, po4a (>= 0.35-1), gettext
Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng, libtext-wikicreole-perl, po4a (>= 0.35-1), gettext
Conflicts: ikiwiki-plugin-table
Replaces: ikiwiki-plugin-table
Provides: ikiwiki-plugin-table

6
debian/copyright vendored
View File

@ -76,7 +76,7 @@ Files: htmltidy.pm
Copyright: © 2006 Faidon Liambotis
License: GPL-2+
Files: htmlbalance.pm
Files: htmlbalance.pm, underlay.pm
Copyright: © 2008 Simon McVittie <http://smcv.pseudorandom.co.uk/>
License: GPL-2+
@ -122,6 +122,10 @@ Files: po.pm
Copyright: © 2008-2009 intrigeri <intrigeri@boum.org>
License: GPL-2+
Files: 404.pm
Copyright: © 2009 Simon McVittie <http://smcv.pseudorandom.co.uk/>
License: GPL-2+
Files: doc/logo/*
Copyright: © 2006 Recai Oktaş <roktas@debian.org>
License: GPL-2+

1
debian/docs vendored 100644
View File

@ -0,0 +1 @@
html

2
debian/link vendored 100644
View File

@ -0,0 +1,2 @@
usr/share/ikiwiki/examples usr/share/doc/ikiwiki/examples
usr/share/common-licenses/GPL-2 usr/share/doc/ikiwiki/html/GPL

48
debian/rules vendored
View File

@ -1,45 +1,19 @@
#!/usr/bin/make -f
%:
dh $@
build: build-stamp
build-stamp:
dh_testdir
perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor
$(MAKE) -C po
$(MAKE)
$(MAKE) test
touch build-stamp
override_dh_auto_configure:
# keeps it out of /usr/local
dh_auto_configure -- PREFIX=/usr
clean:
dh_testdir
dh_testroot
rm -f build-stamp
perl Makefile.PL
override_dh_compress:
# avoid compressing files in the doc wiki
dh_compress -Xhtml
override_dh_auto_clean:
# distclean moans about MANIFEST, this is quieter
if [ -e Makefile ]; then $(MAKE) realclean; fi
dh_clean
binary-arch: build
binary-indep: build
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) pure_install DESTDIR=$(shell pwd)/debian/ikiwiki
dh_installdocs html
dh_link usr/share/ikiwiki/examples usr/share/doc/ikiwiki/examples
dh_link usr/share/common-licenses/GPL-2 usr/share/doc/ikiwiki/html/GPL
dh_installexamples
dh_installchangelogs
dh_compress -X html
dh_fixperms
dh_perl
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Not intended for use by anyone except the author.
announcedir:
@echo ${HOME}/src/ikiwiki/doc/news
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary

View File

@ -0,0 +1,22 @@
The Atom feed from <http://planet.collabora.co.uk/>
get "double-encoded" (UTF-8 is decoded as Latin-1 and re-encoded as
UTF-8) when aggregated with IkiWiki on Debian unstable. The RSS 1.0
and RSS 2.0 feeds from the same Planet are fine. All three files
are in fact correct UTF-8, but IkiWiki mis-parses the Atom.
This turns out to be a bug in XML::Feed, or (depending on your point
of view) XML::Feed failing to work around a design flaw in XML::Atom.
When parsing RSS it returns Unicode strings, but when parsing Atom
it delegates to XML::Atom's behaviour, which by default is to strip
the UTF8 flag from strings that it outputs; as a result, they're
interpreted by IkiWiki as byte sequences corresponding to the UTF-8
encoding. IkiWiki then treats these as if they were Latin-1 and
encodes them into UTF-8 for output.
I've filed a bug against XML::Feed on CPAN requesting that it sets
the right magical variable to change this behaviour. IkiWiki can
also apply the same workaround (and doing so should be harmless even
when XML::Feed is fixed); please consider merging my 'atom' branch,
which does so. --[[smcv]]
[[!tag patch done]]

View File

@ -0,0 +1,24 @@
'make test' has the following errors:
Can't locate Locale/gettext.pm in @INC (@INC contains: /home/turian/utils//lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /home/turian/utils//lib/perl5/site_perl/5.8.8 . /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8) at (eval 254) line 2.
What's weird is that I already have gettext.pm:
/home/turian/utils/lib/perl5/lib/i386-linux-thread-multi/Locale/gettext.pm
That directory should be part of @INC, because I have:
export PERL5LIB="$PERL5LIB:$UTILS/lib/perl5/lib/i386-linux-thread-multi/"
in my .bashrc. However, /home/turian/utils/lib/perl5/lib/i386-linux-thread-multi/ does not appear in that @INC line.
How do I get the proper @INC locations set?
> Nothing in ikiwiki touches whatever PERL5DIR setting you may have,
> so AFAICS, this must be some sort of local configuration problem.
> How do
> `/home/turian/utils//lib/perl5/site_perl/5.8.8/i386-linux-thread-multi`
> and `/home/turian/utils//lib/perl5/site_perl/5.8.8` get into the
> displayed `@INC`? The likely way seems to be that something in your
> system sets PERL5LIB to contain those directories, clobbering
> the earlier setting in your `.bashrc`.
> --[[Joey]]
[[!tag done]]

View File

@ -0,0 +1,25 @@
If a PNG image matches the [[ikiwiki/PageSpec]] of an [[ikiwiki/directive/inline]] directive, the page throws the following error:
> \[[!inline Error: Malformed UTF-8 character (fatal) at /usr/local/lib/perl5/site_perl/5.8.8/File/MimeInfo.pm line 120.]]
Individual posts display fine, and moving the offending image outside the scope of the [[ikiwiki/directive/inline]] directive's PageSpec eliminates the error.
> I tried to reproduce this with a random png and File::MimeInfo
> version 0.15, but could not. The png was included in the generated feed
> via an enclosure, as it should be; no warnings or errors.
>
> Looking at the source to File::MimeInfo and its changelog,
> I'm pretty sure that this problem was fixed in version
> 0.14:
>> - Fixed bug with malformed utf8 chars in default() method
>
> The code involved in that fix looks like this:
>
>> no warnings; # warnings can be thrown when input not ascii
>> if ($] < 5.008 or ! utf8::valid($line)) {
>> use bytes; # avoid invalid utf8 chars
>
> I guess that your locally installed version of File::MimeInfo is older than
> this. So closing this bug [[done]]. If you still see the problem with a current
> version of File::MimeInfo, please reopen and include where I can get a png file
> that triggers the problem. --[[Joey]]

View File

@ -0,0 +1,27 @@
The bzr plugin does not seem to define the rcs_diff subroutine.
I got the follow error after enabling recentchangesdiff:
"Undefined subroutine &IkiWiki::Plugin::bzr::rcs_diff called at /usr/share/perl5/IkiWiki.pm line 1590."
Grepping to verify absence of rcs_diff:
$ grep rcs_diff /usr/share/perl5/IkiWiki/Plugin/{git,bzr}.pm
/usr/share/perl5/IkiWiki/Plugin/git.pm: hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
/usr/share/perl5/IkiWiki/Plugin/git.pm:sub rcs_diff ($) {
/usr/share/perl5/IkiWiki/Plugin/bzr.pm: hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
> I've added the minimal stub needed to avoid the crash, but for
> recentchangesdiff to work, someone needs to implement `rcs_diff` for bzr.
> This should be trivial if you know and use bzr. The function
> is passed as a parameter the revno of interest and just needs
> to ask bzr for the diff between that and the previous version. --[[Joey]]
>> I'll see if I can make a patch. The bzr command to get the revision would
>> look like this: bzr diff -r revno:$PREV:/path/to/src..revno:$REVNO:/path/to/src
>> (where $PREV would be $REVNO minus one). --liw
>> Sorry, that was not entirely correct, for some reason. I'll add a patch below that
>> seems to work. I am unfortunately not ready to set up a git repository that you
>> can pull from. --liw
[[done]] --[[Joey]]

View File

@ -4,6 +4,8 @@ pass, which does not look at the template a page includes, it will not be
seen then, and so other pages that use the page title probably won't use
it. (Barring luck with build order.)
Update: This also affects using tags from templates.
There is a simple fix for this, just add `scan => 1` when registering the
preprocess hook for the template plugin.
@ -12,3 +14,5 @@ scan pass, every page containing a template will cause the template to be
loaded and filled out. This can be some serious additional overhead.
--[[Joey]]
[[done]]

View File

@ -0,0 +1,47 @@
Some elements of [HTML5](http://www.whatwg.org/specs/web-apps/current-work/multipage/) can be safely supported by ikiwiki. There are [several differences between HTML4 and HTMl5](http://www.w3.org/TR/html5-diff/). Unsupported new elements _should degrade gracefully_.
> In the `origin/html` branch, there is an old work in progress to make
> ikiwiki use html 4 instead of xhtml. If that could be brought forward and
> finished then the plan has been to switch ikiwiki over to doing html 4.
> I don't think it makes sense to try to make it support both xhtml and
> html, it would complicate the code for no benefit.
>
> I think that is the best route toward supporting html 5 as well. Get
> ikiwiki doing html 4 first and the changes needed to get to 5 from there
> should be small. Probably just changing some doctypes and a few other
> small changes which could be kept in a branch, or even shipped in ikiwiki
> mainline as an alternate set of templates. Some of the changes, like
> supporting new html 5 tags in the htmlscrubber, can be done in mainline.
> (Like was already done for the html 5 video and audio tags.)
>
> This approach seems much more maintainable going foward than rolling a
> html 5 branch immediatly and trying to keep that continually up-to-date
> with mainline ikiwiki that is still using xhtml. --[[Joey]]
However as an [early adopter](http://en.wikipedia.org/wiki/Early_adopter) I would like to start using HTML5 as much as possible. The more pragmatic solution would be to use elements supported by the browsers of your readership I guess. I'm following other early adopters like [Anne](http://annevankesteren.nl/) for clues on how to proceed.
* [Initial patch](http://git.webconverger.org/?p=ikiwiki;a=commit;h=2e2bb3f74f5000b1269142d6f9bdf1bcb4075ca4)
> I can't figure out how to pull from this repository.
>> Sorry! I have fixed the cloneurl file to read `git clone git://webconverger.org/git/ikiwiki`
I'm unsure how to turn off the test validation by the very old [wdg-html-validator](http://packages.qa.debian.org/w/wdg-html-validator.html). So I have been unable to test my initial patches as I can't build ikiwiki. I would like to know how to edit the rules/Makefile to temporarily disable this.
> Don't run ¨make test" ... --[[Joey]]
>> I don't quite grok debhelper7 [rules](http://git.ikiwiki.info/?p=ikiwiki;a=blob;f=debian/rules).
>>> Well, ok :-) `rm t/html.t` or, add an empty `override_dh_auto_test` rule.
>>> --[[Joey]]
[validator.nu](http://validator.nu/) incidentally is **the** HTML5 validator, however it is almost impossible to sanely introduce as a build dependency because of its insane Java requirements. :( I test locally via [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built with a network dependency.
# Notes
* the [time element](http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element) ideally needs the datatime= attribute set with iso8601 time
* I suspect the migration to the new semantic elements of HTML5 like article, header & footer to take some time, due to browser support. Though they sure make the template code look much nicer.
* `<br>` and too many `<div>`s usually indicates poor semantics.
> YMMV, but I tend to find that kind of concern counterproductive.
> --[[Joey]]
* Many of the header `<span>`s should be proper [header elements](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements)
> See [[todo/Option_to_make_title_an_h1__63__]] for why not. --[[Joey]]

View File

@ -2,8 +2,127 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title
--[[madduck]]
> Agreed. [[todo/using_meta_titles_for_parentlinks]] contains a beginning of
> solution. A few quick notes about it:
----
It is possible to set a Page-Title in the meta-plugin, but that one isn't
reused in parentlinks. This [[patch]] may fix it.
<ul>
<li> I give pagetitle the full path to a page.
<li> I redefine the 'pagetitle'-sub to deal with it.
<li> to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle.
</ul>
<pre>
diff -c /usr/share/perl5/IkiWiki/Render.pm.distrib /usr/share/perl5/IkiWiki/Render.pm
*** /usr/share/perl5/IkiWiki/Render.pm.distrib Wed Aug 6 07:34:55 2008
--- /usr/share/perl5/IkiWiki/Render.pm Tue Aug 26 23:29:32 2008
***************
*** 102,108 ****
$template->param(
title => $page eq 'index'
? $config{wikiname}
! : pagetitle(basename($page)),
wikiname => $config{wikiname},
content => $content,
backlinks => $backlinks,
--- 102,108 ----
$template->param(
title => $page eq 'index'
? $config{wikiname}
! : pagetitle($page),
wikiname => $config{wikiname},
content => $content,
backlinks => $backlinks,
diff -c /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm
*** /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib Wed Aug 6 07:34:55 2008
--- /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm Tue Aug 26 23:19:43 2008
***************
*** 44,50 ****
"height_$height" => 1,
};
$path.="/".$dir;
! $title=IkiWiki::pagetitle($dir);
$i++;
}
return @ret;
--- 44,50 ----
"height_$height" => 1,
};
$path.="/".$dir;
! $title=IkiWiki::pagetitle($path);
$i++;
}
return @ret;
diff -c /usr/share/perl5/IkiWiki.pm.distrib /usr/share/perl5/IkiWiki.pm
*** /usr/share/perl5/IkiWiki.pm.distrib Wed Aug 6 07:48:34 2008
--- /usr/share/perl5/IkiWiki.pm Tue Aug 26 23:47:30 2008
***************
*** 792,797 ****
--- 792,799 ----
my $page=shift;
my $unescaped=shift;
+ $page=basename($page);
+
if ($unescaped) {
$page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
}
diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki/Plugin/meta.pm
*** /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib Wed Aug 6 07:34:55 2008
--- /usr/share/perl5/IkiWiki/Plugin/meta.pm Tue Aug 26 23:30:58 2008
***************
*** 3,8 ****
--- 3,9 ----
package IkiWiki::Plugin::meta;
use warnings;
+ no warnings 'redefine';
use strict;
use IkiWiki 2.00;
***************
*** 289,294 ****
--- 290,319 ----
}
}
+ sub IkiWiki::pagetitle ($;$) {
+ my $page=shift;
+ my $unescaped=shift;
+
+ if ($page =~ m#/#) {
+ $page =~ s#^/##;
+ $page =~ s#/index$##;
+ if ($pagestate{"$page/index"}{meta}{title}) {
+ $page = $pagestate{"$page/index"}{meta}{title};
+ } else {
+ $page = IkiWiki::basename($page);
+ }
+ }
+
+ if ($unescaped) {
+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
+ }
+ else {
+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
+ }
+
+ return $page;
+ }
+
package IkiWiki::PageSpec;
sub match_title ($$;@) {
</pre>
----
> A few quick notes about it:
> - Using <code>inline</code> would avoid the redefinition + code duplication.
> - A few plugins would need to be upgraded.
@ -16,3 +135,99 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title
>> Thus tagging [[patch]]. --[[intrigeri]]
>>
>>> Joey, please consider merging my `meta` branch. --[[intrigeri]]
So, looking at your meta branch: --[[Joey]]
* Inter-page dependencies. If page A links to page B, and page B currently
has no title, then A will display the link as "B". Now page B is modified
and a title is added. Nothing updates "A".
The added overhead of rebuilding every page that links to B when B is
changed (as the `postscan` hook of the po plugin does) is IMHO a killer.
That could be hundreds or thousands of pages, making interactive editing
way slow. This is probably the main reason I had not attempted this whole
thing myself. IMHO this calls for some kind of intellegent dependency
handler that can detect when B's title has changed and only rebuild pages
that link to B in that case.
* Looks like some plugins that use `pagetitle` to format it for display
were not changed to use `nicepagetitle` (for example, rename).
But most of those callers intend to display the page name
as a title, but including the parent directories in the path. (Ie,
"renaming foo/page title to bar/page title" --
you want to know it's moved from foo to bar.) `nicepagetitle` does not
allow doing that since it always takes the `basename`.
* I don't like the name `nicepagetitle`. It's not very descriptive, is it?
And it seems very confusing to choose whether to use the "nice" or original
version. My hope is that adding a second function is unnecessary.
As I understand it, you added a new function for two reasons:
1) It needs the full page name, not basename.
2) `titlepage(pagetitle($page))` reversability.
1) If you look at all the callers
Of `pagetitle` most of them pass a complete page name, not just the
basename. In most cases `pagetitle` is used to display the full name
of the page, including any subdirectory it's in. So why not just make
it consitently be given the full name of the page, with another argument
specifying if we want to get back just the base name.
2) I can't find any code that actually uses the reversability like that.
The value passed to `titlepage` always comes from some external
source. Unless I missed one.
* The use of `File::Spec->rel2abs` is a bit scary.
* Does it really make sense to call `pagetitle` on the meta title
in meta's `nicepagetitle`? What if the meta title is something like
"foo_bar" -- that would be changed to "foo bar".
* parentlinks is changed to use `nicepagetitle(bestlink($page, $path))`.
Won't `bestlink` return "" if the parent page in question does not exist?
* `backlinks()` is changed to add an additional `title` field
to the hash returned, but AFAICS this is not used in the template.
* Shouldn't `Render.pm` use nicepagetitle when getting the title for the
page template? Then meta would not need to override the title in the
`pagetemplate` hook. (Although this would eliminate handling of
`title_overridden` -- but that is little used and would not catch
all the other ways titles can be overridden with this patch anyway.)
> I'm not a reviewer or anything, but can I chime in on changes to pagetitle?
> I don't think having meta-titles in wikilinks and the parentlinks path by
> default is necessarily a good thing. I don't consider the meta-title of a page
> as used in `<title>` to be the same thing as the short title you
> want in those contexts - IMO, the meta-title is the "formal" title of the page,
> enough to identify it with no other context, and frequently too long to be used
> as a link title or a parentlink, whereas the parentlinks title in particular
> should be some abbreviated form that's enough to identify it in context.
> [tbm](http://www.cyrius.com/) expressed a similar opinion when I was discussing
> ikiwiki with him at the weekend.
>
> It's a matter of taste whether wikilinks are "like a parentlink" or "like a
> `<title>`"; I could be persuaded either way on that one.
>
> An example from my site: [this page](http://www.pseudorandom.co.uk/2004/debian/ipsec/)
> is the parent of [this page](http://www.pseudorandom.co.uk/2004/debian/ipsec/wifi/)
> with a title too long to use in the latter's parentlinks; I think the titles of
> both those pages are too long to use as wikilink text too. Similarly, tbm's page
> about [Debian on Orion devices from Buffalo](http://www.cyrius.com/debian/orion/buffalo/)
> can simply be called "Buffalo" in context.
>
> Having a `\[[!meta abbrev="..."]]` that took precedence over title
> in parentlinks and possibly wikilinks might be a good way to fix this? Or if your
> preference goes the other way, perhaps a `\[[!meta longtitle=""]]` could take
> precedence when generating the `<title>` and the title that comes after the
> parentlinks. --[[smcv]]
>> I think you've convinced me. (I had always had some doubt in my mind as
>> to whether using titles in all these other places would make sense.)
>>
>> Instead of meta abbrev, you could have a meta pagename that
>> overrides the page name displayed everywhere (in turn overridden by
>> meta title iff the page's title is being displayed). But is this complexity
>> needed? We have meta redir, so if you want to change the name of a page,
>> you can just rename it, and put in a stub redirection page so links
>> still work.
>>
>> This leaves the [[plugins/contrib/po]] plugin, which really does need
>> a way to change the displayed page name everywhere, and at least a
>> subset of the changes in the meta branch are needed to support that.
>>
>> (This would also get around my concern about inter-page dependency
>> handling, since po contains a workaround for that, and it's probably
>> acceptable to use potentially slow methods to handle this case.)
>> --[[Joey]]

View File

@ -0,0 +1,20 @@
Hi!
How about to replace sparkline-php from Suggests by a better alternative?
I would like to file a RM bug to get it out of archive. Do you have a better alternative for it? PHP has a lot of them..
Thanks
> sparline-php is orphaned *in Debian*. Upstream, is has seen activity as
> recently as 11 months ago.
>
> I don't know of a better alternative. I looked at the perl sparkline
> stuff in CPAN and is was bad enough that the pain of using php from this
> perl program was a better alternative.
>
> Anyway, it works great; maintaining the sparkline-php package in Debian
> would certianly be much less work than finding some alternative and
> rewriting the ikiwiki code to use it, *and* packaging that alternative
> and maintaining it in Debian. So your suggestion doesn't make a lot of
> sense; Debian should just find a maintainer for sparkline-php. --[[Joey]]

View File

@ -0,0 +1,33 @@
On my initial ikiwiki -setup auto.setup, I get the following error:
shortcut plugin will not work without shortcuts.mdwn
/home/turian/utils/etc/ikiwiki/auto.setup: ikiwiki --refresh --setup /home/turian/iki.setup failed at IkiWiki/Setup/Automator.pm line 105.
This is using the latest git pull of ikiwiki.
I am not sure why it is not finding shortcuts.mdwn. -- [[JosephTurian]]
> The error, and the weird paths suggest to me that you
> have installed ikiwiki in a strange way, and it is failing
> to find its basewiki underlay. The `$installdir` is
> hardcoded into IkiWiki.pm at build time, based on the PREFIX
> setting (see README).
>
> If that's not set right, you'll have other problems than just this one,
> so I suggest you check how you installed ikiwiki.
>
> Anyway, I've made the shortcut plugin only warn about this..
> --[[Joey]]
> > I have
> > $installdir="/home/turian/utils/"
> > and the underlay dir is set to:
> > "$installdir/share/ikiwiki/basewiki",
> > which does contain shortcuts.mdwn. So I am not sure why it is not finding it.
> > I am grappling with installing ikiwiki in a user account, and would like to get the directories set up correctly.
> > How can I debug this issue further?
>>>> Why don't you strace it and look at where it's looking for
>>>> shortcuts.mdwn. --[[Joey]]
>>>>>> Hmm, so change the PERL5LIB seemed to fix this. [[Done]].

View File

@ -0,0 +1,10 @@
I have several complaints that users cannot contribute to my ikiwiki instances since they only have OpenID logins that support OpenID2. E.g. Yahoo!'s OpenID only supports 2.0+
This is not the fault of ikiwiki, though the problem lies within the [perl openid consumer](http://packages.qa.debian.org/libn/libnet-openid-consumer-perl.html) in Debian which is a 1.x implementation AFAIK.
I've contacted JanRain who have pointed me to:
* [OpenID4Perl](http://code.sxip.com/openid4perl/)
* Some [work](http://code.sixapart.com/svn/openid/trunk/perl/) by David Recordon
However both Perl OpenID 2.x implementations have not been released and are incomplete implementations. :(

View File

@ -0,0 +1,34 @@
I think there might be an issue in the backlinks calculation in ikiwiki 3.04.
I've just migrated to 3.04. In doing so, the following pagespec
> "log/* and !link(tag/aggregation) and !link(tag/draft) and !*/Discussion"
...started matching pages which contained
> \[\[!template draft\]\]
The page templates/draft.mdwn contains (amongst some markup)
> \[\[!tag draft \]\]
Prior to migration, the pagespec definitely took effect post-transclusion.
An example: <http://jmtd.net/log/too_much_debconf_a_bad_thing/> contains the
template inclusion, which can be seen to have worked due to markup at the
bottom of the page. It even includes a "Tags: draft" link at the bottom.
Strangely, <http://jmtd.net/tag/draft/> does not contain backlinks to pages
which are tagged using the procedure above.
After the first rebuild, it's broken, after a subsequent refresh, it is fixed.
I've reproduced this twice (but assumed I'd done something wrong the first
time, so went ahead and migrated live, spamming planet debian in the process
:(). I will try and put together a testcase. -- [[users/Jon]], 2009/02/17
> Looks like the same problem as
> [[cannot_reliably_use_meta_in_template]]. AFAIK, this has never worked
> reliably, although the linked page has a simple, though potentially
> expensive fix. --[[Joey]]
> fix made, [[done]] --[[Joey]]

View File

@ -1,8 +1,11 @@
[[!meta title="CSS Market"]]
User contributed stylesheet files for ikiwiki. Feel free to add your own
stylesheets here. (Upload as wiki pages; wiki gnomes will convert them to css
files..)
User contributed stylesheet files for ikiwiki. Unless otherwise noted,
these style sheets can be installed by copying them into your wiki's source
dir with a filename of `local.css`.
Feel free to add your own stylesheets here. (Upload as wiki pages; wiki
gnomes will convert them to css files..)
* **[[css_market/zack.css]]**, contributed by [[StefanoZacchiroli]],
customized mostly for *blogging purposes*, can be seen in action on
@ -51,6 +54,10 @@ files..)
* **[contraste.css][4]**, contributed by [[Blanko]]. Can be seen on [Contraste Demo][5]. Local.css and templates available [here][6].
* **[[css_market/actiontabs.css]]**, contributed by [[svend]]. This style sheet displays
the action list (Edit, RecentChanges, etc.) as tabs.
[[!meta stylesheet="actiontabs"]]
If your web browser allows selecting between multiple stylesheets, this
page can be viewed using many of the stylesheets above. For example, if
using Epiphany with the Select Stylesheet extension enabled, use View ->

View File

@ -0,0 +1,122 @@
/* ikiwiki local style sheet */
/* Add local styling here, instead of modifying style.css. */
a {
text-decoration: none;
color: #005a9c;
}
a:hover {
text-decoration: underline;
}
hr {
border-style: none;
background-color: #999;
height: 1px;
}
code, pre {
background: #eee;
}
pre {
padding: .5em;
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
color: black;
background: white;
}
.pageheader {
margin: 0;
padding: 1em 2em 0 2em;
background: #eee;
border-color: #999;
border-style: none none solid none;
border-width: 1px;
}
.header {
font-size: 100%;
font-weight: normal;
}
.title {
display: block;
margin-top: .2em;
font: 140% sans-serif;
text-transform: capitalize;
}
.actions {
text-align: right;
padding: 0;
}
#content, #comments, #footer {
margin: 1em 2em;
}
#pageinfo {
border-color: #999;
}
.inlinepage {
margin: .4em 0;
padding: .4em 0;
border-style: none;
border-top: 1px solid #aaa;
}
.inlineheader {
font-size: 120%;
font-weight: normal;
}
h1 { font: 120% sans-serif }
h2 { font: bold 100% sans-serif }
h3 { font: italic 100% sans-serif }
h4, h5, h6 { font: small-caps 100% sans-serif }
/* Smaller headings for inline pages */
.inlinepage h1 { font-size: 110% }
.inlinepage h2 { font-size: 100% }
.inlinepage h3 { font-size: 100% }
.pageheader .actions ul {
border-style: none
}
.actions ul {
font-size: 75%;
padding: 0;
border-style: none;
}
.actions ul li a {
text-decoration: none;
}
.actions ul li {
margin: 0;
padding: .1em .5em 0 .5em;
background: white;
border-color: #999;
border-style: solid solid none solid;
border-width: 1px;
}
div.recentchanges {
border-style: none;
}
.pagecloud {
width: auto;
}

View File

@ -10,12 +10,7 @@ Installation steps and requirements are listed on the [[install]] page.
## packages
To install with apt, if using Debian (since 4.0), or Ubuntu (since 6.10):
[[!template id=note text="""
Note that Debian 4.0 and especially Ubuntu 6.10 contain older versions of
ikiwiki, there have been lots of enhancements and bug fixes since those
versions.
"""]]
To install with apt, if using Debian or Ubuntu:
apt-get install ikiwiki

View File

@ -1,7 +1,7 @@
FooBar is an amazing example program that does not exist. Use it for all
your example program needs. This is its wiki.
* [[download]]
* **[[download]]**
* [[news]]
* [[documentation|doc]]
* [[bugs]]

View File

@ -0,0 +1,58 @@
How do I setup an old ikiwiki repository on a new system?
I have a git repository from an old ikiwiki system.
I reformatted that hard drive, but saved the repository.
I copied it the repository to my new system, which is now the "master" host.
I installed ikiwiki on the new system.
How do I set up an ikiwiki system using a pre-existing repository (instead of creating a new one)? --[[JosephTurian]]
> Well, if you have:
> * A git repository of the wiki
> * A setup file for the wiki
>
> Then you should:
>
> 1. Manually set up a bare git repository, and push
> your backed up repository to it.
> 2. `git clone` from the bare git repository to
> recreate the ikiwiki srcdir
> 3. `git clone` from the bare git repository a second time,
> to create a checkout you can manually edit (optional)
> 4. run `ikiwiki --getctime --setup your.setup`
> The getctime will ensure page creation times are accurate
> by putting the info out of the git history,
> and only needs to be done once.
>
> If you preserved your repository, but not the setup file,
> the easiest way to make one is probably to run
> `ikiwiki -dumpsetup` and edit the setup file. --[[Joey]]
> > I get the following errors after running ikiwiki setup:
shortcut plugin will not work without shortcuts.mdwn
shortcut plugin will not work without shortcuts.mdwn
successfully generated /home/turian/public_html/iki/ikiwiki.cgi
shortcut plugin will not work without shortcuts.mdwn
successfully generated /home/turian/repos/iki.git/hooks/post-update
Can't stat /usr/share/ikiwiki/basewiki/../javascript: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Plugin/autoindex.pm line 60
Can't stat /usr/share/ikiwiki/basewiki/../smiley: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Plugin/autoindex.pm line 60
Can't stat /usr/share/ikiwiki/basewiki: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Plugin/autoindex.pm line 60
Can't stat /usr/share/ikiwiki/basewiki/../javascript: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Render.pm line 320
Can't stat /usr/share/ikiwiki/basewiki/../smiley: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Render.pm line 320
Can't stat /usr/share/ikiwiki/basewiki: No such file or directory
at /home/turian/utils//lib/perl5/site_perl/5.8.8//IkiWiki/Render.pm line 320
internal error: smileys.mdwn cannot be found in /home/turian/iki or underlay
> > How do I resolve these errors? I have my PERL5LIB location set correctly.
>>> Well, that's unrelated to the original question, but
>>> I guess you should set `underlaydir` in your setup file to
>>> point to whereever you have installed the basewiki directory.
>>> --[[Joey]]

View File

@ -15,3 +15,7 @@ Thanks.
I have installed locales-all and locale -a shows that zh_CN.UTF-8 is installed(there is no /etc/local.gen file though). then I enabled this line "locale => 'zh_CN.UTF-8'" in my wiki setup and -setup again. but that generated lots error messages "Missing constant domain at (eval 30) line 3"
sorry being a n00b on this thing what else can I do?
> See [[bugs/Missing_constant_domain_at_IkiWiki.pm_line_842]].
> Looks like you need to upgrade to a newer version of
> [[!cpan Locale::gettext]] --[[Joey]]

View File

@ -0,0 +1,12 @@
My ikiwiki setup file configed like:
usedirs => 0,
indexpages => 1,
I create a directory and some .mdwn source file /Whatis/index.mdwn and /Whatis/OSS.mdwn . The html file ikiwiki generated is
/Whatis/index.html and /Whatis/OSS.html .
But in the page [OSS.html](http://atoz.org.cn/Whatis/OSS.html) , the auto generated link (on the page top)
to “Whatis” is /Whatis.html file , not to /Whatis/index.html. So the link to “Whatis” is fail .
Is it a bug , and how can I do for that ?

View File

@ -37,6 +37,7 @@ into [[Joey]]'s working tree. This is recommended. :-)
* [[intrigeri]] `git://gaffer.ptitcanardnoir.org/ikiwiki.git`
* [[gmcmanus]] `git://github.com/gmcmanus/ikiwiki.git`
* [[jelmer]] `git://git.samba.org/jelmer/ikiwiki.git`
* [[hendry]] `git://webconverger.org/git/ikiwiki`
## branches

View File

@ -139,6 +139,15 @@ Supported fields:
pages unchanged and avoid_flooding_aggregators
(see [[!iki tips/howto_avoid_flooding_aggregators]]).
* updated
Specifies a fake modification time for a page, to be output into RSS and
Atom feeds. This is useful to avoid flooding aggregators that sort by
modification time, like Planet: for instance, when editing an old blog post
to add tags, you could set `updated` to be one second later than the original
value. The date/time can be given in any format that
[[!cpan TimeDate]] can understand, just like the `date` field.
If the field is not one of the above predefined fields, the metadata will be
written to the generated html page as a &lt;meta&gt; header. However, this
won't be allowed if the [[!iki plugins/htmlscrubber desc=htmlscrubber]] plugin is enabled,

View File

@ -25,6 +25,7 @@ match all pages except for Discussion pages and the SandBox:
Some more elaborate limits can be added to what matches using these functions:
* "`link(page)`" - match only pages that link to a given page (or glob)
* "`tagged(tag)`" - match pages that are tagged or link to the given tag (or glob)
* "`backlink(page)`" - match only pages that a given page links to
* "`creation_month(month)`" - match only pages created on the given month
* "`creation_day(mday)`" - or day of the month
@ -65,7 +66,7 @@ More complex expressions can also be created, by using parentheses for
grouping. For example, to match pages in a blog that are tagged with either
of two tags, use:
blog/* and (link(tag/foo) or link(tag/bar))
blog/* and (tagged(foo) or tagged(bar))
Note that page names in PageSpecs are matched against the absolute
filenames of the pages in the wiki, so a pagespec "foo" used on page

View File

@ -1,5 +1,5 @@
Projects
========
Projects & Organizations
========================
* [This wiki](http://ikiwiki.info) (of course!)
* [Planet Debian upstream](http://updo.debian.net/)
@ -40,10 +40,15 @@ Projects
* [The Walden Effect](http://www.waldeneffect.org/)
* The [Fortran Wiki](http://fortranwiki.org/)
* [Monotone](http://monotone.ca/wiki/FrontPage/)
* The support pages for [Trinity Centre for High Performance Computing](http://www.tchpc.tcd.ie/support/)
* [St Hugh of Lincoln Primary School in Surrey](http://hugh.vm.bytemark.co.uk/)
* [Pigro Network](http://www.pigro.net) is running a hg based ikiwiki. (And provides ikiwiki hosting for $10/m.)
* [Cosin Homepage](http://cosin.ch) uses an Ikiwiki with a subversion repository.
Personal sites and blogs
========================
* [Skirv's Wiki](http://wiki.killfile.org) - formerly Skirv's Homepage
* [[Joey]]'s [homepage](http://kitenet.net/~joey/), including his weblog
* [Kyle's MacLea Genealogy wiki](http://kitenet.net/~kyle/family/wiki) and [Livingstone and MacLea Emigration Registry](http://kitenet.net/~kyle/family/registry)
* [Ulrik's personal web page](http://kaizer.se/wiki/)
@ -107,11 +112,12 @@ Personal sites and blogs
* [[Adam_Trickett|ajt]]'s home intranet/sanbox system ([Internet site & blog](http://www.iredale.net/) -- not ikiwiki yet)
* [[Simon_McVittie|smcv]]'s [website](http://www.pseudorandom.co.uk/) and
[blog](http://smcv.pseudorandom.co.uk/)
* Svend's [website](http://www.ciffer.net/~svend/) and [blog](http://www.ciffer.net/~svend/blog/)
* [muammar's site](http://muammar.me)
* [Per Bothner's blog](http://per.bothner.com/blog/)
* [Bernd Zeimetz (bzed)](http://bzed.de/)
Schools
=======
* [St Hugh of Lincoln Primary School in Surrey](http://hugh.vm.bytemark.co.uk/)
Please feel free to add your own ikiwiki site!
See also: [Debian ikiwiki popcon graph](http://popcon.debian.org/~igloo/popcon-graphs/index.php?packages=ikiwiki)

View File

@ -10,4 +10,4 @@ log back in, try out the OpenID signup process if you don't already have an
OpenID, and see how OpenID works for you. And let me know your feelings about
making such a switch. --[[Joey]]
[[!poll 59 "Accept only OpenID for logins" 18 "Accept only password logins" 35 "Accept both"]]
[[!poll 60 "Accept only OpenID for logins" 18 "Accept only password logins" 35 "Accept both"]]

View File

@ -1,24 +0,0 @@
ikiwiki 3.02 released with [[!toggle text="these changes"]]
[[!toggleable text="""
* blogspam: New plugin, adding spam filtering for page editing / comment
posting using the BlogSpam.net API.
* Add auto-blog.setup, which will set up an ikiwiki instance tuned for use
in blogging.
* checkcontent: New hook, can be used to implement arbitrary content
filters, including spam filters.
* table: Fix misparsed links in external files.
* table: Find links in external files in scan pass.
* rename: Show full names of affected pages.
* comments: Fix cache avoidance hack.
* repolist: New plugin to support the rel=vcs-* microformat.
* goodstuff: Include repolist by default. (But it does nothing until
configured with the repository locations.)
* comments: Add support for removing comments via web interface. (smcv)
* Consistently allow use of relative paths in all PageSpecs
that take a page name parameter. Previously, match\_created\_before(),
match\_created\_after(), match\_sourcepage(), and match\_destpage()
did not support that, and the docs were not clear.
* pinger: Get whole url, don't just head, avoids problems on
the nostromo web server.
* Recommend libterm-readline-gnu-perl since that makes auto.setup
behave better."""]]

View File

@ -0,0 +1,3 @@
ikiwiki 3.06 released with [[!toggle text="these changes"]]
[[!toggleable text="""
* Setup automator: Fix bug in password comparison. Closes: #[517654](http://bugs.debian.org/517654)"""]]

View File

@ -0,0 +1,20 @@
[[!template id=plugin name=404 author="[[Simon_McVittie|smcv]]"]]
[[!tag type/useful]]
This plugin lets you use the IkiWiki CGI script as an Apache 404 handler,
to give the behaviour of various other wiki engines where visiting a
nonexistent page provides you with a link to create it.
To achieve this, put something like this in the wiki's Apache configuration
file:
ErrorDocument 404 /ikiwiki.cgi
(The path here needs to be whatever the path is to the ikiwiki.cgi from
the root of your web server.)
Or put something like this in the wiki's Lighttpd (>=1.4.17) configuration file:
server.error-handler-404 = "/ikiwiki.cgi"

View File

@ -20,7 +20,7 @@ template variable somebody wants to use.
--[[bma]]
Copyright and license values are not "template values", they are values
tracked by the meta plugin, and that various code compares and uses to fill
tracked by the [[meta]] plugin, and that various code compares and uses to fill
out the templates. Something like varioki cannot do that. --[[Joey]]
Somewhat more detailed usage documentation would be appreciated. I tried to setup

View File

@ -2,7 +2,7 @@
This plugin would create a nice looking gallery of the images. It has been build over the img plugin in Ikiwiki
SVN repository of plugin is located at <http://ned.snow-crash.org:8080/svn/ikiwiki-gallery>
GIT repo of the plugin is located at <http://github.com/joeyh/ikiwiki/tree/gallery>
USAGE :

View File

@ -202,6 +202,8 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
> I've looked it over and updated my branch with some (untested)
> changes.
>
>> I've merged your changes into my branch. Only one was buggy.
>
> Sorry, I'd forgotten about your cansave hook.. sorry for the duplicate
> work there.
>
@ -212,10 +214,8 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
> 3.x API, which I've promised not to do, so needs to be avoided
> somehow. (Sorry, I guess I dropped the ball on not getting this
> API change in before cutting 3.0..)
>
>> I'm discussing the solutions we now have on
>> [[todo/need_global_renamepage_hook]], as the solution I implemented
>> was initially agreed on there.
>>
>> Fixed, see [[todo/need_global_renamepage_hook]].
>>
> * I don't understand the parentlinks code change and need to figure it
> out. Can you explain what is going on there?
@ -235,7 +235,7 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
> * `skeleton.pm.example`'s canrename needs fixing to use either
> the current or my suggested parameters.
>>
>> I'll do both.
>> Done.
>>
> * I don't like the exporting of `%backlinks` and `$backlinks_calculated`
> (the latter is exported but not used).
@ -245,7 +245,25 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
>> the subtleties of `our` use, and perldoc does not help me a lot.
>> IIRC, I actually did not use `our` to "export" these variables, but
>> rather to have them shared between `Render.pm` uses.
>>
>>
>>> My wording was unclear, I meant exposing. --[[Joey]]
>>>
>>>> I guess I still don't know Perl's `our` enough to understand clearly.
>>>> No matter whether these variables are declared with `my` or `our`,
>>>> any plugin can `use IkiWiki::Render` and then access
>>>> `$IkiWiki::backlinks`, as already does e.g. the pagestat plugin.
>>>> So I guess your problem is not with letting plugins use these
>>>> variables, but with them being visible for every piece of
>>>> (possibly external) code called from `Render.pm`. Am I right?
>>>> If I understand clearly, using a brace block to lexically enclose
>>>> these two `our` declarations, alongside with the `calculate_backlinks`
>>>> and `backlinks` subs definitions, would be a proper solution, wouldn't
>>>> it? --[[intrigeri]]
>>>>
>>>>> No, %backlinks and the backlinks() function are not the same thing.
>>>>> The variable is lexically scoped; only accessible from inside
>>>>> `Render.pm` --[[Joey]]
>>>>
> * What is this `IkiWiki::nicepagetitle` and why are you
> injecting it into that namespace when only your module uses it?
> Actually, I can't even find a caller of it in your module.
@ -253,7 +271,25 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
>> I guess you should have a look to my `meta` branch and to
>> [[bugs/pagetitle_function_does_not_respect_meta_titles]] in order
>> to understand this :)
>>
>>
>>> It would probably be good if I could merge this branch without
>>> having to worry about also immediatly merging that one. --[[Joey]]
>>>
>>>> I removed all dependencies on my `meta` branch from the `po` one.
>>>> This implied removing the `po_translation_status_in_links` and
>>>> `po_strictly_refresh_backlinks` features, and every link text is now
>>>> displayed in the master language. I believe the removed features really
>>>> enhance user experience of a translatable wiki, that's why I was
>>>> initially supposing the `meta` branch would be merged first.
>>>> IMHO, we'll need to come back to this quite soon after `po` is merged.
>>>> --[[intrigeri]]
>>>>
>>>> Maybe you should keep those features in a meta-po branch?
>>>> I did a cursory review of your meta last night, have some issues with it,
>>>> but this page isn't the place for a detailed review. --[[Joey]]
>>>>
>>>>> Done. --[[intrigeri]]
>>>
> * I'm very fearful of the `add_depends` in `postscan`.
> Does this make every page depend on every page that links
> to it? Won't this absurdly bloat the dependency pagespecs
@ -269,15 +305,17 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
>> enabled the option to display translation status in links, this
>> maintains the translation status up-to-date in backlinks. Same when
>> using meta title to make the pages titles translatable. It does
>> help having a nice and consistent translated wiki, but as it hurts
>> performance, I'm proposing to turn it into an option.
>> help having a nice and consistent translated wiki, but as it can
>> also involve problems, I just turned it into an option.
>>
>>> This has been completely removed for now due to the removal of
>>> the dependency on my `meta` branch. --[[intrigeri]]
>>
> * The po4a Suggests should be versioned to the first version
> that can be used safely, and that version documented in
> `plugins/po.mdwn`.
>>
>> Sure. I was waiting for the necessary version to be actually
>> released, but we can guess it will be 0.35.
>> Done.
>>
>> --[[intrigeri]]
>

View File

@ -10,12 +10,9 @@ where foo and bar are the (source-supported) languages you want to
highlight
### Issues
- I would like to have a link to the raw source; using will_render() and then copying the file should work.
- I would like to have a link to the raw source; using will_render() and then copying the file should work.
- the common case of foo.c and foo.h breaks
because they both generate page working/dir/foo.
It looks to me like ikiwiki is hardcoded to strip the extension in `pagename()` (IkiWiki.pm).
This problem with sourcehighlight needs to be fixed before it is very useful.
> You might also like to look at the [[todo/source_link]] todo. -- [[Will]]
- Is there a way to configure the colors used by source-highlight (other than editing the globally installed "default.style" file)? It would help if I could pass the command arbitrary command-line arguments; then I could configure which config file it's supposed to use. For instance, I'm not a fan of hard-coding the colors into the HTML output. IMHO, css-style formatting should be preferred. All that can be set via the command line ... --Peter
@ -23,5 +20,11 @@ This problem with sourcehighlight needs to be fixed before it is very useful.
Note that [[Will]] wrote a plugin that uses source-highlight also. It's
available
[here|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]].
[[here|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]].
--[[Joey]]
To be honest, [[Will]]'s version of this looks more polished. I will try his
plugin and see if it can just replace mine. --[[DavidBremner]]
*Updated* Now uses keepextension so multiple extensions should be OK

View File

@ -1,58 +0,0 @@
[[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]]
[[!tag type/useful]]
This plugin adds an `add_underlays` option to the `.setup` file.
Its value is a list of underlay directories whose content is added to the wiki.
Multiple underlays are normally set up automatically by other plugins (for
instance, the images used by the [[plugins/smiley]] plugin), but they can also be
used as a way to pull in external files that you don't want in revision control,
like photos or software releases.
Directories in `add_underlays` should usually be absolute. If relative, they're
interpreted as relative to the parent directory of the basewiki underlay, which
is probably not particularly useful in this context.
Please feel free to add this plugin to ikiwiki if it seems like a good
thing to have. See the 'underlay' branch in my git repository.
#!/usr/bin/perl
package IkiWiki::Plugin::underlay;
# Copyright © 2008 Simon McVittie <http://smcv.pseudorandom.co.uk/>
# Licensed under the GNU GPL, version 2, or any later version published by the
# Free Software Foundation
use warnings;
use strict;
use IkiWiki 2.00;
sub import {
hook(type => "getsetup", id => "underlay", call => \&getsetup);
hook(type => "checkconfig", id => "underlay", call => \&checkconfig);
}
sub getsetup () {
return
plugin => {
safe => 0,
rebuild => undef,
},
add_underlays => {
type => "string",
default => [],
description => "extra underlay directories to add",
advanced => 1,
safe => 0,
rebuild => 1,
},
}
sub checkconfig () {
return unless exists $config{add_underlays};
foreach my $dir (@{$config{add_underlays}}) {
add_underlay($dir);
}
}
1;

View File

@ -13,4 +13,10 @@ wiki markup formats, so should be fairly easy to guess at. There is also a
Links are standard [[WikiLinks|ikiwiki/WikiLink]]. Links and
[[directives|ikiwiki/directive]] inside `{{{ }}}` blocks are still expanded,
since this happens before the creole format is processed.
since this happens before the creole format is processed. (You need to escape
them manually, via \\\[[directives]], the ~ escaping of creole doesn't work on
this.)
The standard ikiwiki [[WikiLinks|ikiwiki/WikiLink]] is almost the same as Creole link, except that creole uses \[[pagename|description]] while ikiwiki uses \[[description|pagename]].

View File

@ -8,4 +8,8 @@ I've installed Text::WikiCreole 0.05 and enabled the plugin, but I get an error
>> I've added the patch to pkgsrc as well. Thanks. --[[schmonz]]
>> Currently the creole plugin is included in ikiwiki but the ikiwiki deb (3.0.3) doesn't suggests libtext-wikicreole-perl. Why? --[[weakish]]
>>> forgot, done now --[[Joey]]
I'm moving over a really stinkingly old UseMod and creole seems the nearest match. I've worked out that Bare /Subpage links need to become \[\[Subpage\]\], and Top/Sub links need to be \[\[Top/Sub\]\] (or \[\[Top/Sub|Top/Sub\]\], to display in exactly the same way), but I'm stuck on generic hyperlinks. The creole cheat sheet says I should be able to do \[\[http://url.path/foo|LinkText\]\], but that comes out as a link to create the "linktext" page, and Markdown-style \[Link Text\](http://url.path/foo) just gets rendered as is. Any suggestions? --[[schmonz]]

View File

@ -0,0 +1,6 @@
This plugin uses the googleform.tmpl
which produces valid HTML but invalid XHTML.
This is not very good since the default ikiwiki
templates produce XHTML instead of HTML.
> Fixed, thanks for the patch! --[[Joey]]

View File

@ -0,0 +1,10 @@
[[!template id=plugin name=goto author="[[Simon_McVittie|smcv]]"]]
[[!tag type/useful]]
This plugin adds a `do=goto` mode for the IkiWiki CGI script. It's mainly
for internal use by the [[404]], [[comments]] and [[recentchanges]]
plugins, which enable it automatically.
With this plugin enabled you can link to `ikiwiki.cgi?do=goto&page=some/where`
to make a link that will redirect to the page `/some/where` if it exists, or
offer a link to create it if it doesn't.

View File

@ -0,0 +1,7 @@
Unlike other format, ikiwiki is somehow depends
on mdwn, since the underlay dir
is written in mdwn. If you want to disable mdwn,
you need to overwrite the underlay
dir (set underlaydir in ikiwiki.setup
to your own underlay dir or replace underlay pages
in your $SRC).

View File

@ -9,3 +9,59 @@ the *Preferences -- Subscriptions*. --[[tschwinge]]
>> Aha, then the problem is Firefox, which is automatically filling the
>> *Password* field with its previous value, but not filling the
>> *Confirm Password* one. --[[tschwinge]]
## easy access to the userdb for apache auth?
My use case is:
* restricted ikiwiki
* read/edit only allowed from the local network (done with apache restrictions)
* edit only for people authenticated (done with vanilla ikiwiki passwordauth)
I would like to allow people to read/edit the wiki from outside of the
local network, if and only if they already have an ikiwiki account.
[[httpauth]] doesn't fit since it doesn't allow anonymous local users
to create their own account. I want a single, local, simple auth
database.
My (naïve?) idea would be:
* keep the [[passwordauth]] system
* provide a way for Apache to use the userdb for authentication if
people want to connect from outside
I looked at the various auth modules for apache2. It seems that none
can use a "perl Storable data" file. So, I think some solutions could
be:
* use a sqlite database instead of a perl Storable file
* can be used with
[mod_auth_dbd](http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html)
* requires a change in ikiwiki module [[passwordauth]]
* use an external program to read the userdb and talk with
[mod_auth_external](http://unixpapa.com/mod_auth_external.html)
* requires the maintainance of this external auth proxy over ikiwiki
userdb format changes
* (I don't know perl)
* include this wrapper in ikiwiki
* something like `ikiwiki --auth user:pass:userdb` check the
`user:pass` pair in `userdb` and returns an Accept/Reject flag to
Apache
* requires a change in ikiwiki core
* still requires
[mod_auth_external](http://unixpapa.com/mod_auth_external.html)
* do it with Apache perl sections
* (I don't know perl)
Any opinion/suggestion/solution to this is welcome and appreciated.
--
[[NicolasLimare]]
For a similar use case, I've been intending to implement
[[todo/httpauth_feature_parity_with_passwordauth]], but your idea may
actually be the way to go. IMHO, the Perl sections idea is the
easiest to setup, but on the long run, I'd prefer ikiwiki to optionnally
use a userdb storage backend supported at least by Apache and lighttpd.
--[[intrigeri]]

View File

@ -1 +1,12 @@
The plugin depends on [[mdwn]]. If you have
disabled [[mdwn]], to get [[shortcut]] work, you need
commit in a shortcuts.ext (ext is `rcs|creole|html|txt|etc`),
and edit/patch [[shortcut]].
Maybe use the `default_pageext` is better than hardcode .mdwn?
--[[weakish]]
> done, it will use `default_pageext` now --[[Joey]]

View File

@ -5,6 +5,9 @@ This plugin provides the [[ikiwiki/directive/tag]] and
[[ikiwiki/directive/taglink]] [[directives|ikiwiki/directive]].
These directives allow tagging pages.
It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to
match pages that are tagged with a specific tag.
[[!if test="enabled(tag)" then="""
This wiki has the tag plugin enabled, so you'll see a note below that this
page is tagged with the "tags" tag.

View File

@ -22,3 +22,9 @@ AOLMODE=true echo "I too would really like this feature, which would make cgi fr
better" --[[DavidBremner]]
Please make the actual text used a template some way or another. I may want `map` instead of `inline`. --[[madduck]]
See [[todo/auto-create tag pages according to a template]]
-- Jeremy Schultz <jeremy.schultz@uleth.ca>

View File

@ -1 +0,0 @@
.

View File

@ -0,0 +1,14 @@
[[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]]
[[!tag type/useful]]
This plugin adds an `add_underlays` option to the `.setup` file.
Its value is a list of underlay directories whose content is added to the wiki.
Multiple underlays are normally set up automatically by other plugins (for
instance, the images used by the [[plugins/smiley]] plugin), but they can also be
used as a way to pull in external files that you don't want in revision control,
like photos or software releases.
Directories in `add_underlays` should usually be absolute. If relative, they're
interpreted as relative to the parent directory of the basewiki underlay, which
is probably not particularly useful in this context.

View File

@ -107,7 +107,7 @@ adding or removing files from it.
This hook is called early in the process of building the wiki, and is used
as a first pass scan of the page, to collect metadata about the page. It's
mostly used to scan the page for WikiLinks, and add them to `%links`.
mostly used to scan the page for [[WikiLinks|ikiwiki/WikiLink]], and add them to `%links`.
Present in IkiWiki 2.40 and later.
The function is passed named parameters "page" and "content". Its return
@ -168,7 +168,7 @@ htmlize the page) along with the rest of the page.
hook(type => "linkify", id => "foo", call => \&linkify);
This hook is called to convert [[WikiLinks|WikiLink]] on the page into html
This hook is called to convert [[WikiLinks|ikiwiki/WikiLink]] on the page into html
links. The function is passed named parameters "page", "destpage", and
"content". It should return the linkified content. Present in IkiWiki 2.40
and later.
@ -189,9 +189,14 @@ The function is passed named parameters: "page" and "content" and should
return the htmlized content.
If `hook` is passed an optional "keepextension" parameter, set to a true
value, then this extension will not be stripped from the source filename when
value, then the extension will not be stripped from the source filename when
generating the page.
If `hook` is passed an optional "noextension" parameter, set to a true
value, then the id parameter specifies not a filename extension, but
a whole filename that can be htmlized. This is useful for files
like `Makefile` that have no extension.
### pagetemplate
hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);
@ -470,7 +475,7 @@ describes the plugin as a whole. For example:
* `example` can be set to an example value.
* `description` is a short description of the option.
* `link` is a link to further information about the option. This can either
be a wikilink, or an url.
be a [[ikiwiki/WikiLink]], or an url.
* `advanced` can be set to true if the option is more suitable for advanced
users.
* `safe` should be false if the option should not be displayed in unsafe
@ -665,6 +670,16 @@ A failure to write the file will result in it dying with an error.
If the destination directory doesn't exist, it will first be created.
The filename and directory are separate parameters because of
some security checks done to avoid symlink attacks. Before writing a file,
it checks to make sure there's not a symlink with its name, to avoid
following the symlink. If the filename parameter includes a subdirectory
to put the file in, it also checks if that subdirectory is a symlink, etc.
The directory parameter, however, is not checked for symlinks. So,
generally the directory parameter is a trusted toplevel directory like
the srcdir or destdir, and any subdirectories of this are included in the
filename parameter.
#### `will_render($$)`
Given a page name and a destination file name (not including the base
@ -706,7 +721,7 @@ a wiki page name.
#### `linkpage($)`
This converts text that could have been entered by the user as a
[[WikiLink]] into a wiki page name.
[[ikiwiki/WikiLink]] into a wiki page name.
#### `srcfile($;$)`
@ -771,7 +786,7 @@ are collected together to form the RecentChanges page, for example.
To make an internal use page, register a filename extension that starts
with "_". Internal use pages cannot be edited with the web interface,
generally shouldn't contain wikilinks or preprocessor directives (use
generally shouldn't contain [[WikiLinks|ikiwiki/WikiLink]] or preprocessor directives (use
either on them with extreme caution), and are not matched by regular
PageSpecs glob patterns, but instead only by a special `internal()`
[[ikiwiki/PageSpec]].
@ -940,7 +955,7 @@ or wrap one of the functions.
For example, your plugin might want to override `displaytime`, to change
the html markup used when displaying a date. Or it might want to override
`IkiWiki::formattime`, to change how a date is formatted. Or perhaps you
want to override `bestlink` and change how ikiwiki deals with WikiLinks.
want to override `bestlink` and change how ikiwiki deals with [[WikiLinks|ikiwiki/WikiLink]].
By venturing into this territory, your plugin is becoming tightly tied to
ikiwiki's internals. And it might break if those internals change. But

View File

@ -1,7 +1,9 @@
This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version ]]).
----
test
misc test
test more test
[[中文显示]]
Here's a paragraph.

View File

@ -171,11 +171,12 @@ about using the git repositories.
Once your wiki is checked in to the revision control system, you should
configure ikiwiki to use revision control. Edit your ikiwiki.setup, set
`rcs` to the the revision control system you chose to use. Be sure to set
`svnrepo` to the directory for your repository, if using subversion.
Uncomment the configuration for the wrapper for your revision control
system, and configure the wrapper path appropriately (for Git, it should be
the path to `hooks/post-update` inside the bare git repository).
`rcs` to the the revision control system you chose to use. Be careful,
you may need to use the 'fullname'. For example, 'hg' doesn't work, you
should use mercurial. Be sure to set `svnrepo` to the directory for your
repository, if using subversion. Uncomment the configuration for the wrapper
for your revision control system, and configure the wrapper path appropriately
(for Git, it should be the path to `hooks/post-update` inside the bare git repository).
Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
Now you should be able to edit files in $SRCDIR, and use your revision

View File

@ -149,3 +149,19 @@ But I don't get an edit link on my pages? What am I doing wrong?
> Assuming you don't have the editpage plugin disabled, all you should need
> to so is re-run `ikiwiki -setup` with the above config and it should
> rebuild your wiki and add the edit links to pages. --[[Joey]]
----
I setup ikiwiki on a fedora 10 machine and I am using apache as my http server. Faced a few difficulties while setting it up as the default setup program left some suid files and group writeable directories on the system. It took some time to get it working and documented what I did at http://flyingtux.blogspot.com/2009/03/installing-ikiwiki.html. Thought it might be useful to someone here. (The version installed is 2.72)
> ikiwiki makes wrappers suid by default, because this ensures that when
> the ikiwiki.cgi is run by your web server, it runs as the user who owns
> your wiki, and can thus write to it. ikiwiki is designed to run securely
> suid. If your webserver uses some
> mechanism to run the ikiwiki.cgi as the user who owns it, without the
> suid bit being set, you *could* modify `cgi_wrappermode` in your setup
> file to drop the suid bit.
>
> ikiwiki respects the umask, so if your umask is one that causes things to
> be group writable, they will by. If you want to override that, there is
> also a `umask ` setting in your setup file. --[[Joey]]

View File

@ -26,6 +26,13 @@ configuration changes should work anywhere.
Or, if you've put it in a `~/public_html`, edit
`/etc/apache2/mods-available/userdir.conf`.
* You may also want to enable the [[plugins/404]] plugin.
To make apache use it, the apache config file will need a further
modification to make it use ikiwiki's CGI as the apache 404 handler.
Something like this, with the path adjusted to where you've put the CGI:
ErrorDocument 404 /cgi-bin/ikiwiki.cgi
## lighttpd
Here is how to enable cgi on [lighttpd](http://www.lighttpd.net/) and

View File

@ -1,5 +1,5 @@
Here's how to set up a static wiki or blog using ikiwiki with no hosting
feeds. Everything is hosted on github, both the git repository and the web
fees. Everything is hosted on github, both the git repository and the web
site. Your laptop is used to generate and publish changes to it.
This is possible because github now supports

View File

@ -1,27 +1,27 @@
If you have a [[blog]] that is aggregated, either on a site like Planet
Debian, or just through user subscriptions, one common problem is that
changes to the guids of items in the blog can "flood" the aggregator,
changes to the guids of items in the blog can “flood” the aggregator,
causing all recent blog entries to be posted to the top of it.
This can happen in a lot of situations:
* Perhaps you've just switched to ikiwiki from some other blog engine and
* Perhaps youve just switched to ikiwiki from some other blog engine and
imported your data.
* Perhaps you've turned on the `usedirs` setting, which changes all the
* Perhaps youve turned on the `usedirs` setting, which changes all the
urls in your wiki. Even if you set up
[[redirections|redirections_for_usedirs]] for the old urls, you still face
the issue of flooding aggregators.
* Perhaps you've just moved stuff around in your wiki.
* Perhaps youve just moved stuff around in your wiki.
To avoid annoying readers in these situations, it's a good idea to remove
any existing items from your blog's news feed. That way only new items will
To avoid annoying readers in these situations, its a good idea to remove
any existing items from your blogs news feed. That way only new items will
show up in the aggregator. The best way to do this is to add a `feedpages`
parameter to the `inline` directive for your blog, with a condition such as:
feedpages=created_after(blog/posts/old_post)
Where "old_post" is the name of the last post you made to the blog before
making the change. This will limit the feed to only newer posts, while stil
Where “old_post” is the name of the last post you made to the blog before
making the change. This will limit the feed to only newer posts, while still
displaying the old posts in the blog page.
Alternatively, you can add the [[plugins/meta]] guid directives to pages,

View File

@ -27,3 +27,5 @@ A demo is at <http://www.attacklab.net/showdown-gui.html>
>>> be necessary to insert some sort of placeholder, perhaps by outputting
>>> the text in monospace form w/ a lighter font to denote that it won't
>>> directly be shown in the page... -- [[harningt]]
>>>>> We have a wmd plugin now. --[[Joey]]

View File

@ -46,3 +46,9 @@ Patch:
>> I do have the editpage plugin disabled for the public static wiki, but
>> the link still appears on the site. I want to keep the cgi on, so that
>> the site is still searchable. --[[puck]]
>>> For me, disabling the editpage plugin does make the "Edit" link
>>> disappear (this is with 3.03) but as far as I can tell, "Preferences"
>>> is not controlled by any plugin. It would be nice if it were; I am
>>> trying to achieve a configuration where the only action supported
>>> via CGI is blog-style comments. --[Zack](http://zwol.livejournal.com/)

View File

@ -0,0 +1,41 @@
This is a [[patch]] to allow filenames that are just the type. The best example of this is wanting to
pass a `Makefile` through one of the [[todo/syntax_highlighting/]] plugins. With this patch,
if the plugin can process files of type `.Makefile` then it will also process `Makefile`.
I put this patch on the [[todo/syntax_highlighting/]] page a while ago, but it seemed to get
lost because it didn't have its own bug to track it. Now it does :). -- [[Will]]
> This changes `pagename()`, but what about `pagetype()`?
> Many things in ikiwiki check if `pagetype($file)` returns
> true to see if it's a page, etc. --[[Joey]]
>> I think this patch is complete. It does not change `pagename()`, it
>> changes `pagetype()` (the diff is fairly old - line numbers may have
>> changed).
>>
>> Before this patch, `pagetype()` required a `.` in the page name. With
>> this patch it doesn't, as long as the extension is being kept. This allows
>> the filename to be all extension. `pagename()` relies on `pagetype()`
>> to detect the type. `pagename()` also removes the extension on some
>> pages, but this patch only affects pages where the extension isn't
>> removed.
>>
>> So, yeah, I think this patch is complete. :) -- [[Will]]
>>> Thanks, [[applied|done]], but I added a noextension parameter,
>>> since having keepextension allow files with no extension didn't make
>>> sense. Also, made it work for pages in subdirs.. --[[Joey]]
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 8d728c9..1bd46a9 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -618,6 +618,8 @@ sub pagetype ($) {
if ($page =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
+ } elsif ($hooks{htmlize}{$page}{keepextension}) {
+ return $page;
}
return;
}

View File

@ -1,6 +1,6 @@
New Version of gallery is available now. Few more features have been added like support for multiple pages, sorting and resizing of images etc.
SVN repository of plugin is located at http://ned.snow-crash.org:8080/svn/ikiwiki-gallery
Gallery repo is now available at <http://github.com/joeyh/ikiwiki/tree/gallery>
--[[arpitjain]]
@ -73,3 +73,9 @@ Additional details are available [here](http://myweb.unomaha.edu/~ajain/ikiwikig
> the gallery and put it in a "gallery" branch of my git repository.
>
> --[[Joey]]
----
See also [[/users/smcv/gallery]] for another implementation of the same sort of
thing. Unfortunately, none of the implementation ideas
I have there seem quite right either... --[[smcv]]

View File

@ -11,4 +11,4 @@ Currently, the page title (either the name of the page or the title specified wi
> latter, making `#` (only when on the first line) set the page title, removing it from
> the page body. --[[JasonBlevins]], October 22, 2008
[h1title]: http://code.jblevins.org/ikiwiki/plugins/h1title.pm
[h1title]: http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm

View File

@ -0,0 +1,26 @@
Links to the changed page on RecentChanges only show up if the cgi wrapper is
enabled. It would be nice if links were also generated on wikis that do not use
the cgi. [[svend]]
> It would be, but doing so would make updating the recentchanges page for
> each commit a lot slower, or would result in there often being broken
> links there.
>
> The broken links would happen if a page is removed.
>
> The speed issue is that currently each individual change in the
> recentchanges page is built just once, when the change is made, and the
> html for it is reused thereafter. To avoid broken links, it would need to
> regenerate each change's html on each commit. That's 100x the overhead.
> (Perhaps it's possible to be smarter about which need generation tho.)
>
> The best way to approach this that I can see ATM is to use the
> [[plugins/404]] plugin to handle the broken links and then recentchanges
> could avoid explicitly using the CGI. But this doesn't meet your use case
> of having no CGI.
>
> If you're willing to live with broken links to removed pages, I suppose
> that could be made an option..
> --[[Joey]]
[[!tag wishlist]]

View File

@ -8,6 +8,9 @@ I think it'd probably have to be a separate CGI script because the environment w
(having said that, it might make sense for `recentchanges_link` to return 404 rather than
200 anyway if the page doesn't exist).
> This turns out to be untrue, as long as the wrapper lets a couple of extra
> environment variables through. --[[smcv]]
This would give IkiWiki the behaviour of many other wikis, where visiting a page that
does not yet exist prompts you to create it, without having to invoke the CGI for
successful requests.
@ -15,4 +18,8 @@ successful requests.
Due to [a well-known MSIE misfeature](http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807),
error output needs to be at least 512 bytes long, so some padding might also be required.
I'm happy to write such a script if there is interest. --[[smcv]]
Implemented in the 'goto' branch in my git repository. You can see this
feature in action [on my blog](http://smcv.pseudorandom.co.uk/no/such/page/).
--[[smcv]]
[[done]]

View File

@ -7,3 +7,102 @@ Also see: <http://madduck.net/blog/2008.01.06:new-blog/> and <http://users.itk.p
[[!tag wishlist]]
I would love to see this as well. -- dato
---
I have create a patch to tag.pm for add the option for auto create tag pages.
A new setting is used to enable or disable auto-create tag pages, `tag_autocreate`.
The new tag file is created during the preprocess phase.
The new tag file is then complied during the change phase.
_tag.pm from version 3.01_
--- tag.pm 2009-02-06 10:26:03.000000000 -0700
+++ tag_new.pm 2009-02-06 12:17:19.000000000 -0700
@@ -14,6 +14,7 @@
hook(type => "preprocess", id => "tag", call => \&preprocess_tag, scan => 1);
hook(type => "preprocess", id => "taglink", call => \&preprocess_taglink, scan => 1);
hook(type => "pagetemplate", id => "tag", call => \&pagetemplate);
+ hook(type => "change", id => "tag", call => \&change);
}
sub getopt () {
@@ -36,6 +37,36 @@
safe => 1,
rebuild => 1,
},
+ tag_autocreate => {
+ type => "boolean",
+ example => 0,
+ description => "Auto-create the new tag pages, uses autotagpage.tmpl ",
+ safe => 1,
+ rebulid => 1,
+ },
+}
+
+my $autocreated_page = 0;
+
+sub gen_tag_page($) {
+ my $tag=shift;
+
+ my $tag_file=$tag.'.'.$config{default_pageext};
+ return if (-f $config{srcdir}.$tag_file);
+
+ my $template=template("autotagpage.tmpl");
+ $template->param(tag => $tag);
+ writefile($tag_file, $config{srcdir}, $template->output);
+ $autocreated_page = 1;
+
+ if ($config{rcs}) {
+ IkiWiki::disable_commit_hook();
+ IkiWiki::rcs_add($tag_file);
+ IkiWiki::rcs_commit_staged(
+ gettext("Automatic tag page generation"),
+ undef, undef);
+ IkiWiki::enable_commit_hook();
+ }
}
sub tagpage ($) {
@@ -47,6 +78,10 @@
$tag=~y#/#/#s; # squash dups
}
+ if (defined $config{tag_autocreate} && $config{tag_autocreate} ) {
+ gen_tag_page($tag);
+ }
+
return $tag;
}
@@ -125,4 +160,18 @@
}
}
+sub change(@) {
+ return unless($autocreated_page);
+ $autocreated_page = 0;
+
+ # This refresh/saveindex is to complie the autocreated tag pages
+ IkiWiki::refresh();
+ IkiWiki::saveindex();
+
+ # This refresh/saveindex is to fix the Tags link
+ # With out this additional refresh/saveindex the tag link displays ?tag
+ IkiWiki::refresh();
+ IkiWiki::saveindex();
+}
+
This uses a template called `autotagpage.tmpl`, here is my template file:
\[[!inline pages="link(<TMPL_VAR TAG>)" archive="yes"]]
A quirk I have not figured out is during the `sub change`, see my comments in the code.
I am not sure if that is the best way to handle it.
[[!tag patch]]
-- Jeremy Schultz <jeremy.schultz@uleth.ca>

View File

@ -4,10 +4,63 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
-- [[Will]]
----
I was trying to replace sourcehighlight with sourcecode. I had to modify the
htmlize call slightly so that it would work in a format directive.
([modified version](http://pivot.cs.unb.ca/git/?p=ikiplugins.git;a=blob_plain;f=IkiWiki/Plugin/sourcecode.pm;hb=21fc57091edb9))
> I haven't tested them, but those changes look sensible to me. -- [[Will]]
I hit a wall the following example (the last commit in the above repo).
\[[!meta title="Solutions to assignment 1"]]
- [[!format cc """
test
"""]]
> I haven't actually tested this to see what the problem is. How does this fail?
> Does source-highlight barf on the non-c++ content? Is there a wiki URL that shows the failure? -- [[Will]]
>> Here is the content div from the output page
>> [[DavidBremner]]
<div id="content">
<p><ul>
<li><div id="sourcecode"></li>
</ul>
2beb4fd7289998159f61976143f66bb6</p>
<p></div></p>
</div>
>>> That is quite strange. I tested your version of the plugin. I had to revert one your changes to get it to
>>> work: the linenumber argument should not have a space at the end of it. Once I made that change,
>>> everything worked as expected. The output I get for your example is below:
<div id="content">
<ul>
<li><div id="sourcecode"></li>
</ul>
<pre><tt><span class="linenum">00001:</span> <span class="normal">test</span></tt></pre>
<p></div></p>
</div>
>>> I don't know what is going wrong for you... source-highlight, Markdown or something else.
>>> I do find it interesting the way the sourcecode `div` and the list get interleaved. That
>>> just looks like a Markdown thing though.
>>> In any case, I've updated the patch below to include most of your changes. -- [[Will]]
----
#!/usr/bin/perl
# markup source files
# Originally by Will Uther
# With modifications by David Bremner
package IkiWiki::Plugin::sourcecode;
use warnings;
@ -18,142 +71,144 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
my %metaheaders;
sub import {
hook(type => "getsetup", id => "sourcecode", call => \&getsetup);
hook(type => "checkconfig", id => "sourcecode", call => \&checkconfig);
hook(type => "pagetemplate", id => "sourcecode", call => \&pagetemplate);
hook(type => "getsetup", id => "sourcecode", call => \&getsetup);
hook(type => "checkconfig", id => "sourcecode", call => \&checkconfig);
hook(type => "pagetemplate", id => "sourcecode", call => \&pagetemplate);
}
sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
sourcecode_command => {
type => "string",
example => "/usr/bin/source-highlight",
description => "The command to execute to run source-highlight",
safe => 0,
rebuild => 1,
},
sourcecode_lang => {
type => "string",
example => "c,cpp,h,java",
description => "Comma separated list of suffixes to recognise as source code",
safe => 1,
rebuild => 1,
},
sourcecode_linenumbers => {
type => "boolean",
example => 1,
description => "Should we add line numbers to the source code",
safe => 1,
rebuild => 1,
},
sourcecode_css => {
type => "string",
example => "sourcecode_style",
description => "page to use as css file for source",
safe => 1,
rebuild => 1,
},
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
sourcecode_command => {
type => "string",
example => "/usr/bin/source-highlight",
description => "The command to execute to run source-highlight",
safe => 0,
rebuild => 1,
},
sourcecode_lang => {
type => "string",
example => "c,cpp,h,java",
description => "Comma separated list of suffixes to recognise as source code",
safe => 1,
rebuild => 1,
},
sourcecode_linenumbers => {
type => "boolean",
example => 1,
description => "Should we add line numbers to the source code",
safe => 1,
rebuild => 1,
},
sourcecode_css => {
type => "string",
example => "sourcecode_style",
description => "page to use as css file for source",
safe => 1,
rebuild => 1,
},
}
sub checkconfig () {
if (! $config{sourcecode_lang}) {
error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option");
}
if (! $config{sourcecode_command}) {
$config{sourcecode_command} = "source-highlight";
}
if (! length `which $config{sourcecode_command} 2>/dev/null`) {
error("The sourcecode plugin is unable to find the $config{sourcecode_command} command");
}
if (! $config{sourcecode_lang}) {
error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option");
}
if (! $config{sourcecode_css}) {
$config{sourcecode_css} = "sourcecode_style";
}
if (! defined $config{sourcecode_linenumbers}) {
$config{sourcecode_linenumbers} = 1;
}
my %langs = ();
open(LANGS, "$config{sourcecode_command} --lang-list|");
while (<LANGS>) {
if ($_ =~ /(\w+) = .+\.lang/) {
$langs{$1} = 1;
}
}
close(LANGS);
foreach my $lang (split(/[, ]+/, $config{sourcecode_lang})) {
if ($langs{$lang}) {
hook(type => "htmlize", id => $lang, call => \&htmlize, keepextension => 1);
} else {
error("Your installation of source-highlight cannot handle sourcecode language $lang!");
}
}
if (! $config{sourcecode_command}) {
$config{sourcecode_command} = "source-highlight";
}
if (! length `which $config{sourcecode_command} 2>/dev/null`) {
error("The sourcecode plugin is unable to find the $config{sourcecode_command} command");
}
if (! $config{sourcecode_css}) {
$config{sourcecode_css} = "sourcecode_style";
}
if (! defined $config{sourcecode_linenumbers}) {
$config{sourcecode_linenumbers} = 1;
}
my %langs = ();
open(LANGS, "$config{sourcecode_command} --lang-list|");
while (<LANGS>) {
if ($_ =~ /(\w+) = .+\.lang/) {
$langs{$1} = 1;
}
}
close(LANGS);
foreach my $lang (split(/[, ]+/, $config{sourcecode_lang})) {
if ($langs{$lang}) {
hook(type => "htmlize", id => $lang, no_override=>1,
call => sub { htmlize(lang=>$lang, @_) },
keepextension => 1);
} else {
error("Your installation of source-highlight cannot handle sourcecode language $lang!");
}
}
}
sub htmlize (@) {
my %params=@_;
my %params=@_;
my $page = $params{page};
my $page = $params{page};
eval q{use FileHandle};
error($@) if $@;
eval q{use IPC::Open2};
error($@) if $@;
eval q{use FileHandle};
error($@) if $@;
eval q{use IPC::Open2};
error($@) if $@;
local(*SPS_IN, *SPS_OUT); # Create local handles
local(*SPS_IN, *SPS_OUT); # Create local handles
my @args;
my @args;
if ($config{sourcecode_linenumbers}) {
push @args, '--line-number= ';
}
if ($config{sourcecode_linenumbers}) {
push @args, '--line-number';
}
my $pid = open2(*SPS_IN, *SPS_OUT, $config{sourcecode_command},
'-s', IkiWiki::pagetype($pagesources{$page}),
'-c', $config{sourcecode_css}, '--no-doc',
'-f', 'xhtml',
@args);
my $pid = open2(*SPS_IN, *SPS_OUT, $config{sourcecode_command},
'-s', $params{lang},
'-c', $config{sourcecode_css}, '--no-doc',
'-f', 'xhtml',
@args);
error("Unable to open $config{sourcecode_command}") unless $pid;
error("Unable to open $config{sourcecode_command}") unless $pid;
print SPS_OUT $params{content};
close SPS_OUT;
print SPS_OUT $params{content};
close SPS_OUT;
my @html = <SPS_IN>;
close SPS_IN;
waitpid $pid, 0;
my @html = <SPS_IN>;
close SPS_IN;
my $stylesheet=bestlink($page, $config{sourcecode_css}.".css");
if (length $stylesheet) {
push @{$metaheaders{$page}}, '<link href="'.urlto($stylesheet, $page).'"'.
' rel="stylesheet"'.
' type="text/css" />';
}
waitpid $pid, 0;
return '<div id="sourcecode">'."\r\n".join("\r\n",@html)."\r\n</div>\n";
my $stylesheet=bestlink($page, $config{sourcecode_css}.".css");
if (length $stylesheet) {
push @{$metaheaders{$page}}, '<link href="'.urlto($stylesheet, $page).'"'.
' rel="stylesheet"'.
' type="text/css" />';
}
return '<div id="sourcecode">'."\r\n".join("",@html)."\r\n</div>\r\n";
}
sub pagetemplate (@) {
my %params=@_;
my %params=@_;
my $page=$params{page};
my $template=$params{template};
my $page=$params{page};
my $template=$params{template};
if (exists $metaheaders{$page} && $template->query(name => "meta")) {
# avoid duplicate meta lines
my %seen;
$template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
}
if (exists $metaheaders{$page} && $template->query(name => "meta")) {
# avoid duplicate meta lines
my %seen;
$template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
}
}
1

View File

@ -10,19 +10,22 @@
> it's hard enough to get some people to title their blog posts :-)
> --[[smcv]]
## Patches pending merge
* There is some common code cargo-culted from other plugins (notably inline and editpage) which
should probably be shared
> Actually, there's less of this now than there used to be - a lot of simple
> things that were shared have become unshareable as they became more
> complex. --[[smcv]]
> There's still goto. You have a branch for that. --[[Joey]]
## Won't fix
* Because IkiWiki generates static HTML, we can't have a form inlined in
page.tmpl where the user fills in an entire comment and can submit it in
a single button-press, without being vulnerable to cross-site request forgery.
So I'll put this in as wontfix. --[[smcv]]
> Surely there's a way around that?
> A web 2.0 way comes to mind: The user clicks on a link
> to open the comment post form. While the nasty web 2.0 javascript :)
> is manipulating the page to add the form to it, it looks at the cookie
> and uses that to insert a sid field.
>
> Or, it could have a mandatory preview page and do the CSRF check then.
> --[[Joey]]
* It would be useful to have a pagespec that always matches all comments on
pages matching a glob. Something like `comment(blog/*)`.
Perhaps postcomment could also be folded into this? Then the pagespec
@ -47,6 +50,17 @@
## Done
* There is some common code cargo-culted from other plugins (notably inline and editpage) which
should probably be shared
> Actually, there's less of this now than there used to be - a lot of simple
> things that were shared have become unshareable as they became more
> complex. --[[smcv]]
> There's still goto. You have a branch for that. --[[Joey]]
>> Now merged --[[smcv]]
* The default template should have a (?) icon next to unauthenticated users (with the IP address
as title) and an OpenID icon next to OpenIDs
@ -91,6 +105,7 @@
> and c42f174e fix another `beautify_urlpath` bug and add a regression test
> --[[smcv]]
* Now that inline has some comments-specific functionality anyway, it would
be good to output `<link rel="comments">` in Atom and the equivalent in RSS.

View File

@ -30,4 +30,4 @@ I don't think that the nesting is very clear, I found it confusing..
Would each page be its own individual blog? Or its own blog post? To me it seems like an entire wiki can be viewed as a blog, with threaded or unthreaded comments underneath.
[[!tag soc]]
[[!tag soc done]]

View File

@ -6,4 +6,30 @@ the same for users. For now I've just cloned the functionality into the comments
plugin, but perhaps this functionality could be renamed to `do=goto` or
something, and moved to `IkiWiki/CGI.pm`?
If there's general approval I'm happy to write a patch. --[[smcv]]
> Now implemented as the 'goto' branch in my git repository, along with
> [[apache_404_ErrorDocument_handler]]. --[[smcv]]
>> Looks good, the only things I wonder are:
>> * Should it be a separate plugin? In particular `cgi_page_from_404()` is
>> pretty big, and only works if apache is configured so seems somewhat
>> pluginaable.
>>> I've split out `goto` and `apache404` plugins in the branch. I think
>>> you're right that apache404 should be a plugin. If you think goto is small
>>> and general enough to not be a plugin, just don't merge my most recent
>>> patch! --[[smcv]]
>> * I wish there were some way to generalize the workaround for the stupid
>> MSIE behavior. Actually, I wish we could ignore the MSIE stupidity,
>> as I tend to do, but perhaps it's too stupid in this case for that to
>> fly..
>> * Is there any reason to require do=goto before checking for
>> `REDIRECT_STATUS`? Seems that if that code were moved
>> out of the enclosing if block, the apache 404 handler could
>> be set direct to the cgi, which seems simpler to remember.
>> --[[Joey]]
>>> No, good point - the `REDIRECT_STATUS` check is sufficiently unambiguous
>>> already. Fixed. --[[smcv]]
[[done]]

View File

@ -31,6 +31,9 @@ Conversely, how about adding a plugin to support exporting to LaTeX?
a latex plugin. Examples [here](http://ng.l4x.org/latex/). Currently without image support for hevea. And the latex2html
output has the wrong charset and no command line switch to change that. Dreamland.
As this link is not working, I setted a mirror here: <a href="http://satangoss.sarava.org/ikiwiki/latex.pm">http://satangoss.sarava.org/ikiwiki/latex.pm</a>.
----
Okay, now is the time for a mid term report i think.

View File

@ -0,0 +1,116 @@
The [StackOverflow](http://stackoverflow.com/) site uses markdown for markup.
It has a fancy javascript thing for showing a real-time preview of what the user
is editing. It would be nice if ikiwiki could support this, too. The thing they
use on StackOverflow is supposed to be free software, so it should be easy to
add to ikiwiki.
> See [[wikiwyg]]. Note that I do not have a copy of the code for that, or
> it'd be in ikiwiki already. --[[Joey]]
>> I just had a brief look at the [[wikiwyg]] page and the link to the plugin was
>> broken. The StackOverflow site uses the [WMD](http://wmd-editor.com/) editor,
>> which seems to be related to the [ShowDown](http://attacklab.net/showdown/)
>> javascript port of Markdown. Interestingly, [WMD source](http://wmd.googlecode.com/)
>> is now available under an MIT license, though it is supposedly undergoing heavy
>> refactoring. It looks like there was previous discussion ( [[todo/Add_showdown_GUI_input__47__edit]] )
>> about a showdown plugin. Maybe a WMD plugin would be worthwhile. I might
>> look into it if I have time on the weekend. -- [[Will]]
[[!tag wishlist]]
>>> Below is a simple plugin/[[patch]] to make use of the WMD editor. Turns out it isn't hard at all to
>>> get a basic version going (which doesn't handle directives at all, nor does it swtich itself off when you're
>>> editing something other than Markdown source). I've
>>> removed the done tag so this is visible as a patch. -- [[Will]]
>>> Hmm, it would be good if it turned off for !mdwn. Although this could
>>> be difficult for a new page, since there is a dropdown selector to
>>> choose the markup language then. But it should be doable for editing an
>>> existing page.
>>>
>>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin?
>>> --[[Joey]]
------
### Instructions:
Download the [WMD source](http://wmd-editor.com/downloads/wmd-1.0.1.zip). In that zip file you'll
find a few example html files, a readme and `wmd` directory. Move the `wmd` directory into the
ikiwiki `underlays` directory. You should now have an `underlays/wmd/wmd.js` file as well as
some other javascript files and an images directory in the same place.
> So, I wonder if I should add a copy of the WMD source to ikiwiki, or rely
> on the user or distribution providing it. It does not seem to be packaged
> for Debian yet. --[[Joey]]
Note that the WMD plugin does **not** handle directives. For this reason the normal `preview` button
remains. Some CSS to clean up the display of the live WMD preview would be good.
> Can you elucidate the CSS comment -- or will it be obvious what you mean
> when I try it? Is it what's needed for the live preview? --[[Joey]]
Install the following patch and plugin file. Then enable the 'wmd' plugin.
diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl
index 4b54db2..b1cf015 100644
--- a/templates/editpage.tmpl
+++ b/templates/editpage.tmpl
@@ -37,6 +37,7 @@ Optional comment about this change:<br />
</div>
</TMPL_IF>
<TMPL_VAR FORM-END>
+<TMPL_VAR WMD_PREVIEW>
<TMPL_IF NAME="PAGE_PREVIEW">
<hr />
-----
#!/usr/bin/perl
package IkiWiki::Plugin::wmd;
use warnings;
use strict;
use IkiWiki 3.00;
use POSIX;
use Encode;
sub import {
add_underlay("wmd");
hook(type => "getsetup", id => "wmd", call => \&getsetup);
hook(type => "formbuilder_setup", id => "wmd", call => \&formbuilder_setup);
}
sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1,
},
}
sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
return if ! defined $form->field("do");
return unless (($form->field("do") eq "edit") ||
($form->field("do") eq "create"));
$form->tmpl_param("wmd_preview", "<div class=\"wmd-preview\"></div>\n".include_javascript(undef, 1));
}
sub include_javascript ($;$) {
my $page=shift;
my $absolute=shift;
return '<script src="'.urlto("wmd.js", $page, $absolute).
'" type="text/javascript"></script>'."\n";
}
1

View File

@ -14,6 +14,10 @@
It seems that with the current mercurial commit code, it will always
blindly overwrite the current file with the web edited version, losing
any other changes.
* `rcs_commit_staged`, `rcs_rename`, `rcs_remove`, and `rcs_diff` are not
implemented for mercurial, and so attachments, remove and rename plugins
and recentchangesdiff cannot be used with it. (These should be fairly
easy to add..)
Posthook: in `$srcdir/.hg/hgrc`, I have the following
@ -29,6 +33,62 @@ This should update the working directory and run ikiwiki every time a change is
> It can deadlock if the post-commit hook runs with --refresh in the
> former case. --[[Joey]]
The problem with --post-commit is that if you delete some pages in $SRC, ikiwiki --setup setupfile --post-commit will not delete them in $DEST. --[[users/weakish]]
> You should really be using a setup file that has `mercurial_wrapper`
> set, and running the wrapper generated by that from your hook.
> That will work. I think that the `--setup --post-commit` on the command
> line is currently broken and does the same expensive rebuild process as --setup
> alone (which doesn't delete files from $DEST either). Will fix that.
> (fixed)
> --[[Joey]]
>> Mercurial doesn't support put hooks in .hg/hooks/* (like git). In Mercurial, the only way to run
>> your own hooks is specifying them in the hgrc file. (Or write a new extension.)
>> I guess use a very long command will work.
>> (e.g. ikiwiki --post-commit --a-lot-of-switches --set var=value $SRC $DEST)
>> (Fortunately ikiwiki supports --set var=value so without --setup works.)
>>
>> Alternative is always editing via cgi or pushing. Never work on the $SRC/repo directly.
>> --[[users/weakish]]
>>> I don't see anything preventing you from using a setup file with
>>> `mercurial_wrapper => ".hg/ikiwiki-hook",` and then modifying the hgrc
>>> to run that wrapper. --[[Joey]]
>> Thanks for pointing out this. I have some stupid misunderstanding on the
>> usage of mercurial_wrapper before. The wrapper works nicely! --[[weakish]]
I add the following to .hg/hgrc:(I use changegroup since I don't think we need refresh per changeset, please point out if I am wrong.)
[hooks]
changegroup = hg update >&2 && ikiwiki --setup path.to.setup.file --refresh
post-commit = path.to.the.mercurial.wrapper
-----
I have no idea when the deadlock will happen. --[[users/weakish]]
> For the deadlock to occur, a edit has to be made via the web.
>
> Ikiwiki,
> running as a CGI, takes a lock on the wiki, and commits the edit,
> continuing to run in the background, with the lock still held.
> When the edit is committed, the hg hook runs, running `ikwiki --refresh`.
> Nearly the first thing that process does it try to lock the wiki..
> which is already locked. This lock is taken in a blocking manner,
> thus the deadlock -- the cgi is waiting for the commit to finish before
> dropping the lock, and the commit is blocked waiting for the lock to be
> released.
>
> --post-commit avoids this problem by checking if the cgi is running
> and avoiding doing anything in that case. (While still handing the
> refresh if the commit was not made by the CGI.)
> So in that case, the commit finishes w/o ikiwiki doing anything,
> and the ikiwiki CGI handles the wiki refresh.
> --[[Joey]]
***
I have a few notes on mercurial usage after trying it out for a while:

View File

@ -58,8 +58,48 @@ would solve my problem. Hmmm? --[[intrigeri]]
>>> As Joey highlights it on [[plugins/contrib/po]], it's too late to
>>> merge such a change, as the 3.x plugin API is released and should
>>> not be broken. I'm thus proposing to keep the existing
>>> `renamepage` as it is, and call `rename` the global hook I need.
>>> --[[intrigeri]]
>>> not be broken. I will thus keep the existing `renamepage` as it
>>> is, and call `rename` the global hook I need. --[[intrigeri]]
[[done]] as part of po branch
>>>> Done in my `po` branch. --[[intrigeri]]
I think I see a problem in the rename hook. The hook is called
before the plugin adds any subpages to the set of pages to rename.
So, if the user choses to rename subpages, po will not notice
they are moving, and will not move their po files.
Perhaps the hooks should be moved to come after subpages are added.
This would, though, mean that if the hook somehow decides to add
entirely other pages to the list, their subpages would not be
automatically added.
I also have some qualms about the design of the hook. In particular,
passing the mutable array reference probably makes it impossible
to use from external plugins. Instead it could return any additional
rename hashes it wants to add. Or, if the ability to modify existing
hashes is desired, it could return the full set of hashes.
--[[Joey]]
> I fixed the last part, i.e. a rename hook function now returns the
> full set of hashes. As I also converted it to take named parameters,
> such a function still is passed a reference to the original array,
> though, because one can't build a hash containing an array of hashes
> as a value, without passing this array as a reference.
>
>> Sure.
>
> I'm not entirely sure about your first concern. Calling the hook
> before or after the subpages addition both have their own problems.
>
> What about running the hook before *and* after the subpages
> addition, with an additional `when` named parameter, so that
> a given hook function can choose to act only before or after, or both?
>
> --[[intrigeri]]
>>
>> Have you thought about making the hook be run once *per* file that is
>> selected to be renamed? This would even handle the case where two
>> plugins use the hook; plugin A would see when plugin B adds a new file
>> to be renamed. And the subpage renaming stuff could probably be moved
>> into the rename hook too. --[[Joey]]

View File

@ -1,12 +1,19 @@
Some aggregators, like Planet, sort by mtime rather than ctime. This
means that posts with modified content come to the top (which seems odd
to me, but is presumably what the aggregator's author or operator
wants), but it also means that posts with insignificant edits (like
wants),
> Hah! That's so charitable I hope you can deduct it from your taxes. ;-)
> --[[Joey]]
but it also means that posts with insignificant edits (like
adding tags) come to the top too. Atom defines `<updated>` to be the date
of the last *significant* change, so it's fine that ikiwiki defaults to
using the mtime, but it would be good to have a way for the author to
say "that edit was insignificant, don't use that mtime".
> Yes, this is a real limitiation of ikiwiki's atom support. --[[Joey]]
See smcv's 'updated' branch for a basic implementation, which only affects
the Atom `<updated>` field or the RSS equivalent.
@ -15,3 +22,6 @@ each should use it or not, please):
* sorting by mtime in the inline directive
* displaying "last edited" on ordinary pages
> Tending toward no for both, but willing to be convinced otherwise..
> [[merged|done]] --[[Joey]]

View File

@ -20,3 +20,20 @@ case I will consider this done with an entry in [[tips]]; otherwise a
[[plugins|plugin]] to implement pingbacks would be great.
-- [[Jon]] (Wed Jan 14 13:48:47 GMT 2009)
> I think it's now possible to implement trackback and pingback receiving
> support in ikiwiki. One easy way to do it would be to hook it into the
> existing [[plugins/comments]] plugin -- each pingback/trackback that
> ikiwiki recieves would result in the creation if a new comment, which
> would be subject to the usual comment filtering (ie, blogspam) and
> moderation and would then show up amoung the other, regular comments on
> the page.
>
> (One wrinkle: would need to guard against duplicate pings. Maybe by
> checking existing comments for any that have the same url?)
>
> As for sending trackbacks and pingbacks, this could fairly easily be
> implemented using a `editcontent` hook. Since this hook is called
> whenever a page is posted or edited, and gets the changed content, it can
> simply scan it for urls (may have to htmlize first?), and send pings to
> all urls found. --[[Joey]]

View File

@ -0,0 +1,10 @@
In some wikis, (e.g. Mediawiki) after [[renaming|plugins/rename]]
a page, the old page still exist but only redirect to the
new page. This is convenient since external sites may
have links pointing to the old url.
If [[plugins/meta]] plugin is enabled, users can manually edit the
page, and put in '\[[!meta redir=newpage]]', but this is
not very convenient.

View File

@ -26,6 +26,11 @@ pages, as well as doing syntax highlighting as a preprocessor directive
* [[users/jasonblevins]]'s code plugin uses src-highlight, and supports both
while file and directive use.
* [hlsimple](http://pivot.cs.unb.ca/git/?p=ikiplugins.git;a=blob_plain;f=IkiWiki/Plugin/hlsimple.pm;hb=HEAD) is a wrapper for the the perl module Syntax::Highlight::Engine::Simple. This is pure perl, pretty simple, uses css. It ought to be pretty fast (according to the author, and just because it is not external).
On the other hand, there are not many predefined languages yet. Defining language syntaxes is about as much
work as source-highlight, but in perl. I plan to package the base module for debian. Perhaps after the author
releases the 5 or 6 language definitions he has running on his web site, it might be suitable for inclusion in ikiwiki. [[DavidBremner]]
## General problems
* Using non-perl syntax highlighting backends is slow. I'd prefer either

View File

@ -0,0 +1,34 @@
Implementing tags in terms of links is clever, but it would be nice if it was
opaque in both directions: tagging and matching tags. Writing pagespecs to
find out which pages are tagged with a given name means that the pagespec is
tied to whatever the tagbase is.
This patch adds a pagespec function 'tag' which lets you write pagespecs to
match tagged pages independent of whatever the tagbase is set to.
-- [[users/Jon]] 2009/02/17
> So, this looks good, appreciate the patch.
>
> The only problem I see is it could be confusing if `tag(foo)` matched
> a page that just linked to the tag via a wikilink, w/o actually tagging it.
>
> One other thing, perhaps it should be called `tagged()`? --[[Joey]]
[[!tag patch done]]
--- a/plugins/IkiWiki/Plugin/tag.pm 2009-02-16 11:30:11.000000000 +0000
+++ b/plugins/IkiWiki/Plugin/tag.pm 2009-02-17 15:40:03.000000000 +0000
@@ -125,4 +125,12 @@
}
}
+package IkiWiki::PageSpec;
+
+sub match_tag ($$;@) {
+ my $page = shift;
+ my $glob = shift;
+ return match_link($page, IkiWiki::Plugin::tag::tagpage($glob));
+}
+
1

Some files were not shown because too many files have changed in this diff Show More