Merge remote branch 'upstream/filter-full' into prv/po
authorintrigeri <intrigeri@boum.org>
Sun, 11 Jul 2010 09:04:59 +0000 (11:04 +0200)
committerintrigeri <intrigeri@boum.org>
Sun, 11 Jul 2010 09:04:59 +0000 (11:04 +0200)
41 files changed:
IkiWiki.pm
IkiWiki/Plugin/aggregate.pm
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/git.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/openid.pm
IkiWiki/Plugin/po.pm
IkiWiki/Setup.pm
debian/changelog
doc/bugs/po_vs_templates.mdwn
doc/bugs/support_for_openid2_logins.mdwn
doc/examples/blog/comments.mdwn
doc/forum/The_requested_URL___47____126__jean__47__blog__47__ikiwiki.cgi_was_not_found_on_this_server./comment_5_e098723bb12adfb91ab561cae21b492b._comment [new file with mode: 0644]
doc/forum/html_source_pages_in_version_3.20100704.mdwn [new file with mode: 0644]
doc/forum/ikiwiki_vim_syntaxfile.mdwn [new file with mode: 0644]
doc/forum/recentchanges_dir_should_be_under_control_of_RCS__63__.mdwn [new file with mode: 0644]
doc/forum/remove_css__63__.mdwn [new file with mode: 0644]
doc/forum/use_php-markdown-extra_with_ikiwiki__63__.mdwn [new file with mode: 0644]
doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_1_66d48218361caa4c07bd714b82ed0021._comment [new file with mode: 0644]
doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_2_f2ee0a4dce571d329f795e52139084c0._comment [new file with mode: 0644]
doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_3_e388714f457ccb6ef73630179914558c._comment [new file with mode: 0644]
doc/ikiwiki/directive/commentmoderation.mdwn [new file with mode: 0644]
doc/ikiwikiusers.mdwn
doc/news/version_3.20100515.mdwn [deleted file]
doc/news/version_3.20100704.mdwn [new file with mode: 0644]
doc/plugins/aggregate.mdwn
doc/plugins/getsource/discussion.mdwn
doc/plugins/goodstuff/discussion.mdwn [new file with mode: 0644]
doc/plugins/po.mdwn
doc/plugins/po/discussion.mdwn
doc/plugins/rst/discussion.mdwn
doc/sandbox.mdwn
doc/setup.mdwn
doc/style.css
doc/tips/howto_limit_to_admin_users.mdwn [new file with mode: 0644]
doc/tips/optimising_ikiwiki.mdwn
doc/todo/Fix_selflink_in_po_plugin.mdwn
doc/usage.mdwn
ikiwiki.in
ikiwiki.spec
po/ikiwiki.pot

index 701f7137dd78483215637e205bbde0b720ea0387..cd9c407958e79d971641ce206b8caf64f58a58d1 100644 (file)
@@ -1081,6 +1081,13 @@ sub urlto ($$;$) {
        return beautify_urlpath($link);
 }
 
+sub isselflink ($$) {
+       my $page=shift;
+       my $link=shift;
+
+        return $page eq $link;
+}
+
 sub htmllink ($$$;@) {
        my $lpage=shift; # the page doing the linking
        my $page=shift; # the page that will contain the link (different for inline)
@@ -1106,7 +1113,7 @@ sub htmllink ($$$;@) {
        }
        
        return "<span class=\"selflink\">$linktext</span>"
-               if length $bestlink && $page eq $bestlink &&
+               if length $bestlink && isselflink($page, $bestlink) &&
                   ! defined $opts{anchor};
        
        if (! $destsources{$bestlink}) {
index 5a9eb433de8311e0a9d77909aa45343c609bdea5..7789c4c2a9d38b7e616d9d3b4df8e4d96fe74ec6 100644 (file)
@@ -298,7 +298,7 @@ sub loadstate () {
        return if $state_loaded;
        $state_loaded=1;
        if (-e "$config{wikistatedir}/aggregate") {
-               open(IN, "$config{wikistatedir}/aggregate") ||
+               open(IN, "<", "$config{wikistatedir}/aggregate") ||
                        die "$config{wikistatedir}/aggregate: $!";
                while (<IN>) {
                        $_=IkiWiki::possibly_foolish_untaint($_);
@@ -335,7 +335,7 @@ sub savestate () {
        garbage_collect();
        my $newfile="$config{wikistatedir}/aggregate.new";
        my $cleanup = sub { unlink($newfile) };
-       open (OUT, ">$newfile") || error("open $newfile: $!", $cleanup);
+       open (OUT, ">", $newfile) || error("open $newfile: $!", $cleanup);
        foreach my $data (values %feeds, values %guids) {
                my @line;
                foreach my $field (keys %$data) {
@@ -356,6 +356,20 @@ sub savestate () {
        close OUT || error("save $newfile: $!", $cleanup);
        rename($newfile, "$config{wikistatedir}/aggregate") ||
                error("rename $newfile: $!", $cleanup);
+
+       my $timestamp=undef;
+       foreach my $feed (keys %feeds) {
+               my $t=$feeds{$feed}->{lastupdate}+$feeds{$feed}->{updateinterval};
+               if (! defined $timestamp || $timestamp > $t) {
+                       $timestamp=$t;
+               }
+       }
+       $newfile=~s/\.new$/time/;
+       open (OUT, ">", $newfile) || error("open $newfile: $!", $cleanup);
+       if (defined $timestamp) {
+               print OUT $timestamp."\n";
+       }
+       close OUT || error("save $newfile: $!", $cleanup);
 }
 
 sub garbage_collect () {
index 64eb7fb093fce0d8dbb1d8437f829f5c4aa31b6d..851f4862eb3a5a39bb0afb387b35dfc60262024d 100644 (file)
@@ -22,6 +22,7 @@ sub import {
        hook(type => "checkconfig", id => 'comments',  call => \&checkconfig);
        hook(type => "getsetup", id => 'comments',  call => \&getsetup);
        hook(type => "preprocess", id => 'comment', call => \&preprocess);
+       hook(type => "preprocess", id => 'commentmoderation', call => \&preprocess_moderation);
        # here for backwards compatability with old comments
        hook(type => "preprocess", id => '_comment', call => \&preprocess);
        hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
@@ -249,6 +250,22 @@ sub preprocess {
        return $content;
 }
 
+sub preprocess_moderation {
+       my %params = @_;
+
+       $params{desc}=gettext("Comment Moderation")
+               unless defined $params{desc};
+
+       if (length $config{cgiurl}) {
+               return '<a href="'.
+                       IkiWiki::cgiurl(do => 'commentmoderation').
+                       '">'.$params{desc}.'</a>';
+       }
+       else {
+               return $params{desc};
+       }
+}
+
 sub sessioncgi ($$) {
        my $cgi=shift;
        my $session=shift;
@@ -567,6 +584,7 @@ sub commentmoderation ($$) {
                my $added=0;
                foreach my $id (keys %vars) {
                        if ($id =~ /(.*)\._comment(?:_pending)?$/) {
+                               $id=decode_utf8($id);
                                my $action=$cgi->param($id);
                                next if $action eq 'Defer' && ! $rejectalldefer;
 
index 0f92476c94403df7b52a28f62e0f4a17d5988794..cb3437e1861a5a7b7786fabc6011e5c8772346e7 100644 (file)
@@ -517,6 +517,8 @@ sub rcs_commit_staged (@) {
                }
                if (defined $params{session}->param("nickname")) {
                        $u=encode_utf8($params{session}->param("nickname"));
+                       $u=~s/\s+/_/g;
+                       $u=~s/[^-_0-9[:alnum:]]+//g;
                }
                if (defined $u) {
                        $ENV{GIT_AUTHOR_EMAIL}="$u\@web";
index eb1b6812482dab4065f40dbe6b8a4ebc96726a49..2375ead8968b6a9baf64ff8ac825dbde6a75b82d 100644 (file)
@@ -156,6 +156,13 @@ sub preprocess (@) {
                $imgurl="$config{url}/$imglink";
        }
 
+       if (exists $params{class}) {
+               $params{class}.=" img";
+       }
+       else {
+               $params{class}="img";
+       }
+
        my $attrs='';
        foreach my $attr (qw{alt title class id hspace vspace}) {
                if (exists $params{$attr}) {
index d393afd2363be34a455d76f9b4442a54d00366ce..b1a9a7a152866090f2008f0c5ef8ba94771a929a 100644 (file)
@@ -211,7 +211,6 @@ sub auth ($$) {
                                }
                        }
                        if (defined $nickname) {
-                               $nickname=~s/\s+/_/g;
                                $session->param(nickname => $nickname);
                        }
                }
index 0b225166823ef6b83d931ab3af6b981e1cc3cf0b..ecfbb6f782552fe57c51628f5f99058333b6e739 100644 (file)
@@ -28,6 +28,7 @@ use UNIVERSAL;
 my %translations;
 my @origneedsbuild;
 my %origsubs;
+my @slavelanguages; # orderer as in config po_slave_languages
 
 memoize("istranslatable");
 memoize("_istranslation");
@@ -64,6 +65,8 @@ sub import {
                inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
                $origsubs{'rootpage'}=\&IkiWiki::rootpage;
                inject(name => "IkiWiki::rootpage", call => \&myrootpage);
+               $origsubs{'isselflink'}=\&IkiWiki::isselflink;
+               inject(name => "IkiWiki::isselflink", call => \&myisselflink);
        }
 }
 
@@ -102,11 +105,11 @@ sub getsetup () {
                },
                po_slave_languages => {
                        type => "string",
-                       example => {
+                       example => [
                                'fr' => 'Français',
                                'es' => 'Español',
                                'de' => 'Deutsch'
-                       },
+                       ],
                        description => "slave languages (PO files)",
                        safe => 1,
                        rebuild => 1,
@@ -135,6 +138,21 @@ sub checkconfig () {
                                      $field, 'po'));
                }
        }
+
+       if (ref $config{po_slave_languages} eq 'ARRAY') {
+               my %slaves;
+               for (my $i=0; $i<@{$config{po_slave_languages}}; $i = $i + 2) {
+                       $slaves{$config{po_slave_languages}->[$i]} = $config{po_slave_languages}->[$i + 1];
+                       push @slavelanguages, $config{po_slave_languages}->[$i];
+                }
+               $config{po_slave_languages} = \%slaves;
+        }
+       elsif (ref $config{po_slave_languages} eq 'HASH') {
+               @slavelanguages = sort {
+                       $config{po_slave_languages}->{$a} cmp $config{po_slave_languages}->{$b};
+               } keys %{$config{po_slave_languages}};
+        }
+
        delete $config{po_slave_languages}{$config{po_master_language}{code}};;
 
        map {
@@ -195,7 +213,7 @@ sub needsbuild () {
 
        # make existing translations depend on the corresponding master page
        foreach my $master (keys %translations) {
-               map add_depends($_, $master), values %{otherlanguages($master)};
+               map add_depends($_, $master), values %{otherlanguages_pages($master)};
        }
 }
 
@@ -227,7 +245,7 @@ sub scan (@) {
                                # make sure any destpage's translations has
                                # $page in its backlinks
                                push @{$links{$page}},
-                                       values %{otherlanguages($destpage)};
+                                       values %{otherlanguages_pages($destpage)};
                        }
                }
        }
@@ -285,7 +303,7 @@ sub pagetemplate (@) {
        }
        if ($template->query(name => "otherlanguages")) {
                $template->param(otherlanguages => [otherlanguagesloop($page)]);
-               map add_depends($page, $_), (values %{otherlanguages($page)});
+               map add_depends($page, $_), (values %{otherlanguages_pages($page)});
        }
        if ($config{discussion} && istranslation($page)) {
                if ($page !~ /.*\/\Q$config{discussionpage}\E$/i &&
@@ -338,12 +356,12 @@ sub renamepages (@) {
        return () unless istranslatable($torename{src});
 
        my @ret;
-       my %otherpages=%{otherlanguages($torename{src})};
+       my %otherpages=%{otherlanguages_pages($torename{src})};
        while (my ($lang, $otherpage) = each %otherpages) {
                push @ret, {
                        src => $otherpage,
                        srcfile => $pagesources{$otherpage},
-                       dest => otherlanguage($torename{dest}, $lang),
+                       dest => otherlanguage_page($torename{dest}, $lang),
                        destfile => $torename{dest}.".".$lang.".po",
                        required => 0,
                };
@@ -675,6 +693,17 @@ sub myrootpage (@) {
        return $rootpage;
 }
 
+sub myisselflink ($$) {
+       my $page=shift;
+       my $link=shift;
+
+       return 1 if $origsubs{'isselflink'}->($page, $link);
+       if (istranslation($page)) {
+               return $origsubs{'isselflink'}->(masterpage($page), $link);
+        }
+       return;
+}
+
 # ,----
 # | Blackboxes for private data
 # `----
@@ -799,7 +828,7 @@ sub islanguagecode ($) {
        return $code =~ /^[a-z]{2}$/;
 }
 
-sub otherlanguage ($$) {
+sub otherlanguage_page ($$) {
        my $page=shift;
        my $code=shift;
 
@@ -807,17 +836,31 @@ sub otherlanguage ($$) {
        return masterpage($page) . '.' . $code;
 }
 
-sub otherlanguages ($) {
+# Returns the list of other languages codes: the master language comes first,
+# then the codes are ordered the same way as in po_slave_languages, if it is
+# an array, or in the language name lexical order, if it is a hash.
+sub otherlanguages_codes ($) {
        my $page=shift;
 
-       my %ret;
-       return \%ret unless istranslation($page) || istranslatable($page);
+       my @ret;
+       return \@ret unless istranslation($page) || istranslatable($page);
        my $curlang=lang($page);
        foreach my $lang
-               ($config{po_master_language}{code}, keys %{$config{po_slave_languages}}) {
+               ($config{po_master_language}{code}, @slavelanguages) {
                next if $lang eq $curlang;
-               $ret{$lang}=otherlanguage($page, $lang);
+               push @ret, $lang;
        }
+       return \@ret;
+}
+
+sub otherlanguages_pages ($) {
+       my $page=shift;
+
+        my %ret;
+       map {
+               $ret{$_} = otherlanguage_page($page, $_)
+       } @{otherlanguages_codes($page)};
+
        return \%ret;
 }
 
@@ -848,18 +891,18 @@ sub refreshpot ($) {
        my $masterfile=shift;
 
        my $potfile=potfile($masterfile);
-       my %options = ("markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0);
-       my $doc=Locale::Po4a::Chooser::new('text',%options);
+       my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile),
+                                          po4a_options($masterfile));
        $doc->{TT}{utf_mode} = 1;
-       $doc->{TT}{file_in_charset} = 'utf-8';
-       $doc->{TT}{file_out_charset} = 'utf-8';
+       $doc->{TT}{file_in_charset} = 'UTF-8';
+       $doc->{TT}{file_out_charset} = 'UTF-8';
        $doc->read($masterfile);
        # let's cheat a bit to force porefs option to be passed to
        # Locale::Po4a::Po; this is undocument use of internal
        # Locale::Po4a::TransTractor's data, compulsory since this module
        # prevents us from using the porefs option.
        $doc->{TT}{po_out}=Locale::Po4a::Po->new({ 'porefs' => 'none' });
-       $doc->{TT}{po_out}->set_charset('utf-8');
+       $doc->{TT}{po_out}->set_charset('UTF-8');
        # do the actual work
        $doc->parse;
        IkiWiki::prep_writefile(basename($potfile),dirname($potfile));
@@ -940,15 +983,13 @@ sub percenttranslated ($) {
        return gettext("N/A") unless istranslation($page);
        my $file=srcfile($pagesources{$page});
        my $masterfile = srcfile($pagesources{masterpage($page)});
-       my %options = (
-               "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0,
-       );
-       my $doc=Locale::Po4a::Chooser::new('text',%options);
+       my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile),
+                                          po4a_options($masterfile));
        $doc->process(
                'po_in_name'    => [ $file ],
                'file_in_name'  => [ $masterfile ],
-               'file_in_charset'  => 'utf-8',
-               'file_out_charset' => 'utf-8',
+               'file_in_charset'  => 'UTF-8',
+               'file_out_charset' => 'UTF-8',
        ) or error("po(percenttranslated) ".
                   sprintf(gettext("failed to translate %s"), $page));
        my ($percent,$hit,$queries) = $doc->stats();
@@ -970,30 +1011,25 @@ sub otherlanguagesloop ($) {
        my $page=shift;
 
        my @ret;
-       my %otherpages=%{otherlanguages($page)};
-       while (my ($lang, $otherpage) = each %otherpages) {
-               if (istranslation($page) && masterpage($page) eq $otherpage) {
-                       push @ret, {
-                               url => urlto_with_orig_beautiful_urlpath($otherpage, $page),
-                               code => $lang,
-                               language => languagename($lang),
-                               master => 1,
-                       };
-               }
-               elsif (istranslation($otherpage)) {
-                       push @ret, {
-                               url => urlto_with_orig_beautiful_urlpath($otherpage, $page),
-                               code => $lang,
-                               language => languagename($lang),
-                               percent => percenttranslated($otherpage),
-                       }
+       if (istranslation($page)) {
+               push @ret, {
+                       url => urlto_with_orig_beautiful_urlpath(masterpage($page), $page),
+                       code => $config{po_master_language}{code},
+                       language => $config{po_master_language}{name},
+                       master => 1,
+               };
+       }
+       foreach my $lang (@{otherlanguages_codes($page)}) {
+               next if $lang eq $config{po_master_language}{code};
+               my $otherpage = otherlanguage_page($page, $lang);
+               push @ret, {
+                       url => urlto_with_orig_beautiful_urlpath($otherpage, $page),
+                       code => $lang,
+                       language => languagename($lang),
+                       percent => percenttranslated($otherpage),
                }
        }
-       return sort {
-               return -1 if $a->{code} eq $config{po_master_language}{code};
-               return 1 if $b->{code} eq $config{po_master_language}{code};
-               return $a->{language} cmp $b->{language};
-       } @ret;
+       return @ret;
 }
 
 sub homepageurl (;$) {
@@ -1094,15 +1130,13 @@ sub po_to_markup ($$) {
                or return $fail->(sprintf(gettext("failed to write %s"), $infile));
 
        my $masterfile = srcfile($pagesources{masterpage($page)});
-       my %options = (
-               "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0,
-       );
-       my $doc=Locale::Po4a::Chooser::new('text',%options);
+       my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile),
+                                          po4a_options($masterfile));
        $doc->process(
                'po_in_name'    => [ $infile ],
                'file_in_name'  => [ $masterfile ],
-               'file_in_charset'  => 'utf-8',
-               'file_out_charset' => 'utf-8',
+               'file_in_charset'  => 'UTF-8',
+               'file_out_charset' => 'UTF-8',
        ) or return $fail->(gettext("failed to translate"));
        $doc->write($outfile)
                or return $fail->(sprintf(gettext("failed to write %s"), $outfile));
@@ -1160,6 +1194,37 @@ sub isvalidpo ($) {
                                        "to previous page to continue edit"));
 }
 
+sub po4a_type ($) {
+       my $file = shift;
+
+       my $pagetype = pagetype($file);
+       if ($pagetype eq 'html') {
+               return 'xhtml';
+        }
+       return 'text';
+}
+
+sub po4a_options($) {
+       my $file = shift;
+
+       my %options;
+       my $pagetype = pagetype($file);
+
+       if ($pagetype eq 'html') {
+               # how to disable options is not consistent across po4a modules
+               $options{includessi} = '';
+               $options{includeexternal} = 0;
+        }
+       elsif ($pagetype eq 'mdwn') {
+               $options{markdown} = 1;
+        }
+        else {
+               $options{markdown} = 0;
+        }
+
+       return %options;
+}
+
 # ,----
 # | PageSpecs
 # `----
index 2b0259e2ac0e9b258d6537c48399547dba921e1d..7af744f6ab18fe2bc0132891ce7c4fc3a461040f 100644 (file)
@@ -50,10 +50,8 @@ sub load ($;$) {
 
 sub dump ($) {
        my $file=IkiWiki::possibly_foolish_untaint(shift);
-       
-       eval qq{require IkiWiki::Setup::$config{setuptype}};
-       error $@ if $@;
-       my @dump="IkiWiki::Setup::$config{setuptype}"->gendump(
+
+       my @header=(
                "Setup file for ikiwiki.",
                "",
                "Passing this to ikiwiki --setup will make ikiwiki generate",
@@ -62,9 +60,24 @@ sub dump ($) {
                "Remember to re-run ikiwiki --setup any time you edit this file.",
        );
 
-       open (OUT, ">", $file) || die "$file: $!";
-       print OUT "$_\n" foreach @dump;
-       close OUT;
+       # Fork because dumping setup requires loading all plugins.
+       my $pid=fork();
+       if ($pid == 0) {
+               eval qq{require IkiWiki::Setup::$config{setuptype}};
+               error $@ if $@;
+               my @dump="IkiWiki::Setup::$config{setuptype}"->gendump(@header);
+       
+               open (OUT, ">", $file) || die "$file: $!";
+               print OUT "$_\n" foreach @dump;
+               close OUT;
+
+               exit 0;
+       }
+       else {
+               waitpid $pid, 0;
+               exit($? >> 8) if $? >> 8;
+               exit(1) if $?;
+       }
 }
 
 sub merge ($) {
index bdcf528842217b842ab2c8353524fdecdb195982..c340f89019fdd848efd11badfea67f159c3cc465 100644 (file)
@@ -1,4 +1,16 @@
-ikiwiki (3.20100624) UNRELEASED; urgency=low
+ikiwiki (3.20100705) UNRELEASED; urgency=low
+
+  * img: Add a margin around images displayed by this directive.
+  * comments: Added commentmoderation directive for easy linking to the
+    comment moderation queue.
+  * aggregate: Write timestamp next aggregation can happen to
+    .ikiwiki/aggregatetime, to allow for more sophisticated cron jobs.
+  * Add --changesetup mode that allows easily changing options in a
+    setup file.
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 05 Jul 2010 13:59:42 -0400
+
+ikiwiki (3.20100704) unstable; urgency=low
 
   * Changes to avoid display of ugly google openids, by displaying
     a username taken from openid.
@@ -21,8 +33,11 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low
     make the git wrapper push to github in the background after ikiwiki
     runs.
   * po: Added needstranslation() pagespec. (intrigeri)
+  * po: Added support for .html source pages. (intrigeri)
+  * comment: Fix problem moderating comments of certian pages with utf-8
+    in their name.
 
- -- Joey Hess <joeyh@debian.org>  Wed, 23 Jun 2010 15:30:04 -0400
+ -- Joey Hess <joeyh@debian.org>  Sun, 04 Jul 2010 16:19:43 -0400
 
 ikiwiki (3.20100623) unstable; urgency=low
 
index ce0ac3577a6c5d6ffe0a05f2e8fbe003b5c422f7..7bc56676ea46edf286ad1b17243f4b71d92b95de 100644 (file)
@@ -18,6 +18,26 @@ This has been fixed in my po branch.
 
 -- [[intrigeri]]
 
-
+>> Hmm. Don't like adding a fourth positional parameter to that (or
+>> any really) function.
+>>
+>> I think it's quite possible that some of the directives that are
+>> calling filter do so unnecessarily. For example, conditional,
+>> cutpaste, more, and toggle each re-filter text that comes from the
+>> page and so has already been filtered. They could probably drop
+>> the filtering. template likewise does not need to filter the 
+>> parameters passed into it. Does it need to filter the template output?
+>> Well, it allows the (deprecated) embed plugin to work on template
+>> content, but that's about it.
+>>
+>> Note also that the only other plugin to provide a filter, txt,
+>> could also run into similar problems as po has, in theory (it looks at
+>> the page parameter and assumes the content is for the whole page).
+>>
+>> [[!template id=gitbranch branch=origin/filter-full author="[[joey]]"]]
+>> So, I've made a filter-full branch, where I attempt to fix this
+>> by avoiding unnecessary filtering. Can you check it and merge it into
+>> your po branch and remove your other workarounds so I can merge?
+>> --[[Joey]]
 
 [[!tag patch]]
index 139a5376045721d356a3f8355d7e289e4480368e..a71ed7ba9abc59d353bbe5342f0da29ef55a2619 100644 (file)
@@ -20,3 +20,5 @@ However both Perl OpenID 2.x implementations have not been released and are inco
 
 > I've tested with yahoo, and it works with the updated module. Sweet and
 > [[done]] --[[Joey]] 
+
+## A quick fix for the impatient running stable is simply `sudo apt-get install libnet-openid-consumer-perl -t unstable`
index 52c7d31328c4e776f18e3a9cd532a8aa720fc4b8..e22b50a3474435222d6179b496162cff42e2afaa 100644 (file)
@@ -1,7 +1,7 @@
 [[!sidebar content="""
 [[!inline pages="comment_pending(./posts/*)" feedfile=pendingmoderation
 description="comments pending moderation" show=-1]]
-Comments in the moderation queue:
+Comments in the [[!commentmoderation desc="moderation queue"]]:
 [[!pagecount pages="comment_pending(./posts/*)"]]
 """]]
 
diff --git a/doc/forum/The_requested_URL___47____126__jean__47__blog__47__ikiwiki.cgi_was_not_found_on_this_server./comment_5_e098723bb12adfb91ab561cae21b492b._comment b/doc/forum/The_requested_URL___47____126__jean__47__blog__47__ikiwiki.cgi_was_not_found_on_this_server./comment_5_e098723bb12adfb91ab561cae21b492b._comment
new file mode 100644 (file)
index 0000000..b832d64
--- /dev/null
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="http://joey.kitenet.net/"
+ nickname="joey"
+ subject="do parameter missing"
+ date="2010-07-08T06:04:44Z"
+ content="""
+I just debugged this problem with someone else who was using ngix-fcgi. There was a problem with it not passing CGI environment variables properly. If you're using that, it might explain your problem.
+"""]]
diff --git a/doc/forum/html_source_pages_in_version_3.20100704.mdwn b/doc/forum/html_source_pages_in_version_3.20100704.mdwn
new file mode 100644 (file)
index 0000000..b8cbb0f
--- /dev/null
@@ -0,0 +1 @@
+Is this different from using the html/rawhtml plugins?
diff --git a/doc/forum/ikiwiki_vim_syntaxfile.mdwn b/doc/forum/ikiwiki_vim_syntaxfile.mdwn
new file mode 100644 (file)
index 0000000..d0f8d25
--- /dev/null
@@ -0,0 +1,21 @@
+Hi all,
+
+I'm teaching myself how to write syntax files for vim by fixing several issues
+(and up to certain extent, taking over the maintenance) of the vim syntax
+(highlighting) file for ikiwiki.
+
+I'd like you to document here which problems you have found, so I can hunt them
+and see if I can fix them.
+
+## Problems Found
+
+  * Arguments of directives with a value of length 1 cause the following text to
+  be highlighted incorrectly. Example:
+
+        [[!directive param1="val1" param2="1"]] more text ...
+
+  * A named wikilink in a line, followed by text, and then another wikilink,
+  makes the text in between the links to be incorrectly highlighted. Example:
+
+        \[[a link|alink]] text that appears incorrectly .... \[[link]]
+
diff --git a/doc/forum/recentchanges_dir_should_be_under_control_of_RCS__63__.mdwn b/doc/forum/recentchanges_dir_should_be_under_control_of_RCS__63__.mdwn
new file mode 100644 (file)
index 0000000..2fe9736
--- /dev/null
@@ -0,0 +1,105 @@
+Hello Joey,
+
+I noticed that my Ikiwiki started to rebuild pages very slowly after my last changes
+when I upgraded Ikiwiki to version 3.20100623. Now I have the latest release 3.20100704,
+but it doesn't help me.
+
+I started to debug the problem and I found that I can see a lot of messages
+like below when I try to rebuild my wiki manually:
+
+    svn: '/path/to/ikiwiki/trunk/pages/ostatnie_zmiany' is not a working copy
+    svn: Can't open file '/path/to/ikiwiki/trunk/pages/ostatnie_zmiany/.svn/entries': No such file or directory
+    svn log exited 256
+
+"ostatnie_zmiany" is a value of `recentchangespage` parameter in my
+`ikiwiki.setup` file. It is not under control Subversion I use for Ikiwiki:
+
+    $ svn status pages/ostatnie_zmiany
+    ?      pages/ostatnie_zmiany
+
+    $ ls pages/ostatnie_zmiany/*._change |wc -l
+    100
+
+`recentchangesnum` parameter has value 100 for me and I noticed that my Ikiwiki
+takes a lot of time to parse all `._change` files. Finally it doesn't refresh
+/ostatnie_zmiany.html page.
+
+Do you think I should add `ostatnie_zmiany` directory under control of my
+Subversion repo? If it's not necessary, could you please give me any hint
+to find a reason of problem with my Ikiwiki?
+
+My best regards,
+Pawel
+
+> No, the recentchanges pages are automatically generated and should not
+> themselves be in revision control.
+> 
+> Ikiwiki has recently started automatically enabing `--gettime`, but
+> it should not do it every time, but only on the initial build
+> of a wiki. It will print "querying svn for file creation and modification
+> times.." when it does this. If it's doing it every time, something
+> is wrong. (Specifically, `.ikiwiki/indexdb` must be missing somehow.)
+> 
+> The support for svn with --gettime is rather poor. (While with git it is
+> quite fast.) But as it's only supposed to happen on the first build,
+> I haven't tried to speed it up. It would be hard to do it fast with svn.
+> It would be possible to avoid the warning message above, or even skip
+> processing files in directories not checked into svn -- but I'd much
+> rather understand why you are seeing this happen on repeated builds.
+> --[[Joey]]
+
+>> Thanks a lot for your reply! I've just checked my `rebuild-pages.sh`
+>> script and discovered that it contains
+>> `/usr/bin/ikiwiki --setup ikiwiki.setup --gettime` command... :D
+>> The warnings disappeared when I removed `--gettime` parameter.
+>> Sorry for confusing! :)
+>>
+>> I have `.ikiwiki/indexdb` file here, but I noticed that it has been
+>> modified about 1 minute **after** last Subversion commit:
+>>
+>>     $ LANG=C svn up
+>>     At revision 5951.
+>>    
+>>     $ LANG=C svn log -r 5951
+>>     ------------------------------------------------------------------------
+>>     r5951 | svn | 2010-07-06 09:02:30 +0200 (Tue, 06 Jul 2010) | 1 line
+>>     
+>>     web commit by xahil
+>>     ------------------------------------------------------------------------
+>>    
+>>     $ LANG=C stat pages/.ikiwiki/indexdb 
+>>       File: `pages/.ikiwiki/indexdb'
+>>       Size: 184520          Blocks: 368        IO Block: 131072 regular file
+>>     Device: 2bh/43d Inode: 1931145     Links: 1
+>>     Access: (0644/-rw-r--r--)  Uid: ( 1005/     svn)   Gid: ( 1005/     svn)
+>>     Access: 2010-07-06 12:06:24.000000000 +0200
+>>     Modify: 2010-07-06 09:03:38.000000000 +0200
+>>     Change: 2010-07-06 09:03:38.000000000 +0200
+>>
+>> I believe it's the time I have to wait to see that my wiki page has been rebuilt.
+>> Do you have any idea how to find a reason of that delay? --[[PaweÅ‚|ptecza]]
+
+>>> Well, I hope that your svn post-commit hook is not running your
+>>> `rebuild-pages.sh`. That script rebuilds everything, rather than just
+>>> refreshing what's been changed.
+>>>
+>>> Using subversion is not asking for speed. Especially if your svn
+>>> repository is on a remote host. You might try disabling
+>>> recentchanges and see if that speeds up the refreshes (it will avoid
+>>> one `svn log`).
+>>>
+>>> Otherwise, take a look at [[tips/optimising_ikiwiki]]
+>>> for some advice on things that can make ikiwiki run slowly. --[[Joey]]
+
+>>>> Thanks for the hints! I don't understand it, but it seems that refreshing
+>>>> all pages has resolved the problem and now my wiki works well again :)
+>>>>
+>>>> No, I use `rebuild-pages.sh` script only when I want to rebuild
+>>>> my wiki manually, for example when you release new Ikiwiki version
+>>>> then I need to update my templates. Some of them have been translated
+>>>> to Polish by me.
+>>>>
+>>>> Fortunately my wiki and its Subversion repo are located on the same host.
+>>>> We have a lot of Subversion repos for our projects and I don't want to
+>>>> change only wiki repo for better performance. I'm rather satisfied with
+>>>> its speed. --[[PaweÅ‚|ptecza]]
diff --git a/doc/forum/remove_css__63__.mdwn b/doc/forum/remove_css__63__.mdwn
new file mode 100644 (file)
index 0000000..b90b3d8
--- /dev/null
@@ -0,0 +1,4 @@
+I removed a local.css file and pushed the changes to git but the 'compiled' wiki still shows the same css.  
+Is this a bug or you are supposed to remove the css by hand?  
+ikiwiki version 3.20100705
+
diff --git a/doc/forum/use_php-markdown-extra_with_ikiwiki__63__.mdwn b/doc/forum/use_php-markdown-extra_with_ikiwiki__63__.mdwn
new file mode 100644 (file)
index 0000000..86ed70f
--- /dev/null
@@ -0,0 +1,3 @@
+Is it possible to use php-markdown-extra with ikiwiki?
+
+Thanks.
diff --git a/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_1_66d48218361caa4c07bd714b82ed0021._comment b/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_1_66d48218361caa4c07bd714b82ed0021._comment
new file mode 100644 (file)
index 0000000..af60ecb
--- /dev/null
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="http://kerravonsen.dreamwidth.org/"
+ ip="60.241.8.244"
+ subject="PHP != Perl"
+ date="2010-07-10T12:44:15Z"
+ content="""
+Er, why?  IkiWiki is written in Perl.  Presumably php-markdown-extra is written in PHP, which is a completely different language.
+"""]]
diff --git a/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_2_f2ee0a4dce571d329f795e52139084c0._comment b/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_2_f2ee0a4dce571d329f795e52139084c0._comment
new file mode 100644 (file)
index 0000000..ce60f4b
--- /dev/null
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawlzADDUvepOXauF4Aq1VZ4rJaW_Dwrl6xE"
+ nickname="Dário"
+ subject="comment 2"
+ date="2010-07-10T21:48:13Z"
+ content="""
+Because php-markdown-extra extends the basic markdown language (footnotes, etc.)
+"""]]
diff --git a/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_3_e388714f457ccb6ef73630179914558c._comment b/doc/forum/use_php-markdown-extra_with_ikiwiki__63__/comment_3_e388714f457ccb6ef73630179914558c._comment
new file mode 100644 (file)
index 0000000..72ce7bb
--- /dev/null
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="http://kerravonsen.dreamwidth.org/"
+ ip="202.173.183.92"
+ subject="I still don't get it"
+ date="2010-07-11T07:18:35Z"
+ content="""
+But if you need the \"extra\" features of Markdown, all you have to do is turn on the \"multimarkdown\" option in your configuration.  It makes no sense to try to use PHP with Perl.
+
+"""]]
diff --git a/doc/ikiwiki/directive/commentmoderation.mdwn b/doc/ikiwiki/directive/commentmoderation.mdwn
new file mode 100644 (file)
index 0000000..8553b5b
--- /dev/null
@@ -0,0 +1,9 @@
+The `commentmoderation` directive is supplied by the
+[[!iki plugins/comments desc=comments]] plugin, and is used to link
+to the comment moderation queue.
+
+Example:
+
+       \[[!commentmoderation desc="here is the comment moderation queue"]]
+
+[[!meta robots="noindex, follow"]]
index 6a323ade01769b898e3fb9457425c3f89d7fef7c..d38b1208b5a1cf2449410c9e515094b34cd66262 100644 (file)
@@ -149,6 +149,7 @@ Personal sites and blogs
 * [Daniel Wayne Armstrong](http://circuidipity.com/)
 * [Mukund](https://www.mukund.org/)
 * [Nicolas Schodet](http://ni.fr.eu.org/)
+* [weakish](http://weakish.github.com)
 
 Please feel free to add your own ikiwiki site!
 
diff --git a/doc/news/version_3.20100515.mdwn b/doc/news/version_3.20100515.mdwn
deleted file mode 100644 (file)
index 043346c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-News for ikiwiki 3.20100515:
-
-   There are two significant changes to the page.tmpl template in this version.
-   If you have a locally modified version of that template, you will need to
-   update it at least to contain the following in the HTML `<head>`:
-
-       <TMPL_IF DYNAMIC>
-       <TMPL_IF FORCEBASEURL><base href="<TMPL_VAR FORCEBASEURL>" /><TMPL_ELSE>
-       <TMPL_IF BASEURL><base href="<TMPL_VAR BASEURL>" /></TMPL_IF>
-       </TMPL_IF>
-       </TMPL_IF>
-
-   Also, the footer should be wrapped in `<TMPL_UNLESS DYNAMIC> ... </TMPL_UNLESS>`
-
-   There is a new "comment()" pagespec, that can be used to match a
-   comment on a page. It is recommended to use it instead of the old
-   method of using a pagespec such as "internal(comment\_*)" to match
-   things that looked like comments. The old pagespec will now also match
-   comments that are held for moderation; likely not what you want.
-
-   There have also been some changes to the style.css in this version,
-   particularly to support the new openid selector. If you have a modified
-   version, of style.css, updating it (or moving it to local.css) is
-   recommended.
-
-ikiwiki 3.20100515 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
-   * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise
-     a single template, page.tmpl.
-   * If you have a locally customised page.tmpl, it needs to be updated
-     to set &lt;base&gt; when BASEURL or FORCEBASEURL is set.
-   * comments: Comments pending moderation are now stored in the srcdir
-     alongside accepted comments, but with a `._comment_pending` extension.
-     This allows easier byhand moderation, as the "\_pending" need
-     only be stripped off and the comment be committed to version control.
-   * The `comment_pending()` pagespec can be used to match such unmoderated
-     comments, which makes it easy to add a feed of them, or a counter
-     indicating how many there are.
-   * Belatedly added a `comment()` pagespec.
-   * Gave comment and page editing forms some CSS and accessability love.
-   * Renamed postscan hook to indexhtml, to reflect its changed position,
-     and typical use.
-   * inline: Call indexhtml when inlining internal pages, so their
-     text can be indexed for searching.
-   * Delete hooks are passed deleted internal pages.
-   * openid: Incorporated a fancy openid-selector signin form.
-     (Based on <http://code.google.com/p/openid-selector/>)
-   * openid: Use "openid\_identifier" as the form field, as required
-     by OpenID Authentication v2.0 spec.
-   * Removed the openidsignup option. Instead, my recommendation is to
-     leave passwordauth enabled and let people who don't have an openid use it.
-     The openid selector form avoids the UI annoyance of having both openid
-     and passwordauth on one form.
-   * calendar: Allow negative month to be specified. -1 is last month, etc.
-     (And also negative years.)
-   * calendar: Display year in title of month calendar.
-   * Use xhtml friendly pubdate setting.
-   * remove, rename: Add guards against XSRF attacks."""]]
diff --git a/doc/news/version_3.20100704.mdwn b/doc/news/version_3.20100704.mdwn
new file mode 100644 (file)
index 0000000..9d2792c
--- /dev/null
@@ -0,0 +1,26 @@
+ikiwiki 3.20100704 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+   * Changes to avoid display of ugly google openids, by displaying
+     a username taken from openid.
+   * API: Add new optional field nickname to rcs\_recentchanges.
+   * API: rcs\_commit and rcs\_commit\_staged are now passed named
+     parameters.
+   * openid: Store nickname based on username or email provided from
+     openid provider.
+   * git: Record the nickname from openid in the git author email.
+   * comment: Record the username from openid in the comment page.
+   * Fixed some confusion and bugginess about whether
+     rcs\_getctime/rcs\_getmtime were passed absolute or relative filenames.
+     (Make it relative like everything else.)
+   * hnb: Fixed broken use of mkstemp that had caused dangling temp files,
+     and prevented actually rendering hnb files.
+   * Use comment template on comments page of example blog.
+   * comment.tmpl: Fix up display when inline uses it to display a non-comment
+     page. (Such as a discussion page.)
+   * git: Added git\_wrapper\_background\_command option. Can be used to eg,
+     make the git wrapper push to github in the background after ikiwiki
+     runs.
+   * po: Added needstranslation() pagespec. (intrigeri)
+   * po: Added support for .html source pages. (intrigeri)
+   * comment: Fix problem moderating comments of certian pages with utf-8
+     in their name."""]]
\ No newline at end of file
index bb828b05ca6a660ba9abe260d6c91f6feb0c07e6..2925b6fba6633ab0ff19197e3df41197c0577e3f 100644 (file)
@@ -5,9 +5,13 @@ This plugin allows content from other feeds to be aggregated into the
 wiki. To specify feeds to aggregate, use the
 [[ikiwiki/directive/aggregate]] [[ikiwiki/directive]].
 
-The [[meta]] and [[tag]] plugins are also recommended. Either the
-[[htmltidy]] or [[htmlbalance]] plugin is suggested, since feeds can easily
-contain html problems, some of which these plugins can fix.
+## requirements
+
+The [[meta]] and [[tag]] plugins are also recommended to be used with this
+one. Either the [[htmltidy]] or [[htmlbalance]] plugin is suggested, since
+feeds can easily contain html problems, some of which these plugins can fix.
+
+## triggering aggregation
 
 You will need to run ikiwiki periodically from a cron job, passing it the
 --aggregate parameter, to make it check for new posts. Here's an example
@@ -15,6 +19,11 @@ crontab entry:
 
        */15 * * * * ikiwiki --setup my.wiki --aggregate --refresh
 
+The plugin updates a file `.ikiwiki/aggregatetime` with the unix time stamp
+when the next aggregation run could occur. (The file may be empty, if no
+aggregation is required.) This can be integrated into more complex cron
+jobs or systems to trigger aggregation only when needed.
+
 Alternatively, you can allow `ikiwiki.cgi` to trigger the aggregation. You
 should only need this if for some reason you cannot use cron, and instead
 want to use a service such as [WebCron](http://webcron.org). To enable
index 45a1d62b55d2c4015383883ec7a07680c4c59e72..3e985948b5bda690ef5b8a53a7cf0205039baa19 100644 (file)
@@ -1 +1,3 @@
 It would be very cool if this plugin was enabled by default.  One of the best ways to learn how to do various advanced things is to be able to "view source" on other wiki's which do things you like.  -- [[AdamShand]]
+
+This plugin requires the cgi plugin.  If you run a static site, you may check the [[repolist]] plugin.  -- [[weakish]]
diff --git a/doc/plugins/goodstuff/discussion.mdwn b/doc/plugins/goodstuff/discussion.mdwn
new file mode 100644 (file)
index 0000000..0ad95c0
--- /dev/null
@@ -0,0 +1 @@
+What is the syntax for enabling plugins in the setup file?
index 2e16cc7c457ae6f802938748da4edac628b4453c..57f04a476094739efe23d9d04d6ef791699dfc1b 100644 (file)
@@ -54,10 +54,10 @@ Supported languages
 `po_slave_languages` is used to set the list of supported "slave"
 languages, such as:
 
-        po_slave_languages => { 'fr' => 'Français',
+        po_slave_languages => [ 'fr' => 'Français',
                                 'es' => 'Español',
                                 'de' => 'Deutsch',
-        }
+        ]
 
 Decide which pages are translatable
 -----------------------------------
@@ -130,7 +130,7 @@ lighttpd
 --------
 
 Recent versions of lighttpd should be able to use
-`$HTTP["language"]` to configure the translatted pages to be served.
+`$HTTP["language"]` to configure the translated pages to be served.
 
 See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119)
 
@@ -213,16 +213,16 @@ preferred `$EDITOR`, without needing to be online.
 Markup languages support
 ------------------------
 
-[[Markdown|mdwn]] is well supported. Some other markup languages supported
-by ikiwiki mostly work, but some pieces of syntax are not rendered
-correctly on the slave pages:
+[[Markdown|mdwn]] and [[html]] are well supported. Some other markup
+languages supported by ikiwiki mostly work, but some pieces of syntax
+are not rendered correctly on the slave pages:
 
 * [[reStructuredText|rst]]: anonymous hyperlinks and internal
   cross-references
 * [[wikitext]]: conversion of newlines to paragraphs
 * [[creole]]: verbatim text is wrapped, tables are broken
-* [[html]] and LaTeX: not supported yet; the dedicated po4a modules
-  could be used to support them, but they would need a security audit
+* LaTeX: not supported yet; the dedicated po4a module
+  could be used to support it, but it would need a security audit
 * other markup languages have not been tested.
 
 Security
@@ -266,6 +266,14 @@ to an array to support this. (If twere done, twere best done quickly.)
 > Done in my po branch, preserving backward compatibility. Please
 > review :) --[[intrigeri]]
 
+>> Right, well my immediate concern is that using an array to hold
+>> hash-like pairs is not very clear to the user. It will be displayed
+>> in a confusing way by websetup; dumping a setup file will probably
+>> also cause it to be formatted in a confusing way. And the code
+>> seems to assume that the array length is even, and probably blows
+>> up if it is not.. and the value is marked safe so websetup can be
+>> used to modify it and break that way too. --[[Joey]] 
+
 Pagespecs
 ---------
 
index 27683f1eae22ddce2fca8c01155fee976f35c273..73858c8189972ce700b9088e09bd0a19799d715c 100644 (file)
@@ -150,6 +150,23 @@ The following analysis was done with his help.
   variables; according to [[Joey]], this is "Freaky code, but seems ok
   due to use of `quotementa`".
 
+##### Locale::Po4a::Xhtml
+
+* does not run any external program
+* does not build regexp's from untrusted variables
+
+=> Seems safe as far as the `includessi` option is disabled; the po
+plugin explicitly disables it.
+
+Relies on Locale::Po4a::Xml` to do most of the work.
+
+##### Locale::Po4a::Xml
+
+* does not run any external program
+* the `includeexternal` option makes it able to read external files;
+  the po plugin explicitly disables it
+* untrusted variables are escaped when used to build regexp's
+
 ##### Text::WrapI18N
 
 `Text::WrapI18N` can cause DoS
index 38fbed6d69bbb5f5826932aebf857cfaff28f834..3c3b03275a471dc572ba68e6e129b077170ee5c2 100644 (file)
@@ -61,8 +61,8 @@ but the backlinks don't show up.
 
 I converted one of my pages to rst:
 
-Before: http://kaizer.se/wiki/kupfer-mdwn  
-After: http://kaizer.se/wiki/kupfer-rst  
+Before: <http://kaizer.se/wiki/kupfer-mdwn>  
+After: <http://kaizer.se/wiki/kupfer-rst>  
 
 I need help on a couple of points
 
index 4c8621f1cad4ca58cba6de91ce90898478a0fb8b..f386adec4be46b08ea570430577c0e4c50f68928 100644 (file)
@@ -1,15 +1,5 @@
 This is the [[SandBox]], a page anyone can edit to try out ikiwiki (version [[!version  ]]).
 
-<<<<<<< HEAD
-Test conflict.
-=======
-Testing 123.
->>>>>>> 8cc8bb52f7913e429be7e14203177ef374645718
-
-# Header
-
-## Subheader2
-
 > This is a blockquote.
 >
 > This is the first level of quoting.
@@ -29,6 +19,7 @@ Numbered list
 1. And another..
  1. foo
  2. bar
+ 3. quz
 
 Bulleted list
 
index 03fed3aa900d67019aa8a44472e5b6d927fc1636..266222cc3aad37950cacee3b88f7f66b5af259a9 100644 (file)
@@ -102,6 +102,12 @@ After making changes to this file, you need to tell ikiwiki to use it:
 
        % ikiwiki -setup foo.setup
 
+Alternatively, you can ask ikiwiki to change settings in the file for you:
+
+       % ikiwiki -changesetup foo.setup -plugin goodstuff
+
+See [[usage]] for more options.
+
 ## Customizing file locations
 
 As a wiki compiler, ikiwiki builds a wiki from files in a source directory,
index bf000dae189ac8d7c12a6780837a422a3773873c..8dd3b1c151905d0c2f8fdae03c0b8bda8c38bf55 100644 (file)
@@ -91,6 +91,10 @@ nav {
        text-align: center;
 }
 
+img.img {
+       margin: 0.5ex;
+}
+
 .align-left {
        float:left;
 }
diff --git a/doc/tips/howto_limit_to_admin_users.mdwn b/doc/tips/howto_limit_to_admin_users.mdwn
new file mode 100644 (file)
index 0000000..4d57932
--- /dev/null
@@ -0,0 +1,9 @@
+Enable [[plugins/lockedit]] in your setup file.
+
+For example:
+
+    add_plugins => [qw{goodstuff table rawhtml template embed typography sidebar img remove lockedit}],
+
+And to only allow admin users to edit the page, simply specify a pagespec for everything in the .setup:
+
+    locked_pages => '*',
index 14d619ff824db3662f497884a4d3e5b9301ba811..caed75ba6fb18356c37dbdf249c6e815a4fdf88c 100644 (file)
@@ -38,6 +38,14 @@ If your version of ikiwiki is not [[!version]], try upgrading. New
 optimisations are frequently added to ikiwiki, some of them yielding
 *enormous* speed increases.
 
+## run ikiwiki in verbose mode
+
+Try changing a page, and run ikiwiki with `-v` so it will tell you
+everything it does to deal with that changed page. Take note of
+which other pages are rebuilt, and which parts of the build take a long
+time. This can help you zero in on individual pages that contain some of
+the expensive things listed below. 
+
 ## expensive inlines
 
 Do you have an archive page for your blog that shows all posts, 
index b83d2814a1ca1896f0e2eb887e7fb76b4b3fcedc..791c6c0554fdb822f37b1389ff6f9ff29abed26c 100644 (file)
@@ -8,3 +8,9 @@ Fixed in my po branch. --[[intrigeri]]
 [[!tag patch]]
 
 > bump?
+
+>> I know I've looked at 88c6e2891593fd508701d728602515e47284180c 
+>> before, and something about it just seemed wrong. Maybe it's
+>> the triviality of the sub, which it would seem to be easy to 
+>> decide to refactor back into its one caller (which would reintroduce the
+>> bug). --[[Joey]] 
index 2f87d60d5080a925ec8b4f98f3a992a3b217a192..840d105d2e5517e579f00ae67efe49f8f3bf3016 100644 (file)
@@ -32,14 +32,22 @@ These options control the mode that ikiwiki operates in.
 
 * --setup setupfile
 
-  In setup mode, ikiwiki reads the config file, which is really a perl
-  program that can call ikiwiki internal functions.
-
   The default action when --setup is specified is to automatically generate
   wrappers for a wiki based on data in a setup file, and rebuild the wiki.
   If you only want to build any changed pages, you can use --refresh with
   --setup.
 
+* --changesetup setupfile
+
+  Reads the setup file, adds any configuration changes specified by other
+  options, and writes the new configuration back to the setup file. Also
+  updates any configured wrappers. In this mode, the wiki is not fully
+  rebuilt, unless you also add --rebuild.
+
+  Example, to enable some plugins:
+
+       ikiwiki --changesetup ~/ikiwiki.setup --plugin goodstuff --plugin calendar
+
 * --dumpsetup setupfile
 
   Causes ikiwiki to write to the specified setup file, dumping out
index ac43044dfcbb6b927de2f83081f9cb67ce6bd384..aa333793836455eb558f9151e43e96d35d5abb63 100755 (executable)
@@ -14,24 +14,32 @@ sub usage () {
            gettext("       ikiwiki --setup configfile"), "\n";
 }
 
+sub setup (@) {
+       require IkiWiki::Setup;
+       my $verbose=$config{verbose};
+       my $syslog=$config{syslog};
+       IkiWiki::Setup::load($_[1]);
+       $config{setupverbose}=$config{verbose};
+       $config{setupsyslog}=$config{syslog};
+       $config{verbose}=$verbose || $config{setupverbose};
+       $config{syslog}=$syslog;
+       $config{setup}=1;
+}
+
 sub getconfig () {
        if (! exists $ENV{WRAPPED_OPTIONS}) {
                %config=defaultconfig();
                eval q{use Getopt::Long};
                Getopt::Long::Configure('pass_through');
                GetOptions(
-                       "setup|s=s" => sub {
-                               require IkiWiki::Setup;
-                               my $verbose=$config{verbose};
-                               my $syslog=$config{syslog};
-                               IkiWiki::Setup::load($_[1]);
-                               $config{setupverbose}=$config{verbose};
-                               $config{setupsyslog}=$config{syslog};
-                               $config{verbose}=$verbose || $config{setupverbose};
-                               $config{syslog}=$syslog;
-                               $config{setup}=1;
-                       },
+                       "setup|s=s" => \&setup,
                        "dumpsetup|s=s" => \$config{dumpsetup},
+                       "changesetup|s=s" => sub {
+                               $config{changesetup}=$_[1];
+                               $config{genwrappers}=1;
+                               $config{refresh}=1;
+                               setup(@_);
+                       },
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "syslog!" => \$config{syslog},
@@ -85,7 +93,8 @@ sub getconfig () {
                                $config{wrappermode}=possibly_foolish_untaint($_[1])
                        },
                        "plugin=s@" => sub {
-                               push @{$config{add_plugins}}, $_[1];
+                               push @{$config{add_plugins}}, $_[1]
+                                       unless grep { $_ eq $_[1] } @{$config{add_plugins}};
                        },
                        "disable-plugin=s@" => sub {
                                push @{$config{disable_plugins}}, $_[1];
@@ -181,6 +190,11 @@ sub main () {
                }
        }
 
+       if ($config{changesetup}) {
+               require IkiWiki::Setup;
+               IkiWiki::Setup::dump($config{changesetup});
+       }
+
        if ($config{dumpsetup}) {
                $config{srcdir}="" if ! defined $config{srcdir};
                $config{destdir}="" if ! defined $config{destdir};
index 9644fd396b9fbcdb4c4dec46ce29b1b05e5d2380..7c2c94376c2f519ea5a9e607c6f30c15cc605e29 100644 (file)
@@ -1,5 +1,5 @@
 Name:           ikiwiki
-Version: 3.20100624
+Version: 3.20100704
 Release:        1%{?dist}
 Summary:        A wiki compiler
 
index e50fa0f68ff4ba13f385074f6876f4b46d2884b2..bb0d6e52631e41a684568cc37797cda10a3dd7c7 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-06-23 17:10-0400\n"
+"POT-Creation-Date: 2010-07-04 16:46-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -52,7 +52,7 @@ msgstr ""
 msgid "You are banned."
 msgstr ""
 
-#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1317
+#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1324
 msgid "Error"
 msgstr ""
 
@@ -231,36 +231,36 @@ msgstr ""
 msgid "comments on page '%s' are closed"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:491
+#: ../IkiWiki/Plugin/comments.pm:495
 msgid "comment stored for moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:493
+#: ../IkiWiki/Plugin/comments.pm:497
 msgid "Your comment will be posted after moderator review"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:506
+#: ../IkiWiki/Plugin/comments.pm:510
 msgid "Added a comment"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:510
+#: ../IkiWiki/Plugin/comments.pm:514
 #, perl-format
 msgid "Added a comment: %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:554 ../IkiWiki/Plugin/websetup.pm:268
+#: ../IkiWiki/Plugin/comments.pm:558 ../IkiWiki/Plugin/websetup.pm:268
 msgid "you are not logged in as an admin"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:605
+#: ../IkiWiki/Plugin/comments.pm:610
 msgid "Comment moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:645
+#: ../IkiWiki/Plugin/comments.pm:650
 msgid "comment moderation"
 msgstr ""
 
-#: ../IkiWiki/Plugin/comments.pm:802
+#: ../IkiWiki/Plugin/comments.pm:807
 #, perl-format
 msgid "%i comment"
 msgid_plural "%i comments"
@@ -270,7 +270,7 @@ msgstr[1] ""
 #. translators: Here "Comment" is a verb;
 #. translators: the user clicks on it to
 #. translators: post a comment.
-#: ../IkiWiki/Plugin/comments.pm:812
+#: ../IkiWiki/Plugin/comments.pm:817
 msgid "Comment"
 msgstr ""
 
@@ -356,18 +356,18 @@ msgstr ""
 msgid "%s is an attachment, not a page."
 msgstr ""
 
-#: ../IkiWiki/Plugin/git.pm:724 ../IkiWiki/Plugin/git.pm:742
+#: ../IkiWiki/Plugin/git.pm:740 ../IkiWiki/Plugin/git.pm:758
 #: ../IkiWiki/Receive.pm:129
 #, perl-format
 msgid "you are not allowed to change %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/git.pm:764
+#: ../IkiWiki/Plugin/git.pm:780
 #, perl-format
 msgid "you cannot act on a file with mode %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/git.pm:768
+#: ../IkiWiki/Plugin/git.pm:784
 msgid "you are not allowed to change file modes"
 msgstr ""
 
@@ -655,26 +655,26 @@ msgstr ""
 msgid "N/A"
 msgstr ""
 
-#: ../IkiWiki/Plugin/po.pm:953
+#: ../IkiWiki/Plugin/po.pm:951
 #, perl-format
 msgid "failed to translate %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/po.pm:1037
+#: ../IkiWiki/Plugin/po.pm:1035
 msgid "removed obsolete PO files"
 msgstr ""
 
-#: ../IkiWiki/Plugin/po.pm:1094 ../IkiWiki/Plugin/po.pm:1108
-#: ../IkiWiki/Plugin/po.pm:1147
+#: ../IkiWiki/Plugin/po.pm:1092 ../IkiWiki/Plugin/po.pm:1104
+#: ../IkiWiki/Plugin/po.pm:1143
 #, perl-format
 msgid "failed to write %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/po.pm:1106
+#: ../IkiWiki/Plugin/po.pm:1102
 msgid "failed to translate"
 msgstr ""
 
-#: ../IkiWiki/Plugin/po.pm:1159
+#: ../IkiWiki/Plugin/po.pm:1155
 msgid "invalid gettext data, go back to previous page to continue edit"
 msgstr ""
 
@@ -1128,13 +1128,13 @@ msgid "wrapper filename not specified"
 msgstr ""
 
 #. translators: The parameter is a C filename.
-#: ../IkiWiki/Wrapper.pm:160
+#: ../IkiWiki/Wrapper.pm:198
 #, perl-format
 msgid "failed to compile %s"
 msgstr ""
 
 #. translators: The parameter is a filename.
-#: ../IkiWiki/Wrapper.pm:180
+#: ../IkiWiki/Wrapper.pm:218
 #, perl-format
 msgid "successfully generated %s"
 msgstr ""
@@ -1171,39 +1171,39 @@ msgstr ""
 msgid "Discussion"
 msgstr ""
 
-#: ../IkiWiki.pm:531
+#: ../IkiWiki.pm:538
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
 
-#: ../IkiWiki.pm:577
+#: ../IkiWiki.pm:584
 msgid "cannot use multiple rcs plugins"
 msgstr ""
 
-#: ../IkiWiki.pm:607
+#: ../IkiWiki.pm:614
 #, perl-format
 msgid "failed to load external plugin needed for %s plugin: %s"
 msgstr ""
 
-#: ../IkiWiki.pm:1299
+#: ../IkiWiki.pm:1306
 #, perl-format
 msgid "preprocessing loop detected on %s at depth %i"
 msgstr ""
 
-#: ../IkiWiki.pm:1994
+#: ../IkiWiki.pm:2001
 msgid "yes"
 msgstr ""
 
-#: ../IkiWiki.pm:2071
+#: ../IkiWiki.pm:2078
 #, perl-format
 msgid "invalid sort type %s"
 msgstr ""
 
-#: ../IkiWiki.pm:2092
+#: ../IkiWiki.pm:2099
 #, perl-format
 msgid "unknown sort type %s"
 msgstr ""
 
-#: ../IkiWiki.pm:2228
+#: ../IkiWiki.pm:2235
 #, perl-format
 msgid "cannot match pages: %s"
 msgstr ""