From 801c59b535e9a1501ac40e8ad2a0423d506c5276 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 14:25:49 -0400 Subject: response --- doc/plugins/contrib/ymlfront/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index b1fd65fff..bf9780048 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -4,3 +4,9 @@ Now that I have implemented a \[[!ymlfront ...]] directive, I would like to remo * it is non-standard Any objections? + +> Well, I don't have much standing since I have been too lame to integrate +> ymlfront into ikiwiki yet. Buy, my opinion is, I liked the old +> format of putting the YAML literally at the front of the file. It +> seemed to allow parsing the file as YAML, using any arbitrary YAML +> processer. And it was nice how it avoided boilerplate. --[[Joey]] -- cgit v1.2.3 From 827710bb59d04d71bc36ef47bd5fdb66fe128b40 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 15:00:31 -0400 Subject: split out bug report and close --- doc/plugins/po.mdwn | 72 ----------------------------------------------------- 1 file changed, 72 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 91273ba98..da58a9f49 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -246,75 +246,3 @@ TODO [[!inline pages="todo/po:* and !todo/done and !link(todo/done) and !todo/*/*" feeds=no actions=no archive=yes show=0]] - -broken links to translatable basewiki pages that lack po files --------------------------------------------------------------- - -If a page is not translated yet, the "translated" version of it -displays wikilinks to other, existing (but not yet translated?) -pages as edit links, as if those pages do not exist. - -That's really confusing, especially as clicking such a link -brings up an edit form to create a new, english page. - -This is with po_link_to=current or negotiated. With default, it doesn't -happen.. - -Also, this may only happen if the page being linked to is coming from an -underlay, and the underlays lack translation to a given language. ---[[Joey]] - -> Any simple testcase to reproduce it, please? I've never seen this -> happen yet. --[[intrigeri]] - ->> Sure, go here ->> (Currently 0% translateed) and see the 'WikiLink' link at the bottom, ->> which goes to ->> Compare with eg, the 100% translated Dansk version, where ->> the WikiLink link links to the English WikiLink page. --[[Joey]] - ->>> Seems not related to the page/string translation status: the 0% ->>> translated Spanish version has the correct link, just like the ->>> Dansk version => I'm changing the bug title accordingly. ->>> ->>> I tested forcing the sv html page to be rebuilt by translating a ->>> string in it, it did not fix the bug. I did the same for the ->>> Spanish page, it did not introduce the bug. So this is really ->>> weird. ->>> ->>> The smiley underlay seems to be the only place where the wrong ->>> thing happens: the basewiki underlay has similar examples ->>> that do not exhibit this bug. An underlay linking to another might ->>> be necessary to reproduce it. Going to dig deeper. --[[intrigeri]] - ->>>> After a few hours lost in the Perl debugger, I think I have found ->>>> the root cause of the problem: in l10n wiki's configured ->>>> `underlaydir`, the basewiki is present in every slave language ->>>> that is enabled for this wiki *but* Swedish. With such a ->>>> configuration, the `ikiwiki/wikilink` page indeed does not exist ->>>> in Swedish language: no `ikiwiki/wikilink.sv.po` can be found ->>>> where ikiwiki is looking. Have a look to ->>>> , the basewiki is not ->>>> available in Swedish language on this wiki. So this is not a po ->>>> bug, but a configuration or directories layout issue. This is ->>>> solved by adding the Swedish basewiki to the underlay dir, which ->>>> is I guess not a possibility in the l10n wiki context. I guess ->>>> this could be solved by adding `SRCDIR/basewiki` as an underlay ->>>> to your l10n wiki configuration, possibly using the ->>>> `add_underlays` configuration directive. --[[intrigeri]] - ->>>>> There is no complete Swedish underlay translation yet, so it is not ->>>>> shipped in ikiwiki. I don't think it's a misconfiguration to use ->>>>> a language that doesn't have translated underlays. --[[Joey]] - ->>>>>> Ok. The problem is triggered when using a language that doesn't ->>>>>> have translated underlays, *and* defining ->>>>>> `po_translatable_pages` in a way that renders the base wiki ->>>>>> pages translatable in po's view of things, which in turns makes ->>>>>> the po plugin act as if the translation pages did exist, ->>>>>> although they do not in this case. I still need to have a deep ->>>>>> look at the underlays-related code you added to `po.pm` a while ->>>>>> ago. Stay tuned. --[[intrigeri]] - ->>>>>>> Fixed in my po branch, along with other related small bugs that ->>>>>>> happen in the very same situation only. --[[intrigeri]] -- cgit v1.2.3 From d085d1ac5db888e95de5a43f818a13570bc4771b Mon Sep 17 00:00:00 2001 From: "http://oblomov.myopenid.com/" Date: Mon, 30 Aug 2010 19:29:31 +0000 Subject: ymlfront vs MMD --- doc/plugins/contrib/ymlfront/discussion.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index bf9780048..03af5e634 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -10,3 +10,9 @@ Any objections? > format of putting the YAML literally at the front of the file. It > seemed to allow parsing the file as YAML, using any arbitrary YAML > processer. And it was nice how it avoided boilerplate. --[[Joey]] + +>> The old delimited format also has the advantage of being remarkably similar to the +>> [MultiMarkDown](http://fletcherpenney.net/multimarkdown/users_guide/multimarkdown_syntax_guide/) +>> way of including metadata in documents. The only difference is that MMD doesn't expect the +>> triple-dash separators, but I'm thinking about submitting a patch to MMD to actually support +>> that syntax. --GB -- cgit v1.2.3 From 2eb04d8b4178f920996b0f74c953e956761a8f0b Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 31 Aug 2010 12:36:50 +0000 Subject: keeping triple-dash as default, but making it configurable --- doc/plugins/contrib/ymlfront/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index 03af5e634..b30c2da37 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -16,3 +16,6 @@ Any objections? >> way of including metadata in documents. The only difference is that MMD doesn't expect the >> triple-dash separators, but I'm thinking about submitting a patch to MMD to actually support >> that syntax. --GB + +>>> Yes, the idea was to allow the file to be parsed as YAML, you're right. I just found that I tended to have problems when people used "---" for horizontal rules. However, I have also found that trying to keep it solely as an IkiWiki directive doesn't work either, since sometimes the meta-data I need also contained "]]" which broke the parsing of the directive. +>>> So I have decided to go for a compromise, and make the delimiter configurable, rather than hardcoded as "---"; the triple-dash is the default, but it can be configured to be something else instead. I haven't pushed the change yet, but I have written it, and it seems to work. -- [[KathrynAndersen]] -- cgit v1.2.3 From 3e7605d146c73ae283b6a00c1d6d84448805a121 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 31 Aug 2010 19:39:03 +0200 Subject: more on ymlfront vs MMD --- doc/plugins/contrib/ymlfront/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index b30c2da37..0b58982ff 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -19,3 +19,11 @@ Any objections? >>> Yes, the idea was to allow the file to be parsed as YAML, you're right. I just found that I tended to have problems when people used "---" for horizontal rules. However, I have also found that trying to keep it solely as an IkiWiki directive doesn't work either, since sometimes the meta-data I need also contained "]]" which broke the parsing of the directive. >>> So I have decided to go for a compromise, and make the delimiter configurable, rather than hardcoded as "---"; the triple-dash is the default, but it can be configured to be something else instead. I haven't pushed the change yet, but I have written it, and it seems to work. -- [[KathrynAndersen]] + +>>>> I'm not sure about what kind of problems you're meeting with "---" being used +>>>> for horizontal rules: isn't it sufficient to just check that (1) the triple-dash +>>>> is the first thing in the page and (2) there are only YAML-style assignments +>>>> (and no blank lines) between the two markers? Check #2 would also be enough to +>>>> support MMD-style metadata, which means (a) no start marker and (b) empty line +>>>> to mark the end of the metadata block. Would this be supported by the plugin? +>>>> --GB -- cgit v1.2.3 From 2a1077f8869ca65b49e09d99a76b595d90b28499 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 1 Sep 2010 10:09:44 +0000 Subject: YAML is YAML --- doc/plugins/contrib/ymlfront/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index 0b58982ff..b122294bb 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -27,3 +27,5 @@ Any objections? >>>> support MMD-style metadata, which means (a) no start marker and (b) empty line >>>> to mark the end of the metadata block. Would this be supported by the plugin? >>>> --GB + +>>>>> Since I allow all legal YAML, the only way to check if it is legal YAML is to use the YAML parser, by which time one is already parsing the YAML, so it seems a bit pointless to check before one does so. -- KA -- cgit v1.2.3 From edb256d2d8c59754e074f71f24644d57442a24e9 Mon Sep 17 00:00:00 2001 From: Changaco Date: Sat, 4 Sep 2010 14:04:51 +0000 Subject: added a patch to make it more like MediaWiki --- doc/plugins/contrib/headinganchors/discussion.mdwn | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/headinganchors/discussion.mdwn b/doc/plugins/contrib/headinganchors/discussion.mdwn index 91fe04a6d..151af8d92 100644 --- a/doc/plugins/contrib/headinganchors/discussion.mdwn +++ b/doc/plugins/contrib/headinganchors/discussion.mdwn @@ -1 +1,33 @@ Isn't this functionality a part of what [[plugins/toc]] needs and does? Then probably the [[plugins/toc]] plugin's code could be split into the part that implements the [[plugins/contrib/headinganchors]]'s functionality and the TOC generation itself. That will bring more order into the code and the set of available plugins. --Ivan Z. + +--- + +A patch to make it more like MediaWiki: + +
--- headinganchors.pm
++++ headinganchors.pm
+@@ -5,6 +5,7 @@
+ use warnings;
+ use strict;
+ use IkiWiki 2.00;
++use URI::Escape;
+ 
+ sub import {
+         hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
+@@ -14,9 +15,11 @@
+         my $str = shift;
+         $str =~ s/^\s+//;
+         $str =~ s/\s+$//;
+-        $str = lc($str);
+-        $str =~ s/[&\?"\'\.,\(\)!]//mig;
+-        $str =~ s/[^a-z]/_/mig;
++        $str =~ s/\s/_/g;
++        $str =~ s/"//g;
++        $str =~ s/^[^a-zA-Z]/z-/; # must start with an alphabetical character
++        $str = uri_escape_utf8($str);
++        $str =~ s/%/./g;
+         return $str;
+ }
+ 
+ +--Changaco -- cgit v1.2.3 From 8a6f4a7e50c247c061fd74b535d0f292aca6bda7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 7 Sep 2010 12:08:59 -0400 Subject: needsbuild hook interface changed; the hooks should now return the modified array of things that need built. (Backwards compatability code keeps plugins using the old interface working.) --- IkiWiki/Plugin/aggregate.pm | 2 ++ IkiWiki/Plugin/calendar.pm | 1 + IkiWiki/Plugin/edittemplate.pm | 2 ++ IkiWiki/Plugin/listdirectives.pm | 2 ++ IkiWiki/Plugin/meta.pm | 1 + IkiWiki/Plugin/pinger.pm | 1 + IkiWiki/Plugin/po.pm | 2 ++ IkiWiki/Plugin/skeleton.pm.example | 4 ++++ IkiWiki/Plugin/theme.pm | 1 + IkiWiki/Plugin/version.pm | 1 + IkiWiki/Render.pm | 5 ++++- debian/changelog | 8 ++++++++ doc/plugins/write.mdwn | 4 ++-- 13 files changed, 31 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 7789c4c2a..fe53d868d 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -210,6 +210,8 @@ sub needsbuild (@) { markunseen($feed->{sourcepage}); } } + + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index bb995d499..c7d2b7c01 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -491,6 +491,7 @@ sub needsbuild (@) { } } } + return $needsbuild; } 1 diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 226f83bb4..4f07866e4 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -41,6 +41,8 @@ sub needsbuild (@) { } } } + + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Plugin/listdirectives.pm b/IkiWiki/Plugin/listdirectives.pm index 8a67f7160..835e25388 100644 --- a/IkiWiki/Plugin/listdirectives.pm +++ b/IkiWiki/Plugin/listdirectives.pm @@ -64,6 +64,8 @@ sub needsbuild (@) { } } } + + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index d18585d3d..5941e3f3f 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -37,6 +37,7 @@ sub needsbuild (@) { } } } + return $needsbuild; } sub scrub ($$) { diff --git a/IkiWiki/Plugin/pinger.pm b/IkiWiki/Plugin/pinger.pm index c20ecb5d4..cc9f52d2b 100644 --- a/IkiWiki/Plugin/pinger.pm +++ b/IkiWiki/Plugin/pinger.pm @@ -45,6 +45,7 @@ sub needsbuild (@) { } } } + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f3530faf3..7b62092e1 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -221,6 +221,8 @@ sub needsbuild () { foreach my $master (keys %translations) { map add_depends($_, $master), values %{otherlanguages_pages($master)}; } + + return $needsbuild; } sub scan (@) { diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index 341d67867..7974d5e53 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -73,7 +73,11 @@ sub refresh () { } sub needsbuild ($) { + my $needsbuild=shift; + debug("skeleton plugin needsbuild"); + + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm index 03b0816ed..ee94547e9 100644 --- a/IkiWiki/Plugin/theme.pm +++ b/IkiWiki/Plugin/theme.pm @@ -60,6 +60,7 @@ sub needsbuild ($) { $wikistate{theme}{currenttheme}=$config{theme}; } + return $needsbuild; } 1 diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index c13643478..fc265526c 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -37,6 +37,7 @@ sub needsbuild (@) { } } } + return $needsbuild; } sub preprocess (@) { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 9921915b4..0dbe9611a 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -759,7 +759,10 @@ sub refresh () { my ($new, $internal_new)=find_new_files($files); my ($del, $internal_del)=find_del_files($pages); my ($changed, $internal_changed)=find_changed($files); - run_hooks(needsbuild => sub { shift->($changed) }); + run_hooks(needsbuild => sub { + my $ret=shift->($changed); + $changed=$ret if ref $ret eq 'ARRAY'; + }); my $oldlink_targets=calculate_old_links($changed, $del); foreach my $file (@$changed) { diff --git a/debian/changelog b/debian/changelog index 81bd99a71..430bd302c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ikiwiki (3.20100832) UNRELEASED; urgency=low + + * needsbuild hook interface changed; the hooks should now return + the modified array of things that need built. (Backwards compatability + code keeps plugins using the old interface working.) + + -- Joey Hess Tue, 07 Sep 2010 12:08:05 -0400 + ikiwiki (3.20100831) unstable; urgency=low * filecheck: Fall back to using the file command if the freedesktop diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 10b4df835..31bb64e68 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -179,8 +179,8 @@ function is passed no values. This allows a plugin to manipulate the list of files that need to be built when the wiki is refreshed. The function is passed a reference to an -array of files that will be rebuilt, and can modify the array, either -adding or removing files from it. +array of files that will be rebuilt. It should return an array reference +that is a modified version of its input. It can add or remove files from it. ### scan -- cgit v1.2.3 From fbfda5ccfce40d3f0b5a6076ef02f07e9e5b8fd6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Sep 2010 13:13:00 -0400 Subject: po: Make the po_master_language use a langpair like "en|English", so it can be configured via the web. --- IkiWiki/Plugin/po.pm | 81 ++++++++++++++++++++++++++++++++-------------------- debian/changelog | 2 ++ doc/plugins/po.mdwn | 2 +- 3 files changed, 53 insertions(+), 32 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 651c98ed7..a233fb5af 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -25,6 +25,7 @@ use File::Temp; use Memoize; use UNIVERSAL; +my ($master_language_code, $master_language_name); my %translations; my @origneedsbuild; my %origsubs; @@ -95,10 +96,7 @@ sub getsetup () { }, po_master_language => { type => "string", - example => { - 'code' => 'en', - 'name' => 'English' - }, + example => "en|English", description => "master language (non-PO files)", safe => 1, rebuild => 1, @@ -132,24 +130,31 @@ sub getsetup () { } sub checkconfig () { - foreach my $field (qw{po_master_language}) { - if (! exists $config{$field} || ! defined $config{$field}) { - error(sprintf(gettext("Must specify %s when using the %s plugin"), - $field, 'po')); + if (exists $config{po_master_language}) { + if (! ref $config{po_master_language}) { + ($master_language_code, $master_language_name)= + splitlangpair($config{po_master_language}); } + else { + $master_language_code=$config{po_master_language}{code}; + $master_language_name=$config{po_master_language}{name}; + } + } + if (! defined $master_language_code) { + $master_language_code='en'; + } + if (! defined $master_language_name) { + $master_language_name='English'; } if (ref $config{po_slave_languages} eq 'ARRAY') { my %slaves; foreach my $pair (@{$config{po_slave_languages}}) { - my ($code, $name) = ( $pair =~ /^([a-z]{2})\|(.+)$/ ); - if (!defined $code || !defined $name) { - error(sprintf(gettext("%s has invalid syntax: must use CODE|NAME"), - $pair)); + my ($code, $name)=splitlangpair($pair); + if (defined $code) { + push @slavelanguages, $code; + $slaves{$code} = $name; } - $slaves{$code} = $name; - push @slavelanguages, $code; - } $config{po_slave_languages} = \%slaves; } @@ -159,12 +164,12 @@ sub checkconfig () { } keys %{$config{po_slave_languages}}; } - delete $config{po_slave_languages}{$config{po_master_language}{code}};; + delete $config{po_slave_languages}{$master_language_code}; map { islanguagecode($_) or error(sprintf(gettext("%s is not a valid language code"), $_)); - } ($config{po_master_language}{code}, @slavelanguages); + } ($master_language_code, @slavelanguages); if (! exists $config{po_translatable_pages} || ! defined $config{po_translatable_pages}) { @@ -198,11 +203,11 @@ sub checkconfig () { if -d "$config{underlaydirbase}/po/$ll/$underlay"; } - if ($config{po_master_language}{code} ne 'en') { + if ($master_language_code ne 'en') { # Add underlay containing translated source files # for the master language. - add_underlay("locale/$config{po_master_language}{code}/$underlay") - if -d "$config{underlaydirbase}/locale/$config{po_master_language}{code}/$underlay"; + add_underlay("locale/$master_language_code/$underlay") + if -d "$config{underlaydirbase}/locale/$master_language_code/$underlay"; } } } @@ -512,7 +517,7 @@ sub formbuilder_setup (@) { if ($form->field("do") eq "create") { # Warn the user: new pages must be written in master language. my $template=template("pocreatepage.tmpl"); - $template->param(LANG => $config{po_master_language}{name}); + $template->param(LANG => $master_language_name); $form->tmpl_param(message => $template->output); } elsif ($form->field("do") eq "edit") { @@ -601,7 +606,7 @@ sub mybeautify_urlpath ($) { my $res=$origsubs{'beautify_urlpath'}->($url); if (defined $config{po_link_to} && $config{po_link_to} eq "negotiated") { - $res =~ s!/\Qindex.$config{po_master_language}{code}.$config{htmlext}\E$!/!; + $res =~ s!/\Qindex.$master_language_code.$config{htmlext}\E$!/!; $res =~ s!/\Qindex.$config{htmlext}\E$!/!; map { $res =~ s!/\Qindex.$_.$config{htmlext}\E$!/!; @@ -824,7 +829,7 @@ sub lang ($) { if (1 < (my ($masterpage, $lang) = _istranslation($page))) { return $lang; } - return $config{po_master_language}{code}; + return $master_language_code; } sub islanguagecode ($) { @@ -837,7 +842,7 @@ sub otherlanguage_page ($$) { my $page=shift; my $code=shift; - return masterpage($page) if $code eq $config{po_master_language}{code}; + return masterpage($page) if $code eq $master_language_code; return masterpage($page) . '.' . $code; } @@ -851,9 +856,9 @@ sub otherlanguages_codes ($) { return \@ret unless istranslation($page) || istranslatable($page); my $curlang=lang($page); foreach my $lang - ($config{po_master_language}{code}, @slavelanguages) { + ($master_language_code, @slavelanguages) { next if $lang eq $curlang; - if ($lang eq $config{po_master_language}{code} || + if ($lang eq $master_language_code || istranslatedto(masterpage($page), $lang)) { push @ret, $lang; } @@ -1008,8 +1013,8 @@ sub percenttranslated ($) { sub languagename ($) { my $code=shift; - return $config{po_master_language}{name} - if $code eq $config{po_master_language}{code}; + return $master_language_name + if $code eq $master_language_code; return $config{po_slave_languages}{$code} if defined $config{po_slave_languages}{$code}; return; @@ -1022,13 +1027,13 @@ sub otherlanguagesloop ($) { 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}, + code => $master_language_code, + language => $master_language_name, master => 1, }; } foreach my $lang (@{otherlanguages_codes($page)}) { - next if $lang eq $config{po_master_language}{code}; + next if $lang eq $master_language_code; my $otherpage = otherlanguage_page($page, $lang); push @ret, { url => urlto_with_orig_beautiful_urlpath($otherpage, $page), @@ -1233,6 +1238,20 @@ sub po4a_options($) { return %options; } +sub splitlangpair ($) { + my $pair=shift; + + my ($code, $name) = ( $pair =~ /^([a-z]{2})\|(.+)$/ ); + if (! defined $code || ! defined $name || + ! length $code || ! length $name) { + # not a fatal error to avoid breaking if used with web setup + print STDERR sprintf(gettext("%s has invalid syntax: must use CODE|NAME"), + $pair)."\n"; + } + + return $code, $name; +} + # ,---- # | PageSpecs # `---- diff --git a/debian/changelog b/debian/changelog index ebccf4698..72b220a4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ ikiwiki (3.20100832) UNRELEASED; urgency=low perl taint checking happy, but taint checking is disabled. * teximg: Use Unicode UTF-8 encoding by default. Closes: #596067 Thanks, Paul Menzel. + * po: Make the po_master_language use a langpair like "en|English", + so it can be configured via the web. * po: Allow enabling via web setup. -- Joey Hess Tue, 07 Sep 2010 12:08:05 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index da58a9f49..2acbc366a 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -49,7 +49,7 @@ Supported languages `po_master_language` is used to set the "master" language in `ikiwiki.setup`, such as: - po_master_language => { 'code' => 'en', 'name' => 'English' } + po_master_language => 'en|English' `po_slave_languages` is used to set the list of supported "slave" languages, such as: -- cgit v1.2.3 From c4ebdd6f467f3361b1f444d9462e10acdbcf9322 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Sep 2010 17:17:08 -0400 Subject: Pass array of names of files that have been deleted to needsbuild hook as second parameter, to allow for plugins that needs access to this information earlier than the delete hook. --- IkiWiki/Plugin/inline.pm | 5 +++-- IkiWiki/Render.pm | 2 +- debian/changelog | 3 +++ doc/plugins/write.mdwn | 13 +++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 715a3d652..20c5f3bdd 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -570,9 +570,9 @@ sub genfeed ($$$$$@) { } } + my $file=$pagesources{$p}; + my $type=pagetype($file); if ($itemtemplate->query(name => "enclosure")) { - my $file=$pagesources{$p}; - my $type=pagetype($file); if (defined $type) { $itemtemplate->param(content => $pcontent); } @@ -591,6 +591,7 @@ sub genfeed ($$$$$@) { } } else { + next unless defined $type; $itemtemplate->param(content => $pcontent); } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 0dbe9611a..7ea919abc 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -760,7 +760,7 @@ sub refresh () { my ($del, $internal_del)=find_del_files($pages); my ($changed, $internal_changed)=find_changed($files); run_hooks(needsbuild => sub { - my $ret=shift->($changed); + my $ret=shift->($changed, [@$del, @$internal_del]); $changed=$ret if ref $ret eq 'ARRAY'; }); my $oldlink_targets=calculate_old_links($changed, $del); diff --git a/debian/changelog b/debian/changelog index 4b61a12b0..bf294b6d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,9 @@ ikiwiki (3.20100832) UNRELEASED; urgency=low * po: Allow enabling via web setup. * po: Auto-upgrade old format settings to new formats when writing setup file. + * Pass array of names of files that have been deleted to needsbuild hook + as second parameter, to allow for plugins that needs access to this + information earlier than the delete hook. -- Joey Hess Tue, 07 Sep 2010 12:08:05 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 31bb64e68..e60314485 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -177,10 +177,15 @@ function is passed no values. hook(type => "needsbuild", id => "foo", call => \&needsbuild); -This allows a plugin to manipulate the list of files that need to be -built when the wiki is refreshed. The function is passed a reference to an -array of files that will be rebuilt. It should return an array reference -that is a modified version of its input. It can add or remove files from it. +This allows a plugin to observe or even manipulate the list of files that +need to be built when the wiki is refreshed. + +As its first parameter, the function is passed a reference to an array of +files that will be built. It should return an array reference that is a +modified version of its input. It can add or remove files from it. + +The second parameter passed to the function is a reference to an array of +files that have been deleted. ### scan -- cgit v1.2.3 From 57d0ef239b1a153d3c2da50e23c95f43e9b56cc0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Sep 2010 15:39:30 -0400 Subject: update --- doc/plugins/write/external.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write/external.mdwn b/doc/plugins/write/external.mdwn index e30bf2ff3..a3fbe8a2c 100644 --- a/doc/plugins/write/external.mdwn +++ b/doc/plugins/write/external.mdwn @@ -1,7 +1,7 @@ External plugins are standalone, executable programs, that can be written in any language. When ikiwiki starts up, it runs the program, and -communicates with it using [XML RPC][xmlrpc]. If you want to [[write]] an external -plugin, read on.. +communicates with it using [XML RPC][xmlrpc]. If you want to [[write]] an +external plugin, read on.. [xmlrpc]: http://www.xmlrpc.com/ @@ -85,8 +85,8 @@ language as part of their XML RPC interface. XML RPC has a limitation that it does not have a way to pass undef/NULL/None. There is an extension to the protocol that supports this, -but it is not yet available in the [[!cpan XML::RPC]] library used by -ikiwiki. +but it is not yet available in all versions of the [[!cpan XML::RPC]] library +used by ikiwiki. Until the extension is available, ikiwiki allows undef to be communicated over XML RPC by passing a sentinal value, a hash with a single key "null" -- cgit v1.2.3 From 0b59b140071748b6bc0204ac2f367353a74c697e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 12:24:33 -0400 Subject: remove obsolete docs about DefaultLanguage I think this may have made sense when the master language was rendered to index.html, but with it at index.en.html, DefaultLanguage is not needed. --- doc/plugins/po.mdwn | 4 ---- 1 file changed, 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2acbc366a..ca1775f6e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -120,10 +120,6 @@ Add 'Options MultiViews' to the wiki directory's configuration in Apache. When `usedirs` is enabled, one has to set `DirectoryIndex index` for the wiki context. -Setting `DefaultLanguage LL` (replace `LL` with your default MIME -language code) for the wiki context can help to ensure -`bla/page/index.en.html` is served as `Content-Language: LL`. - For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html). lighttpd -- cgit v1.2.3 From ea487472ed05f633e3cd9479b933656309c0d3c8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Sep 2010 18:48:46 -0400 Subject: document settings needed to fix bug --- doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn | 2 +- doc/plugins/po.mdwn | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn index 7acbfe82d..a2b68c4b1 100644 --- a/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn +++ b/doc/bugs/po:_apache_config_serves_index.rss_for_index.mdwn @@ -30,7 +30,7 @@ That should avoid this problem. Update: A non-intrusive fix is to add this to apache configuration. This tunes the "quality" of the rss and atom files, in an apparently currently undocumented way (though someone on #httpd suggested it should get documented). -Result is that apache will prefer serving index.html. --[[Joey]] +Result is that apache will prefer serving index.html. --[[Joey]] [[done]] AddType application/rss+xml;qs=0.8 .rss AddType application/atom+xml;qs=0.8 .atom diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ca1775f6e..f91e44ea3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -117,8 +117,13 @@ serve any page in the client's preferred language, if available. Add 'Options MultiViews' to the wiki directory's configuration in Apache. -When `usedirs` is enabled, one has to set `DirectoryIndex index` for -the wiki context. +When `usedirs` is enabled, you should also set `DirectoryIndex index`. + +These settings are also recommended, in order to avoid serving up rss files +as index pages: + + AddType application/rss+xml;qs=0.8 .rss + AddType application/atom+xml;qs=0.8 .atom For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html). -- cgit v1.2.3 From e22b18aabcb46e3c0eafeb466b51bb3eb18cf1e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Sep 2010 15:47:14 -0400 Subject: template_depends: throw nice error message when template cannot be found plovs reported a crash when templates were not installed properly, with a non-useful error about the template object not being defined. I've audited all uses of template_depends(), and template(), and it makes sense for them to throw an error if the template cannot be found. All code with a user-supplied template catches errors already, to handle template parse failures. It did not make sense for template_file to throw errors, as some code uses it to probe if a template file is available. --- IkiWiki.pm | 8 +++++--- IkiWiki/Plugin/edittemplate.pm | 3 --- IkiWiki/Plugin/inline.pm | 5 +---- IkiWiki/Plugin/template.pm | 7 ++----- doc/plugins/write.mdwn | 2 ++ 5 files changed, 10 insertions(+), 15 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 6da281999..66ae86809 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1769,12 +1769,14 @@ sub template_depends ($$;@) { my $page=shift; my ($filename, $tpage, $untrusted)=template_file($name); + if (! defined $filename) { + error(sprintf(gettext("template %s not found"), $name)) + } + if (defined $page && defined $tpage) { add_depends($page, $tpage); } - - return unless defined $filename; - + my @opts=( filter => sub { my $text_ref = shift; diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm index 4f07866e4..576c94be4 100644 --- a/IkiWiki/Plugin/edittemplate.pm +++ b/IkiWiki/Plugin/edittemplate.pm @@ -132,9 +132,6 @@ sub filltemplate ($$) { # up a template that doesn't work. return "[[!pagetemplate ".gettext("failed to process template:")." $@]]"; } - if (! defined $template) { - return; - } $template->param(name => $page); diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 715a3d652..c00aed299 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -336,10 +336,7 @@ sub preprocess_inline (@) { blind_cache => 1); }; if ($@) { - error gettext("failed to process template:")." $@"; - } - if (! $template) { - error sprintf(gettext("template %s not found"), $params{template}.".tmpl"); + error sprintf(gettext("failed to process template %s"), $params{template}.".tmpl").": $@"; } } my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content')); diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index db26bfe31..3df06e652 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -41,12 +41,9 @@ sub preprocess (@) { blind_cache => 1); }; if ($@) { - error gettext("failed to process template:")." $@"; - } - if (! $template) { - error sprintf(gettext("%s not found"), + error sprintf(gettext("failed to process template %s"), htmllink($params{page}, $params{destpage}, - "/templates/$params{id}")) + "/templates/$params{id}"))." $@"; } $params{basename}=IkiWiki::basename($params{page}); diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index e60314485..d5bd1dd76 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -740,6 +740,8 @@ with no ".tmpl" extension. Template pages are normally looked for in the templates/ directory. If the page name starts with "/", a page elsewhere in the wiki can be used. +If the template is not found, or contains a syntax error, an error is thrown. + ### `template_depends($$;@)` Use this instead of `template()` if the content of a template is being -- cgit v1.2.3 From 9a0d1862f4ffc6c6958d2133881b3984224a11c7 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawnZyXrBJHCbhjyf69drmoWxbsEex_bQhEk" Date: Tue, 28 Sep 2010 19:01:50 +0000 Subject: initial page --- doc/plugins/contrib/imailhide.mdwn | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 doc/plugins/contrib/imailhide.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/imailhide.mdwn b/doc/plugins/contrib/imailhide.mdwn new file mode 100644 index 000000000..7e9a3f995 --- /dev/null +++ b/doc/plugins/contrib/imailhide.mdwn @@ -0,0 +1,60 @@ +[[!template id=plugin name=imailhide author="Peter Vizi"]] +[[!tag mailhide]] + +# Mailhide plugin for Ikiwiki + +This plugin provides the directive mailhide, that uses the [Mailhide +API][1] to protect email addresses from spammers. + +## Dependencies + +The [Captcha::reCAPTCHA::Mailhide][2] perl module is required for this +plugin. + +## Download + +You can get the source code from [github][3]. + +## Installation + +Copy `imailhide.pm` to `/usr/share/perl/5.10.0/IkiWiki/Plugin` or +`~/.ikiwiki/IkiWiki/Plugin`, and enable it in your `.setup` file + + add_plugins => [qw{goodstuff imailhide ....}], + mailhide_public_key => "8s99vSA99fF11mao193LWdpa==", + mailhide_private_key => "6b5e4545326b5e4545326b5e45453223", + mailhide_default_style => "short", + +## Configuration + +### `mailhide_public_key` + +This is your personal public key that you can get at [Google][4]. + +### `mailhide_private_key` + +This is your personal private key that you can get at [Google][4]. + +### `mailhide_default_style` + +As per the recommendation of the [Mailhide API documentation][5], you +can define this as `short` or `long`. The `short` parameter will +result in `john` links, while the `long` parameter +will result in `joh...@example.com`. + +## Parameters + +### `email` + +*Required.* This is the email addres that you want to hide. + +### `style` + +*Optional.* You can set the style parameter individually for each + `mailhide` call. See `mailhide_default_style` for details. + +[1]: http://www.google.com/recaptcha/mailhide/ +[2]: http://search.cpan.org/perldoc?Captcha::reCAPTCHA::Mailhide +[3]: http://github.com/petervizi/imailhide +[4]: http://www.google.com/recaptcha/mailhide/apikey +[5]: http://code.google.com/apis/recaptcha/docs/mailhideapi.html -- cgit v1.2.3 From 219f057e5857c952289fcacd14cf0da91c5262b2 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawnZyXrBJHCbhjyf69drmoWxbsEex_bQhEk" Date: Tue, 28 Sep 2010 19:24:07 +0000 Subject: better tags --- doc/plugins/contrib/imailhide.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/imailhide.mdwn b/doc/plugins/contrib/imailhide.mdwn index 7e9a3f995..3aacef57a 100644 --- a/doc/plugins/contrib/imailhide.mdwn +++ b/doc/plugins/contrib/imailhide.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=imailhide author="Peter Vizi"]] -[[!tag mailhide]] +[[!tag type/widget type/html]] # Mailhide plugin for Ikiwiki -- cgit v1.2.3 From 64c3c0d0deb80c5af69154d0bc06419a2232fb8f Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawnZyXrBJHCbhjyf69drmoWxbsEex_bQhEk" Date: Wed, 29 Sep 2010 10:12:52 +0000 Subject: --- doc/plugins/contrib/imailhide.mdwn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/imailhide.mdwn b/doc/plugins/contrib/imailhide.mdwn index 3aacef57a..3247f57bf 100644 --- a/doc/plugins/contrib/imailhide.mdwn +++ b/doc/plugins/contrib/imailhide.mdwn @@ -1,7 +1,4 @@ -[[!template id=plugin name=imailhide author="Peter Vizi"]] -[[!tag type/widget type/html]] - -# Mailhide plugin for Ikiwiki +# Mailhide Plugin for Ikiwiki This plugin provides the directive mailhide, that uses the [Mailhide API][1] to protect email addresses from spammers. @@ -53,8 +50,13 @@ will result in `joh...@example.com`. *Optional.* You can set the style parameter individually for each `mailhide` call. See `mailhide_default_style` for details. +## Known Issues + +1. [opening new window when displaying email address][6] + [1]: http://www.google.com/recaptcha/mailhide/ [2]: http://search.cpan.org/perldoc?Captcha::reCAPTCHA::Mailhide [3]: http://github.com/petervizi/imailhide [4]: http://www.google.com/recaptcha/mailhide/apikey [5]: http://code.google.com/apis/recaptcha/docs/mailhideapi.html +[6]: http://github.com/petervizi/imailhide/issues#issue/1 -- cgit v1.2.3 From b0483974f5f71bc75f5a4df3e636af246371cbf6 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawnZyXrBJHCbhjyf69drmoWxbsEex_bQhEk" Date: Wed, 29 Sep 2010 10:15:04 +0000 Subject: --- doc/plugins/contrib/imailhide.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/imailhide.mdwn b/doc/plugins/contrib/imailhide.mdwn index 3247f57bf..6009aa012 100644 --- a/doc/plugins/contrib/imailhide.mdwn +++ b/doc/plugins/contrib/imailhide.mdwn @@ -1,3 +1,6 @@ +[[!template id=plugin name=imailhide author="Peter_Vizi"]] +[[!tag type/widget type/html]] + # Mailhide Plugin for Ikiwiki This plugin provides the directive mailhide, that uses the [Mailhide -- cgit v1.2.3 From 3f3aab3793fb471f8a99ed12df1bbad7abdc3455 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Oct 2010 16:22:50 -0400 Subject: document new rcs reversion support functions --- IkiWiki/Plugin/git.pm | 175 ++++++++++++++++++++++---------------------- doc/plugins/write.mdwn | 33 ++++++++- doc/todo/web_reversion.mdwn | 6 ++ 3 files changed, 123 insertions(+), 91 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index a0f9b15a7..33ec00d8a 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -748,73 +748,72 @@ sub git_find_root { } sub git_parse_changes { - my @changes = @_; - - my $subdir = git_find_root(); - my @rets; - foreach my $ci (@changes) { - foreach my $detail (@{ $ci->{'details'} }) { - my $file = $detail->{'file'}; - - # check that all changed files are in the - # subdir - if (length $subdir && - ! ($file =~ s/^\Q$subdir\E//)) { - error sprintf(gettext("you are not allowed to change %s"), $file); - } - - my ($action, $mode, $path); - if ($detail->{'status'} =~ /^[M]+\d*$/) { - $action="change"; - $mode=$detail->{'mode_to'}; - } - elsif ($detail->{'status'} =~ /^[AM]+\d*$/) { - $action="add"; - $mode=$detail->{'mode_to'}; - } - elsif ($detail->{'status'} =~ /^[DAM]+\d*/) { - $action="remove"; - $mode=$detail->{'mode_from'}; - } - else { - error "unknown status ".$detail->{'status'}; - } - - # test that the file mode is ok - if ($mode !~ /^100[64][64][64]$/) { - error sprintf(gettext("you cannot act on a file with mode %s"), $mode); - } - if ($action eq "change") { - if ($detail->{'mode_from'} ne $detail->{'mode_to'}) { - error gettext("you are not allowed to change file modes"); - } - } - - # extract attachment to temp file - if (($action eq 'add' || $action eq 'change') && - ! pagetype($file)) { - - eval q{use File::Temp}; - die $@ if $@; - my $fh; - ($fh, $path)=File::Temp::tempfile("XXXXXXXXXX", UNLINK => 1); - # Ensure we run this in the right place, see comments in rcs_receive. - my $cmd = ($no_chdir ? '' : "cd $config{srcdir} && ") - . "git show $detail->{sha1_to} > '$path'"; - if (system($cmd) != 0) { - error("failed writing temp file '$path'."); - } - } - - push @rets, { - file => $file, - action => $action, - path => $path, - }; - } - } - - return @rets; + my @changes = @_; + + my $subdir = git_find_root(); + my @rets; + foreach my $ci (@changes) { + foreach my $detail (@{ $ci->{'details'} }) { + my $file = $detail->{'file'}; + + # check that all changed files are in the subdir + if (length $subdir && + ! ($file =~ s/^\Q$subdir\E//)) { + error sprintf(gettext("you are not allowed to change %s"), $file); + } + + my ($action, $mode, $path); + if ($detail->{'status'} =~ /^[M]+\d*$/) { + $action="change"; + $mode=$detail->{'mode_to'}; + } + elsif ($detail->{'status'} =~ /^[AM]+\d*$/) { + $action="add"; + $mode=$detail->{'mode_to'}; + } + elsif ($detail->{'status'} =~ /^[DAM]+\d*/) { + $action="remove"; + $mode=$detail->{'mode_from'}; + } + else { + error "unknown status ".$detail->{'status'}; + } + + # test that the file mode is ok + if ($mode !~ /^100[64][64][64]$/) { + error sprintf(gettext("you cannot act on a file with mode %s"), $mode); + } + if ($action eq "change") { + if ($detail->{'mode_from'} ne $detail->{'mode_to'}) { + error gettext("you are not allowed to change file modes"); + } + } + + # extract attachment to temp file + if (($action eq 'add' || $action eq 'change') && + ! pagetype($file)) { + eval q{use File::Temp}; + die $@ if $@; + my $fh; + ($fh, $path)=File::Temp::tempfile("XXXXXXXXXX", UNLINK => 1); + # Ensure we run this in the right place, + # see comments in rcs_receive. + my $cmd = ($no_chdir ? '' : "cd $config{srcdir} && ") + . "git show $detail->{sha1_to} > '$path'"; + if (system($cmd) != 0) { + error("failed writing temp file '$path'."); + } + } + + push @rets, { + file => $file, + action => $action, + path => $path, + }; + } + } + + return @rets; } sub rcs_receive () { @@ -832,7 +831,7 @@ sub rcs_receive () { # are in the master git repo, not the srcdir repo. # The pre-receive hook already puts us in the right place. $no_chdir=1; - push @rets, git_parse_changes(git_commit_info($oldrev."..".$newrev)); + push @rets, git_parse_changes(git_commit_info($oldrev."..".$newrev)); $no_chdir=0; } @@ -840,31 +839,31 @@ sub rcs_receive () { } sub rcs_preprevert (@) { - # Determine what the effects are of reverting the patch with the - # ID given by 'rev'. Returns the same structure as rcs_receive. - # Note test_changes expects 'cgi' and 'session' parameters. - my %params = @_; - my $rev = $params{rev}; + my %params = @_; + my $rev = $params{rev}; - require IkiWiki::Receive; - IkiWiki::Receive::test_changes(%params, changes => [git_parse_changes(git_commit_info($rev, 1))]); + # Note test_changes expects 'cgi' and 'session' parameters. + require IkiWiki::Receive; + IkiWiki::Receive::test_changes(%params, changes => + [git_parse_changes(git_commit_info($rev, 1))]); } sub rcs_revert (@) { - # Try to revert the given patch; returns undef on _success_. - # Same parameters as rcs_commit_staged + 'rev', the patch ID to be - # reverted. - my %params = @_; - my $rev = $params{rev}; + # Try to revert the given patch; returns undef on _success_. + my %params = @_; + my $rev = $params{rev}; - if(run_or_non('git', 'revert', '--no-commit', $rev)) { - debug "Committing revert for patch '$rev'."; - rcs_commit_staged(message => "This reverts commit $rev", @_); - } else { - # No idea what is actually getting reverted, so all we can do is say we failed. - run_or_die('git', 'reset', '--hard'); - return "Failed to revert patch $rev."; - } + if (run_or_non('git', 'revert', '--no-commit', $rev)) { + debug "Committing revert for patch '$rev'."; + rcs_commit_staged(message => + sprintf(gettext("This reverts commit %s"), $rev), @_); + } + else { + # No idea what is actually getting reverted, so all we can + # do is say we failed. + run_or_die('git', 'reset', '--hard'); + return sprintf(gettext("Failed to revert commit %s"), $rev); + } } sub rcs_showpatch (@) { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index d5bd1dd76..1bd3b0f87 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1176,9 +1176,9 @@ sense to implement for all RCSs. It should examine the incoming changes, and do any sanity checks that are appropriate for the RCS to limit changes to safe file adds, -removes, and changes. If something bad is found, it should exit -nonzero, to abort the push. Otherwise, it should return a list of -files that were changed, in the form: +removes, and changes. If something bad is found, it should die, to abort +the push. Otherwise, it should return a list of files that were changed, +in the form: { file => # name of file that was changed @@ -1191,6 +1191,33 @@ files that were changed, in the form: The list will then be checked to make sure that each change is one that is allowed to be made via the web interface. +#### `rcs_preprevert($)` + +This is called by the revert web interface. It is passed a RCS-specific +change ID, and should determine what the effects would be of reverting +that change, and return the same data structure as `rcs_receive`. + +Like `rcs_receive`, it should do whatever sanity checks are appropriate +for the RCS to limit changes to safe changes, and die if a change would +be unsafe to revert. + +#### `rcs_revert(@)` + +This is called by the revert web interface. It is passed a named +parameter rev that is the RCS-specific change ID to revert. + +Addition named parameters: `message`, and `session` (optional). + +It should try to revert the specified rev, which includes committing +the reversion, and returns undef on _success_ and an error message +on failure. + +#### `rcs_showpatch(@)` + +This is passed a named parameter rev that is a RCS-specific +change ID. It should generate a diff-style patch showing the changes +made and return it. + ### PageSpec plugins It's also possible to write plugins that add new functions to diff --git a/doc/todo/web_reversion.mdwn b/doc/todo/web_reversion.mdwn index 34947b710..9e5880558 100644 --- a/doc/todo/web_reversion.mdwn +++ b/doc/todo/web_reversion.mdwn @@ -65,3 +65,9 @@ Peter Gammie has done an initial implementation of the above. >> gets used to check whether attachments are allowed -- there really should be a hook for that. >> >> Please look it over and tell me what else needs fixing... -- [[peteg]] + +>>> I have made my own revert branch and put a few fixes in there. Issues +>>> I noticed but have not gotten to: +>>> +>>> * `rcs_diff` already exists; why add `rcs_showpatch`? +>>> * -- cgit v1.2.3 From 237ea79d715fbba5c1be0b73fbe008b3221975fb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Oct 2010 14:39:10 -0400 Subject: remove rcs_showpatch --- IkiWiki.pm | 4 ---- IkiWiki/Plugin/git.pm | 9 --------- IkiWiki/Plugin/recentchanges.pm | 2 +- doc/plugins/write.mdwn | 6 ------ doc/todo/web_reversion.mdwn | 4 ---- 5 files changed, 1 insertion(+), 24 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 466907c9d..269647eb4 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1949,10 +1949,6 @@ sub rcs_revert (@) { $hooks{rcs}{rcs_revert}{call}->(@_); } -sub rcs_showpatch (@) { - $hooks{rcs}{rcs_showpatch}{call}->(@_); -} - sub add_depends ($$;$) { my $page=shift; my $pagespec=shift; diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 5922494bc..3ccaa446a 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -29,7 +29,6 @@ sub import { hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive); hook(type => "rcs", id => "rcs_preprevert", call => \&rcs_preprevert); hook(type => "rcs", id => "rcs_revert", call => \&rcs_revert); - hook(type => "rcs", id => "rcs_showpatch", call => \&rcs_showpatch); } sub checkconfig () { @@ -865,12 +864,4 @@ sub rcs_revert (@) { } } -sub rcs_showpatch (@) { - # Show the patch with the given revision id. - my %params = @_; - my $rev = $params{rev}; - - return join "\n", run_or_die('git', 'show', $rev); -} - 1 diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 7e71d4fc3..948bb1366 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -117,7 +117,7 @@ sub sessioncgi ($$) { } else { $form->title(sprintf(gettext("confirm reversion of %s"), $rev)); - my $patch_contents = IkiWiki::rcs_showpatch(rev => $rev); + my $patch_contents = IkiWiki::rcs_diff($rev); $form->tmpl_param(patch_contents => encode_entities($patch_contents)); $form->field(name => "rev", type => "hidden", value => $rev, force => 1); IkiWiki::showform($form, $buttons, $session, $q); diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 1bd3b0f87..3eade34ee 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1212,12 +1212,6 @@ It should try to revert the specified rev, which includes committing the reversion, and returns undef on _success_ and an error message on failure. -#### `rcs_showpatch(@)` - -This is passed a named parameter rev that is a RCS-specific -change ID. It should generate a diff-style patch showing the changes -made and return it. - ### PageSpec plugins It's also possible to write plugins that add new functions to diff --git a/doc/todo/web_reversion.mdwn b/doc/todo/web_reversion.mdwn index 33fa79aad..7cb412f79 100644 --- a/doc/todo/web_reversion.mdwn +++ b/doc/todo/web_reversion.mdwn @@ -55,7 +55,6 @@ Peter Gammie has done an initial implementation of the above. > (The data from `rcs_preprevert` could also be used for a confirmation > prompt -- it doesn't currently include enough info for diffs, but at > least could have a list of changed files.) ->> I added `rcs_showpatch` which simply yields the output of `git show `. -- [[peteg]] > > Note that it's possible for a git repo to have commits that modify wiki > files in a subdir, and code files elsewhere. `rcs_preprevert` should @@ -71,9 +70,6 @@ Peter Gammie has done an initial implementation of the above. >>> (and fixed all the indention..). Issues I noticed but have not gotten >>> to: --[[Joey]] >>>> Please change the git pointer above, then. I will work on your branch. -- [[peteg]] ->>> ->>> * `rcs_diff` already exists; why add `rcs_showpatch`? ->>>> If `rcs_diff` is intended for human consumption, by all means we can use that. -- [[peteg]] >>> * Would it be better for `rcs_revert` to not commit, and >>> `rcs_commit_staged` to then be used? This would work for git, but -- cgit v1.2.3 From 238e8b95a5b084e7131d3314b78419b9404cba4c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Oct 2010 15:08:12 -0400 Subject: convert rcs_revert to only stage the reversion --- IkiWiki.pm | 4 ++-- IkiWiki/Plugin/git.pm | 13 ++++--------- IkiWiki/Plugin/recentchanges.pm | 13 +++++++++---- doc/plugins/write.mdwn | 10 ++++------ doc/todo/web_reversion.mdwn | 4 ---- 5 files changed, 19 insertions(+), 25 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index 269647eb4..faf4af5c7 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1941,11 +1941,11 @@ sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } -sub rcs_preprevert (@) { +sub rcs_preprevert ($) { $hooks{rcs}{rcs_preprevert}{call}->(@_); } -sub rcs_revert (@) { +sub rcs_revert ($) { $hooks{rcs}{rcs_revert}{call}->(@_); } diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 3ccaa446a..996ab6fba 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -846,19 +846,14 @@ sub rcs_preprevert (@) { [git_parse_changes(git_commit_info($rev, 1))]); } -sub rcs_revert (@) { - # Try to revert the given patch; returns undef on _success_. - my %params = @_; - my $rev = $params{rev}; +sub rcs_revert ($) { + # Try to revert the given rev; returns undef on _success_. + my $rev = $shift; if (run_or_non('git', 'revert', '--no-commit', $rev)) { - debug "Committing revert for patch '$rev'."; - rcs_commit_staged(message => - sprintf(gettext("This reverts commit %s"), $rev), @_); + return undef; } else { - # No idea what is actually getting reverted, so all we can - # do is say we failed. run_or_die('git', 'reset', '--hard'); return sprintf(gettext("Failed to revert commit %s"), $rev); } diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 439241b93..44c981548 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -101,12 +101,17 @@ sub sessioncgi ($$) { if ($form->submitted eq 'Revert' && $form->validate) { IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); IkiWiki::disable_commit_hook(); - my $r = IkiWiki::rcs_revert( - session => $session, - rev => $rev); + my $r = IkiWiki::rcs_revert($rev); + if (! defined $r) { # success + rcs_commit_staged( + message => sprintf(gettext("This reverts commit %s"), $rev), + session => $session, + rev => $rev, + ); + } IkiWiki::enable_commit_hook(); - if ($r) { + if (defined $r) { die "Revert '$rev' failed."; } else { diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 3eade34ee..dbbe83851 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1201,16 +1201,14 @@ Like `rcs_receive`, it should do whatever sanity checks are appropriate for the RCS to limit changes to safe changes, and die if a change would be unsafe to revert. -#### `rcs_revert(@)` +#### `rcs_revert($)` This is called by the revert web interface. It is passed a named parameter rev that is the RCS-specific change ID to revert. -Addition named parameters: `message`, and `session` (optional). - -It should try to revert the specified rev, which includes committing -the reversion, and returns undef on _success_ and an error message -on failure. +It should try to revert the specified rev, and leave the reversion staged +so `rcs_commit_staged` will complete it. It should return undef on _success_ +and an error message on failure. ### PageSpec plugins diff --git a/doc/todo/web_reversion.mdwn b/doc/todo/web_reversion.mdwn index 7cb412f79..784b72e05 100644 --- a/doc/todo/web_reversion.mdwn +++ b/doc/todo/web_reversion.mdwn @@ -71,10 +71,6 @@ Peter Gammie has done an initial implementation of the above. >>> to: --[[Joey]] >>>> Please change the git pointer above, then. I will work on your branch. -- [[peteg]] ->>> * Would it be better for `rcs_revert` to not commit, and ->>> `rcs_commit_staged` to then be used? This would work for git, but ->>> maybe other RCSs would be problimatic. It would simplifiy the ->>> interface and allow for future mulitple-revert interfaces. >>> * I quite don't understand why one caller of `git_parse_changes` >>> needs it to chdir, and not the other one. It's running >>> in the same git repo either way, and git doesn't need -- cgit v1.2.3 From 84111d96c461a5d31a615ebf64cae751e6fd9aef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 Oct 2010 17:54:12 -0400 Subject: make revert hooks optional I removed the IkiWiki::rcs_ stubs for the revert hooks. Instead recentchanges tests to see if the hooks are available and calls them directly. --- IkiWiki.pm | 8 -------- IkiWiki/Plugin/recentchanges.pm | 9 ++++++--- doc/plugins/write.mdwn | 5 +++-- templates/change.tmpl | 2 ++ 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index faf4af5c7..1f6d70ba3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1941,14 +1941,6 @@ sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } -sub rcs_preprevert ($) { - $hooks{rcs}{rcs_preprevert}{call}->(@_); -} - -sub rcs_revert ($) { - $hooks{rcs}{rcs_revert}{call}->(@_); -} - sub add_depends ($$;$) { my $page=shift; my $pagespec=shift; diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 44c981548..a6d7f9fce 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -93,7 +93,8 @@ sub sessioncgi ($$) { return unless $do eq 'revert' && $rev; - IkiWiki::rcs_preprevert(cgi => $q, session => $session, rev => $rev); + $IkiWiki::hooks{rcs}{rcs_preprevert}{call}->( + cgi => $q, session => $session, rev => $rev); my ($form, $buttons) = confirmation_form($q, $session); IkiWiki::decode_form_utf8($form); @@ -101,7 +102,7 @@ sub sessioncgi ($$) { if ($form->submitted eq 'Revert' && $form->validate) { IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); IkiWiki::disable_commit_hook(); - my $r = IkiWiki::rcs_revert($rev); + my $r = $IkiWiki::hooks{rcs}{rcs_revert}{call}->($rev); if (! defined $r) { # success rcs_commit_staged( message => sprintf(gettext("This reverts commit %s"), $rev), @@ -186,7 +187,9 @@ sub store ($$$) { ]; push @{$change->{pages}}, { link => '...' } if $is_excess; - if (length $config{cgiurl}) { + if (length $config{cgiurl} && + exists $IkiWiki::hooks{rcs}{rcs_preprevert} && + exists $IkiWiki::hooks{rcs}{rcs_revert}) { $change->{reverturl} = IkiWiki::cgiurl( do => "revert", rev => $change->{rev} diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index dbbe83851..6b751f0cd 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1154,8 +1154,6 @@ context, and the whole diff in scalar context. This is used to get the page creation time for a file from the RCS, by looking it up in the history. -It's ok if this is not implemented, and throws an error. - If the RCS cannot determine a ctime for the file, return 0. #### `rcs_getmtime($)` @@ -1210,6 +1208,9 @@ It should try to revert the specified rev, and leave the reversion staged so `rcs_commit_staged` will complete it. It should return undef on _success_ and an error message on failure. +This hook and `rcs_preprevert` are optional, if not implemented, no revert +web interface will be available. + ### PageSpec plugins It's also possible to write plugins that add new functions to diff --git a/templates/change.tmpl b/templates/change.tmpl index 4525402a7..60a9d94b5 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -28,9 +28,11 @@
+ [[revert|wikiicons/revert.png]] +
-- cgit v1.2.3 From 2d99fe0d34be35d9e5d556d530f2d8993007cdf6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 Oct 2010 19:27:28 -0400 Subject: note that recentchanges plugin handles reversions --- doc/plugins/recentchanges.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn index 823f68502..6fff18e8a 100644 --- a/doc/plugins/recentchanges.mdwn +++ b/doc/plugins/recentchanges.mdwn @@ -6,6 +6,8 @@ generates a page describing each recent change made to the wiki. These pages can be joined together with [[inline]] to generate the [[RecentChanges]] page. +This plugin also currently handles web-based reversion of changes. + Typically only the RecentChanges page will use the pages generated by this plugin, but you can use it elsewhere too if you like. It's used like this: -- cgit v1.2.3 From a0b55ac3cd4f840f62d0441e3b1fe9b95ec15007 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawlcaGfdn9Kye1Gc8aGb67PDVQW4mKbQD7E" Date: Tue, 19 Oct 2010 15:13:29 +0000 Subject: setting cookies before aggregating --- doc/plugins/aggregate/discussion.mdwn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/aggregate/discussion.mdwn b/doc/plugins/aggregate/discussion.mdwn index 1a9844577..77005a6a1 100644 --- a/doc/plugins/aggregate/discussion.mdwn +++ b/doc/plugins/aggregate/discussion.mdwn @@ -89,3 +89,30 @@ New bug: new posts aren't getting displayed (or cached for aggregation). After f >>> mind having a copy to investigate. --[[Joey]] >>>> Didn't think of that, will keep a copy if there's a next time. -- [[schmonz]] + +----- + +In a corporate environment where feeds are generally behind +authentication, I need to prime the aggregator's `LWP::UserAgent` +with some cookies. What I've done is write a custom plugin to populate +`$config{cookies}` with an `HTTP::Cookies` object, plus this diff: + + --- /var/tmp/pkg/lib/perl5/vendor_perl/5.10.0/IkiWiki/Plugin/aggregate.pm 2010-06-24 13:03:33.000000000 -0400 + +++ aggregate.pm 2010-06-24 13:04:09.000000000 -0400 + @@ -488,7 +488,11 @@ + } + $feed->{feedurl}=pop @urls; + } + - my $res=URI::Fetch->fetch($feed->{feedurl}); + + my $res=URI::Fetch->fetch($feed->{feedurl}, + + UserAgent => LWP::UserAgent->new( + + cookie_jar => $config{cookies}, + + ), + + ); + if (! $res) { + $feed->{message}=URI::Fetch->errstr; + $feed->{error}=1; + +It works, but I have to remember to apply the diff whenever I update +ikiwiki. Can you provide a more elegant means of allowing cookies and/or +the user agent to be programmatically manipulated? --[[schmonz]] -- cgit v1.2.3 From 91a3b74711df8a74e2d600ba3b0bca8f441d1958 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmZMunnF2szppZKh59QntrdlZDr6BPipiM" Date: Sat, 23 Oct 2010 02:16:00 +0000 Subject: --- doc/plugins/theme.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/theme.mdwn b/doc/plugins/theme.mdwn index 7149cc163..2622abc88 100644 --- a/doc/plugins/theme.mdwn +++ b/doc/plugins/theme.mdwn @@ -9,3 +9,6 @@ inside `/usr/share/ikiwiki/themes/`. A theme provides, via the underlay, an enhanced version of the regular [[style.css]]. This leaves [[local.css]] free for you to further customise. Themes can also provide header and background images. + +You can set the theme via the **theme** option in your config file (after +enabling the plugin). Refresh the wiki after changing it to see the changes. -- cgit v1.2.3 From 577e185b63c6703df1045a7109882e5c3548ab4d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Tue, 26 Oct 2010 17:42:51 +0200 Subject: signal dead link to 'default content for *copyright* and *license*' plugin --- ...fault_content_for___42__copyright__42___and___42__license__42__.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn index b9ad3cc8e..7b7cd9ccd 100644 --- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn +++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn @@ -10,6 +10,8 @@ so I'm now publishing them here. and [`license.pm`](http://www.schwinge.homeip.net/~thomas/tmp/license.pm) +> These links are dead + Usage instructions are found inside the two plugin files. --[[tschwinge]] -- cgit v1.2.3 From 616767191759281cf6c3abdfedaa649a8147761a Mon Sep 17 00:00:00 2001 From: tschwinge Date: Wed, 27 Oct 2010 12:39:34 +0000 Subject: Fix links. DynDNS (which was resolving *.schwinge.homeip.net to my server at home) stopped supporting wildcard CNAMEs *.schwinge.homeip.net, so I now always have to use the canonical name (or pay for getting this back, or go looking for another service provider)... --- ...t_content_for___42__copyright__42___and___42__license__42__.mdwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn index 7b7cd9ccd..ce2779db1 100644 --- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn +++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn @@ -6,11 +6,9 @@ Someone was just asking for it and I had written these two plugins already some months ago, so I'm now publishing them here. -[`copyright.pm`](http://www.schwinge.homeip.net/~thomas/tmp/copyright.pm) +[`copyright.pm`](http://schwinge.homeip.net/~thomas/tmp/copyright.pm) and -[`license.pm`](http://www.schwinge.homeip.net/~thomas/tmp/license.pm) - -> These links are dead +[`license.pm`](http://schwinge.homeip.net/~thomas/tmp/license.pm) Usage instructions are found inside the two plugin files. -- cgit v1.2.3 From a12dd235ea6afff3540da3f5e66e7abbadaa6944 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 27 Oct 2010 14:49:21 +0200 Subject: Fix some more links. DynDNS (which was resolving *.schwinge.homeip.net to my server at home) stopped supporting wildcard CNAMEs *.schwinge.homeip.net, so I now always have to use the canonical name (or pay for getting this back, or go looking for another service provider)... --- ..._no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn | 2 +- doc/bugs/cutpaste.pm:_missing_filter_call.mdwn | 4 ++-- doc/forum/cutpaste.pm_not_only_file-local.mdwn | 2 +- doc/plugins/contrib/texinfo.mdwn | 2 +- .../__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn | 2 +- doc/todo/passwordauth:_sendmail_interface.mdwn | 2 +- doc/users/tschwinge.mdwn | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/plugins') diff --git a/doc/bugs/Error:_no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn b/doc/bugs/Error:_no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn index 6996a9fbf..0082eed4d 100644 --- a/doc/bugs/Error:_no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn +++ b/doc/bugs/Error:_no_text_was_copied_in_this_page_--_missing_page_dependencies.mdwn @@ -2,7 +2,7 @@ That one has bitten me for some time; here is the minimal testcase. There is also an equivalent (I suppose) problem when using another plugin, but I hope it's enough to track it down for this one. - $ tar -xj < [bug-dep_order.tar.bz2](http://www.thomas.schwinge.homeip.net/tmp/bug-dep_order.tar.bz2) + $ tar -xj < [bug-dep_order.tar.bz2](http://schwinge.homeip.net/~thomas/tmp/bug-dep_order.tar.bz2) $ cd bug-dep_order/ $ ./render_locally [...] diff --git a/doc/bugs/cutpaste.pm:_missing_filter_call.mdwn b/doc/bugs/cutpaste.pm:_missing_filter_call.mdwn index f7138cba0..4b22fd06c 100644 --- a/doc/bugs/cutpaste.pm:_missing_filter_call.mdwn +++ b/doc/bugs/cutpaste.pm:_missing_filter_call.mdwn @@ -1,7 +1,7 @@ Consider this: - $ wget http://www.thomas.schwinge.homeip.net/tmp/cutpaste_filter.tar.bz2 - $ wget http://www.thomas.schwinge.homeip.net/tmp/cutpaste_filter.patch + $ wget http://schwinge.homeip.net/~thomas/tmp/cutpaste_filter.tar.bz2 + $ wget http://schwinge.homeip.net/~thomas/tmp/cutpaste_filter.patch $ tar -xj < cutpaste_filter.tar.bz2 $ cd cutpaste_filter/ diff --git a/doc/forum/cutpaste.pm_not_only_file-local.mdwn b/doc/forum/cutpaste.pm_not_only_file-local.mdwn index 3563e3e01..0c5221cc9 100644 --- a/doc/forum/cutpaste.pm_not_only_file-local.mdwn +++ b/doc/forum/cutpaste.pm_not_only_file-local.mdwn @@ -3,7 +3,7 @@ has \[[!cut id=foo text="foo"]], and fileB does \[[!absorb pagenames=fileA]], and can then use \[[!paste id=foo]]. Therefore, I've written an [*absorb* directive / -plugin](http://www.thomas.schwinge.homeip.net/tmp/absorb.pm), which is meant to +plugin](http://schwinge.homeip.net/~thomas/tmp/absorb.pm), which is meant to absorb pages in order to get hold of their *cut* and *copy* directives' contents. This does work as expected. But it also absorbs page fileA's *meta* values, like a *meta title*, etc. How to avoid / solve this? diff --git a/doc/plugins/contrib/texinfo.mdwn b/doc/plugins/contrib/texinfo.mdwn index 595bd27aa..a2769166d 100644 --- a/doc/plugins/contrib/texinfo.mdwn +++ b/doc/plugins/contrib/texinfo.mdwn @@ -8,7 +8,7 @@ This plugin is not neccessarily meant to enable people to write arbitrary wiki pages in the Texinfo format (even though that is possible, of course), but rather to ease collaboration on existing Texinfo documents. -The plugin is available at . +The plugin is available at . It's very basic at the moment, but will be improved over time. diff --git a/doc/todo/__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn b/doc/todo/__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn index 61b19d302..b3804d652 100644 --- a/doc/todo/__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn +++ b/doc/todo/__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn @@ -4,7 +4,7 @@ to the [[`meta`_plugin|plugins/meta]]. > [[done]], with some changes --[[Joey]] Find the most recent version at -. +. I can't use `scrub(...)`, as that will strip out the forwarding HTML command. How to deal with that? diff --git a/doc/todo/passwordauth:_sendmail_interface.mdwn b/doc/todo/passwordauth:_sendmail_interface.mdwn index 29f28ca32..556240964 100644 --- a/doc/todo/passwordauth:_sendmail_interface.mdwn +++ b/doc/todo/passwordauth:_sendmail_interface.mdwn @@ -35,7 +35,7 @@ in the ikiwiki source code, where emailing is done. OK, so I'll have a look at replacing all email handling with *Email::Send*. [[!tag patch]] -** +** Remaining TODOs: diff --git a/doc/users/tschwinge.mdwn b/doc/users/tschwinge.mdwn index 944105349..435208a71 100644 --- a/doc/users/tschwinge.mdwn +++ b/doc/users/tschwinge.mdwn @@ -1,8 +1,8 @@ [[!meta title="Thomas Schwinge"]] # Thomas Schwinge - - + + I have converted the [GNU Hurd](http://www.gnu.org/software/hurd/)'s previous web pages and previous wiki pages to a *[[ikiwiki]]* system; and all that while -- cgit v1.2.3 From 9ffa87671062eecfcd042a9501032d441def7ce1 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 28 Oct 2010 00:19:43 +0000 Subject: tweaking docs --- doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn b/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn index bb4a58fc6..1a01834f8 100644 --- a/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn +++ b/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn @@ -14,4 +14,4 @@ There is one argument to this directive. The YAML-format data. This should be enclosed inside triple-quotes to preserve the data correctly. If more than one ymlfront directive is given per page, the result is undefined. -Likewise, it is inadvisable to try to mix the "---" ymlfront format with the directive form of the data. +Likewise, it is inadvisable to try to mix the non-directive ymlfront format with the directive form of the data. -- cgit v1.2.3 From f2f41d680a841813fb3b75e0311793afc956ffd2 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 28 Oct 2010 00:21:47 +0000 Subject: new version of ymlfront finally documented --- doc/plugins/contrib/ymlfront.mdwn | 65 ++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 14 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront.mdwn b/doc/plugins/contrib/ymlfront.mdwn index a2c649044..2805be04f 100644 --- a/doc/plugins/contrib/ymlfront.mdwn +++ b/doc/plugins/contrib/ymlfront.mdwn @@ -10,6 +10,9 @@ IkiWiki::Plugin::ymlfront - add YAML-format data to a page # activate the plugin add_plugins => [qw{goodstuff ymlfront ....}], + # configure the plugin + ymlfront_delim => [qw(--YAML-- --YAML--)], + ## DESCRIPTION This plugin provides a way of adding arbitrary meta-data (data fields) to any @@ -25,23 +28,57 @@ This plugin is meant to be used in conjunction with the [[field]] plugin. ## DETAILS -If one is not using the ymlfront directive, the YAML-format data in a page -must be placed at the start of the page and delimited by lines containing -precisely three dashes. The "normal" content of the page then follows. +There are three formats for adding YAML data to a page. These formats +should not be mixed - the result is undefined. -For example: +1. ymlfront directive + + See [[ikiwiki/directive/ymlfront]] for more information. - --- - title: Foo does not work - Urgency: High - Status: Assigned - AssignedTo: Fred Nurk - Version: 1.2.3 - --- - When running on the Sprongle system, the Foo function returns incorrect data. +2. default YAML-compatible delimiter + + By default, the YAML-format data in a page is placed at the start of + the page and delimited by lines containing precisely three dashes. + This is what YAML itself uses to delimit multiple documents. + The "normal" content of the page then follows. + + For example: + + --- + title: Foo does not work + Urgency: High + Status: Assigned + AssignedTo: Fred Nurk + Version: 1.2.3 + --- + When running on the Sprongle system, the Foo function returns incorrect data. + + What will normally be displayed is everything following the second line of dashes. That will be htmlized using the page-type of the page-file. + +3. user-defined delimiter + + Instead of using the default "---" delimiter, the user can define, + in the configuration file, the **ymlfront_delim** value, which is an + array containing two strings. The first string defines the markup for + the start of the YAML data, and the second string defines the markip + for the end of the YAML data. These two strings can be the same, or + they can be different. In this case, the YAML data section is not + required to be at the start of the page, but as with the default, it + is expected that only one data section will be on the page. + + For example: + + --YAML-- + title: Foo does not work + Urgency: High + Status: Assigned + AssignedTo: Fred Nurk + Version: 1.2.3 + --YAML-- + When running on the Sprongle system, the Foo function returns incorrect data. -What will normally be displayed is everything following the second line of dashes. -That will be htmlized using the page-type of the page-file. + What will normally be displayed is everything outside the delimiters, + both before and after. That will be htmlized using the page-type of the page-file. ### Accessing the Data -- cgit v1.2.3 From fa71b0e6aa08b0e3b274a0b939bf657f2576e482 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 1 Nov 2010 18:23:43 +0000 Subject: added to git --- ..._content_for___42__copyright__42___and___42__license__42__.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn index ce2779db1..c13114360 100644 --- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn +++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn @@ -45,3 +45,10 @@ by ikiwiki are likewise fine. --[[tschwinge]] > and can extend beyond just copyright and license, but has the disadvantage > that it doesn't support setting defaults for a given "subdirectory" > only. --[[smcv]] + +[[!template id=gitbranch name=smcv/contrib/defcopyright author="[[tschwinge]]"]] + +> For `./gitremotes` convenience (taking the Linus approach to backups :-) ) +> I've added this to my git repository as a branch. No review, approval or +> ownership is implied, feel free to replace this with a branch in any other +> repository --[[smcv]] -- cgit v1.2.3 From e68f29eebb3917909b939869e57b985add724598 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 1 Nov 2010 18:24:46 +0000 Subject: ugh, now with better syntax --- ...fault_content_for___42__copyright__42___and___42__license__42__.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn index c13114360..16c147b68 100644 --- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn +++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn @@ -46,7 +46,7 @@ by ikiwiki are likewise fine. --[[tschwinge]] > that it doesn't support setting defaults for a given "subdirectory" > only. --[[smcv]] -[[!template id=gitbranch name=smcv/contrib/defcopyright author="[[tschwinge]]"]] +[[!template id=gitbranch branch=smcv/contrib/defcopyright author="[[tschwinge]]"]] > For `./gitremotes` convenience (taking the Linus approach to backups :-) ) > I've added this to my git repository as a branch. No review, approval or -- cgit v1.2.3 From 408af2bb9e10d2ed899e17f9814a5514c0254dc8 Mon Sep 17 00:00:00 2001 From: JoeRayhawk Date: Sun, 7 Nov 2010 04:37:14 +0000 Subject: A wish for a noninvasive autoindex. --- doc/plugins/autoindex/discussion.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index 2d6b6f1f0..a48fe9df1 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -61,3 +61,15 @@ If you just don't want to clutter your git repo, below it's a patch does the fol Warning: I guess this patch may work, but I *haven't tested it yet*. -- [[weakish]] + +------ + +`autoindex_commit => 0` would be nice, but uncommited files are definitely not. +
+remote: From /srv/git/test3
+remote:    3047077..1df636c  master     -> origin/master
+remote: error: Untracked working tree file 'test.mdwn' would be overwritten by merge.  Aborting
+remote: 'git pull --prune origin' failed:  at /usr/share/perl5/IkiWiki/Plugin/git.pm line 201.
+
+ +It'd be nice if we were able to notice directories with no associated compilable markup files and compile a simple map directive straight to HTML without any intermediate markup file being involved at all. -- JoeRayhawk -- cgit v1.2.3 From 93e15cc84f47a1340f8bd06d7056ba423fe510bb Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 8 Nov 2010 12:02:36 +0000 Subject: --- doc/plugins/autoindex/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index a48fe9df1..d8b9be6e0 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -1,6 +1,11 @@ Would it be possible to add an option to only generate the index files for the html output and not place the markdown files in the wiki source? +> Or better still, add a mechanism for ikiwiki to hold transient source +> pages in memory and render them as if they existed, without actually +> writing them out, as [[JoeRayhawk]] suggests below? I think +> add_autofile would be the way to do this. --[[smcv]] + The reason being that I have a lot of directories which need to be autoindexed, but I would prefer if the index files didn't clutter up my git repository. -- cgit v1.2.3 From 2c17255b6641e33374a446ca281a0ad6d46af1dc Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 8 Nov 2010 12:14:26 +0000 Subject: cross-references --- doc/plugins/autoindex/discussion.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index d8b9be6e0..b09481cdc 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -4,7 +4,9 @@ for the html output and not place the markdown files in the wiki source? > Or better still, add a mechanism for ikiwiki to hold transient source > pages in memory and render them as if they existed, without actually > writing them out, as [[JoeRayhawk]] suggests below? I think -> add_autofile would be the way to do this. --[[smcv]] +> add_autofile would be the way to do this. +> I've added this to [[todo]] as [[todo/autoindex should use add__95__autofile]] +> and [[todo/transient in-memory pages]]. --[[smcv]] The reason being that I have a lot of directories which need to be autoindexed, but I would prefer if the index files didn't clutter up my git repository. -- cgit v1.2.3 From 9c42f5786601429a0b921d6591ebf5e4c1eb4da8 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 8 Nov 2010 12:17:07 +0000 Subject: put the problematic patch in a toggleable to make discussion more visible --- doc/plugins/autoindex/discussion.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index b09481cdc..6b13d2342 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -22,6 +22,8 @@ If you just don't want to clutter your git repo, below it's a patch does the fol * If you set autoindex_commit to 1 (this is the default), auto-generated index files will be put in the repo provided you enabled rcs backend. +[[!toggle id="patch-for-autoindex_commit" text="patch for autoindex_commit"]] +[[!toggleable id="patch-for-autoindex_commit" text="""
 --- autoindex.pm.orig	2009-10-01 17:13:51.000000000 +0800
 +++ autoindex.pm	2009-10-01 17:21:09.000000000 +0800
@@ -65,7 +67,7 @@ If you just don't want to clutter your git repo, below it's a patch does the fol
  				gettext("automatic index generation"),
  				undef, undef);
 
- +"""]] Warning: I guess this patch may work, but I *haven't tested it yet*. -- [[weakish]] -- cgit v1.2.3 From d5056fb61e8332fea658363e931ec28a35681ffe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Nov 2010 00:24:33 -0400 Subject: add example of skipping blog posts while scrubbing comments --- doc/plugins/htmlscrubber.mdwn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/htmlscrubber.mdwn b/doc/plugins/htmlscrubber.mdwn index c59b46e14..080575c46 100644 --- a/doc/plugins/htmlscrubber.mdwn +++ b/doc/plugins/htmlscrubber.mdwn @@ -32,10 +32,11 @@ other HTML-related functionality, such as whether [[meta]] allows potentially unsafe HTML tags. The `htmlscrubber_skip` configuration setting can be used to skip scrubbing -of some pages. Set it to a [[ikiwiki/PageSpec]], such as "!*/Discussion", -and pages matching that can have all the evil CSS, JavsScript, and unsafe -html elements you like. One safe way to use this is to use [[lockedit]] to -lock those pages, so only admins can edit them. +of some pages. Set it to a [[ikiwiki/PageSpec]], such as +"posts/* and !comment(*) and !*/Discussion", and pages matching that can have +all the evil CSS, JavsScript, and unsafe html elements you like. One safe +way to use this is to use [[lockedit]] to lock those pages, so only admins +can edit them. ---- -- cgit v1.2.3 From 4c224ae143ebc4b13f824fe1782561a5cd165864 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 22 Nov 2010 23:33:13 +0000 Subject: urlto(): if $from is undef, return a local path, not an absolute URL --- IkiWiki.pm | 6 ++++++ doc/plugins/write.mdwn | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index a4afef8e0..ee0b1f1ea 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1148,6 +1148,12 @@ sub urlto ($$;$) { return $config{url}.beautify_urlpath("/".$to); } + if (! defined $from) { + my $u = $local_url; + $u =~ s{/$}{}; + return $u.beautify_urlpath("/".$to); + } + my $link = abs2rel($to, dirname(htmlpage($from))); return beautify_urlpath($link); diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 6b751f0cd..33db3e707 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -988,6 +988,10 @@ Construct a relative url to the first parameter from the page named by the second. The first parameter can be either a page name, or some other destination file, as registered by `will_render`. +If the second parameter is `undef`, the URL will be valid from any page on the +wiki, or from the CGI; if possible it'll be a path starting with `/`, but an +absolute URL will be used if the wiki and the CGI are on different servers. + If the third parameter is passed and is true, an absolute url will be constructed instead of the default relative url. -- cgit v1.2.3 From 3c2d9e10380d7e2c38f8368f2bd922a62b240ef9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Nov 2010 23:29:27 +0000 Subject: --- doc/plugins/autoindex/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/autoindex/discussion.mdwn b/doc/plugins/autoindex/discussion.mdwn index 6b13d2342..76d09cd3c 100644 --- a/doc/plugins/autoindex/discussion.mdwn +++ b/doc/plugins/autoindex/discussion.mdwn @@ -6,7 +6,7 @@ for the html output and not place the markdown files in the wiki source? > writing them out, as [[JoeRayhawk]] suggests below? I think > add_autofile would be the way to do this. > I've added this to [[todo]] as [[todo/autoindex should use add__95__autofile]] -> and [[todo/transient in-memory pages]]. --[[smcv]] +> and [[todo/transient_pages]]. --[[smcv]] The reason being that I have a lot of directories which need to be autoindexed, but I would prefer if the index files didn't clutter up my git repository. -- cgit v1.2.3 From f60f15704e1f98ceea023561c9e411b6fc3ac4ea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Nov 2010 14:59:15 -0400 Subject: tweak urlto description --- doc/plugins/write.mdwn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 33db3e707..726ace8d3 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -988,9 +988,10 @@ Construct a relative url to the first parameter from the page named by the second. The first parameter can be either a page name, or some other destination file, as registered by `will_render`. -If the second parameter is `undef`, the URL will be valid from any page on the -wiki, or from the CGI; if possible it'll be a path starting with `/`, but an -absolute URL will be used if the wiki and the CGI are on different servers. +If the second parameter is `undef` (or not specified), the URL will be +valid from any page on the wiki, or from the CGI; if possible it'll +be a path starting with `/`, but an absolute URL will be used if +the wiki and the CGI are on different domains. If the third parameter is passed and is true, an absolute url will be constructed instead of the default relative url. -- cgit v1.2.3 From 53d466a07f542dca86732764ab4f13608d701a1c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Nov 2010 14:59:48 -0400 Subject: second parameter of urlto is optional --- IkiWiki.pm | 2 +- doc/plugins/write.mdwn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki.pm b/IkiWiki.pm index a893edb3b..97946bfcf 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1134,7 +1134,7 @@ sub beautify_urlpath ($) { return $url; } -sub urlto ($$;$) { +sub urlto ($;$$) { my $to=shift; my $from=shift; my $absolute=shift; diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 726ace8d3..ccdf9f393 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -982,7 +982,7 @@ This is the standard gettext function, although slightly optimised. This is the standard ngettext function, although slightly optimised. -### `urlto($$;$)` +### `urlto($;$$)` Construct a relative url to the first parameter from the page named by the second. The first parameter can be either a page name, or some other -- cgit v1.2.3 From 7c2252137a8eb59813ab7c253804de20c45219a9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Nov 2010 15:09:38 -0400 Subject: more tweaks to urlto documentation --- doc/plugins/write.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index ccdf9f393..3cab7588e 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1,4 +1,4 @@ -Ikiwiki's plugin interface allows all kinds of useful [[plugins]] to be +lkiwiki's plugin interface allows all kinds of useful [[plugins]] to be written to extend ikiwiki in many ways. Despite the length of this page, it's not really hard. This page is a complete reference to everything a plugin might want to do. There is also a quick [[tutorial]]. @@ -988,13 +988,13 @@ Construct a relative url to the first parameter from the page named by the second. The first parameter can be either a page name, or some other destination file, as registered by `will_render`. -If the second parameter is `undef` (or not specified), the URL will be +If the second parameter is not specified (or `undef`), the URL will be valid from any page on the wiki, or from the CGI; if possible it'll be a path starting with `/`, but an absolute URL will be used if the wiki and the CGI are on different domains. -If the third parameter is passed and is true, an absolute url will be -constructed instead of the default relative url. +If the third parameter is passed and is true, the url will be a fully +absolute url. This is useful when generating an url to publish elsewhere. ### `newpagefile($$)` -- cgit v1.2.3 From b297f76f14471d7a6e1ad265357d7a788609c4c3 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawlcaGfdn9Kye1Gc8aGb67PDVQW4mKbQD7E" Date: Sun, 5 Dec 2010 17:26:45 +0000 Subject: ping for review --- doc/plugins/aggregate/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/aggregate/discussion.mdwn b/doc/plugins/aggregate/discussion.mdwn index 77005a6a1..6e6c23e61 100644 --- a/doc/plugins/aggregate/discussion.mdwn +++ b/doc/plugins/aggregate/discussion.mdwn @@ -116,3 +116,5 @@ with some cookies. What I've done is write a custom plugin to populate It works, but I have to remember to apply the diff whenever I update ikiwiki. Can you provide a more elegant means of allowing cookies and/or the user agent to be programmatically manipulated? --[[schmonz]] + +> Ping -- is the above patch perhaps acceptable (or near-acceptable)? -- [[schmonz]] -- cgit v1.2.3 From 3f4ec334df4cc2c169edfbcef3fa530cbae0d7f1 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Mon, 6 Dec 2010 02:02:30 +0000 Subject: updating the docs in keeping with latest version - multi-page reports --- .../contrib/report/ikiwiki/directive/report.mdwn | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn b/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn index 8f8e6b4e8..df88b33ad 100644 --- a/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn +++ b/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn @@ -30,6 +30,11 @@ them work as wiki pages. **pages**: A PageSpec to determine the pages to report on. +**pagenames**: If given instead of pages, this is interpreted as a +space-separated list of links to pages, and they are shown in exactly the order +given: the sort and pages parameters cannot be used in conjunction with this +one. If they are used, they will be ignored. + **trail**: A page or pages to use as a "trail" page. When a trail page is used, the matching pages are limited to (a subset @@ -45,6 +50,11 @@ For example: This will take the links from both the "animals/cats" page and the "animals/dogs" page as the set of pages to apply the PageSpec to. +**start**: Start the report at the given page-index; the index starts +from zero. + +**count**: Report only on N pages where count=N. + **sort**: A SortSpec to determine how the matching pages should be sorted. **here_only**: Report on the current page only. @@ -86,7 +96,19 @@ The "mood_summary" template might be like this: ### () \[[]] - + +### Multi-page Reports + +Reports can now be split over multiple pages, so that there aren't +too many items per report-page. + +**per_page**: how many items to show per report-page. + +**first_page_is_index**: If true, the first page of the report is just +an index which contains links to the other report pages. +If false, the first page will contain report-content as well as links +to the other pages. + ### Advanced Options The following options are used to improve efficiency when dealing -- cgit v1.2.3 From 20df2ee6fe0b9cbde72f47193ede4ac7f971d617 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 6 Dec 2010 14:06:37 +0100 Subject: Some comments on fields namespacing --- doc/plugins/contrib/field/discussion.mdwn | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 191f8b27d..80d0b2b71 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -327,6 +327,51 @@ smcv's discuission of field author vs meta author above. --[[Joey]] ----- +I think the main point is: what is (or should be) the main point of the +field plugin? If it's essentially a way to present a consistent +interface to access page-related structured information, then it makes +sense to have it very general. Plugins registering with fields would +then present ways for recovering the structure information from the page +(`ymlfront`, `meta`, etc), ways to manipulate it (like `meta` does), +etc. + +In this sense, security should be entirely up to the plugins, although +the fields plugin could provide some auxiliary infrastructure (like +determining where the data comes from and raise or lower the security +level accoringly). + +Namespacing is important, and it should be considered at the field +plugin interface level. A plugin should be able to register as +responsible for the processing of all data belonging to a given +namespace, but plugins should be able to set data in any namespace. So +for example, `meta` register are `meta` fields processing, and whatever +method is used to set the data (`meta` directive, `ymlfront`, etc) it +gets a say on what to do with data in its namespace. + +What I'm thinking of is something you could call fieldsets. The nice +thing about them is that, aside from the ones defined by plugins (like +`meta`), it would be possible to define custom ones (with a generic, +default processor) in an appropriate file (like smileys and shortcuts) +with a syntax like: + + [[!fieldset book namespace=book + fields="author title isbn" + fieldtype="text text text"]] + +after which, you coude use + + [[!book author="A. U. Thor" + title="Fields of Iki"]] + +and the data would be available under the book namespace, and thus +as BOOK_AUTHOR, BOOK_TITLE etc in templates. + +Security, in this sense, would be up to the plugin responsible for the +namespace processing (the default handler would HTML-escape text fields +scrub, html fields, safeurl()ify url fields, etc.) + +----- + I was just looking at HTML5 and wondered if the field plugin should generate the new Microdata tags (as well as the internal structures)? -- [[Will]] > This could just as easily be done as a separate plugin. Feel free to do so. --[[KathrynAndersen]] -- cgit v1.2.3 From 5d6c604bdc03d5009378273cb4e465319dff4b58 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 8 Dec 2010 03:12:35 +0000 Subject: namespaces are othogonal to the issue of security --- doc/plugins/contrib/field/discussion.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index 80d0b2b71..cd479263a 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -370,6 +370,18 @@ Security, in this sense, would be up to the plugin responsible for the namespace processing (the default handler would HTML-escape text fields scrub, html fields, safeurl()ify url fields, etc.) +> So, are you saying that getting a field value is sort of a two-stage process? Get the value from anywhere, and then call the "security processor" for that namespace to "secure" the value? I think "namespaces" are really orthogonal to this issue. What the issue seems to be is: + + * what form do we expect the raw field to be in? (text, URL, HTML) + * what form do we expect the "secured" output to be in? (raw HTML, scrubbed HTML, escaped HTML, URL) + +> Only if we know both these things will we know what sort of security processing needs to be done. +> There is also a difference between field values that are used inside pagetemplate, and field values which are used as part of a page's content (e.g. with ftemplate). If you have a TITLE, you want it to be HTML-escaped if you're using it inside pagetemplate, but you don't want it to be HTML-escaped if you're using it inside a page's content. On the other hand, if you have, say, FEEDLINKS used inside pagetemplate, you don't wish it to be HTML-escaped at all, or your page content will be completely stuffed. + +> So, somehow, we have to know the meaning of a field before we can use it properly, which kind of goes against the idea of having something generic. + +> --[[KathrynAndersen]] + ----- I was just looking at HTML5 and wondered if the field plugin should generate the new Microdata tags (as well as the internal structures)? -- [[Will]] -- cgit v1.2.3 From 99d74b3d6aaf464ffc35ca6504623b547fa340e6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Dec 2010 14:48:52 -0400 Subject: add themes page and remove actiontabs.css from css_market since it is a theme --- doc/css_market.mdwn | 12 ++-- doc/css_market/actiontabs.css | 122 ---------------------------------------- doc/plugins/theme.mdwn | 7 +-- doc/themes.mdwn | 16 ++++++ doc/themes/actiontabs_small.png | Bin 0 -> 19202 bytes doc/themes/blueview_small.png | Bin 0 -> 18543 bytes doc/themes/none_small.png | Bin 0 -> 18516 bytes 7 files changed, 23 insertions(+), 134 deletions(-) delete mode 100644 doc/css_market/actiontabs.css create mode 100644 doc/themes.mdwn create mode 100644 doc/themes/actiontabs_small.png create mode 100644 doc/themes/blueview_small.png create mode 100644 doc/themes/none_small.png (limited to 'doc/plugins') diff --git a/doc/css_market.mdwn b/doc/css_market.mdwn index c167388a7..1838b2f60 100644 --- a/doc/css_market.mdwn +++ b/doc/css_market.mdwn @@ -4,9 +4,11 @@ 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`. +Some of stylesheets have developed into fullfledged [[themes]] that are +included in ikiwiki for easy use. + Feel free to add your own stylesheets here. (Upload as wiki pages; wiki -gnomes will convert them to css files..) Selected ones from here are -included in the [[theme_plugin|plugins/theme]]. +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 @@ -46,15 +48,11 @@ included in the [[theme_plugin|plugins/theme]]. * **[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. This is in use at [branchable](http://www.branchable.com/). - [[!meta stylesheet="actiontabs"]] - * **[wiki.css](http://cyborginstitute.net/includes/wiki.css)** by [[tychoish]]. I typically throw this in as `local.css` in new wikis as a slightly more clear and readable layout for wikis that need to be functional and elegant, but not necessarily uniquely designed. Currently in use by the [the outeralliance wiki](http://oa.criticalfutures.com/). - + If your web browser allows selecting between multiple stylesheets, this page can be viewed using many of the stylesheets above. For example, if diff --git a/doc/css_market/actiontabs.css b/doc/css_market/actiontabs.css deleted file mode 100644 index a1dc47e92..000000000 --- a/doc/css_market/actiontabs.css +++ /dev/null @@ -1,122 +0,0 @@ -/* 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; -} diff --git a/doc/plugins/theme.mdwn b/doc/plugins/theme.mdwn index 2622abc88..ebbb0be8e 100644 --- a/doc/plugins/theme.mdwn +++ b/doc/plugins/theme.mdwn @@ -4,11 +4,8 @@ The theme plugin allows easily applying a theme to your wiki, by configuring the `theme` setting in the setup file with the name of a theme to use. The themes you can choose from are all subdirectories, typically -inside `/usr/share/ikiwiki/themes/`. - -A theme provides, via the underlay, an enhanced version of the regular -[[style.css]]. This leaves [[local.css]] free for you to further -customise. Themes can also provide header and background images. +inside `/usr/share/ikiwiki/themes/`. See [[themes]] for an overview +of the themes included in ikiwiki. You can set the theme via the **theme** option in your config file (after enabling the plugin). Refresh the wiki after changing it to see the changes. diff --git a/doc/themes.mdwn b/doc/themes.mdwn new file mode 100644 index 000000000..daa38cd44 --- /dev/null +++ b/doc/themes.mdwn @@ -0,0 +1,16 @@ +Ikiwiki now comes with several themes contributed by users. +You can enable the [[theme_plugin|plugins/theme]] to use any of these. + +A theme provides, via the underlay, an enhanced version of the regular +[[style.css]]. This leaves [[local.css]] free for you to further +customise. Themes can also provide header and background images. + +[[!img align=left actiontabs_small.png]] The actiontabs theme, contributed by +[[svend]]. This style sheet displays the action list +(Edit, RecentChanges, etc.) as tabs. + +[[!img align=left blueview_small.png]] The blueview theme, contributed by +[[BerndZeimetz]], featuring a panorama photo he took. + +[[!img align=left none_small.png]] For completeness, ikiwiki's default +anti-theme. diff --git a/doc/themes/actiontabs_small.png b/doc/themes/actiontabs_small.png new file mode 100644 index 000000000..4b05ad3dc Binary files /dev/null and b/doc/themes/actiontabs_small.png differ diff --git a/doc/themes/blueview_small.png b/doc/themes/blueview_small.png new file mode 100644 index 000000000..74972c4c3 Binary files /dev/null and b/doc/themes/blueview_small.png differ diff --git a/doc/themes/none_small.png b/doc/themes/none_small.png new file mode 100644 index 000000000..8272ae606 Binary files /dev/null and b/doc/themes/none_small.png differ -- cgit v1.2.3 From d0fdc973d3c793fa6f315014fcfa6823d057372a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 16 Dec 2010 18:47:38 +0100 Subject: reply to KA about fieldsets and field types --- doc/plugins/contrib/field/discussion.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn index cd479263a..6161f80df 100644 --- a/doc/plugins/contrib/field/discussion.mdwn +++ b/doc/plugins/contrib/field/discussion.mdwn @@ -376,10 +376,28 @@ scrub, html fields, safeurl()ify url fields, etc.) * what form do we expect the "secured" output to be in? (raw HTML, scrubbed HTML, escaped HTML, URL) > Only if we know both these things will we know what sort of security processing needs to be done. + +>> Fieldsets are orthogonal to the security issue in the sense that you can use +>> them without worrying about the field security issue, but they happen to be +>> a rather clean way of answering those two questions, by allowing you to +>> attach preprocessing attributes to a field in a way that the user +>> (supposedly) cannot mingle with. + > There is also a difference between field values that are used inside pagetemplate, and field values which are used as part of a page's content (e.g. with ftemplate). If you have a TITLE, you want it to be HTML-escaped if you're using it inside pagetemplate, but you don't want it to be HTML-escaped if you're using it inside a page's content. On the other hand, if you have, say, FEEDLINKS used inside pagetemplate, you don't wish it to be HTML-escaped at all, or your page content will be completely stuffed. +>> Not to talk about the many different ways date-like fields might be need +>> processing. It has already been proposed to solve this problem by exposing +>> the field values under different names depending on the kind or amout of +>> postprocessing they had (e.g. RAW_SOMEFIELD, SOMEFIELD, to which we could add +>> HTML_SOMEFIELD, URL_SOMEFIELD or whatever). Again, fieldsets offer a simple way +>> of letting Ikiwiki know what kind of postprocessing should be offered for +>> that particular field. + > So, somehow, we have to know the meaning of a field before we can use it properly, which kind of goes against the idea of having something generic. +>> We could have a default field type (text, for example), and a way to set a +>> different field type (which is what my fieldset proposal was about). + > --[[KathrynAndersen]] ----- -- cgit v1.2.3 From 075d48c5f2287e6195258a1f0993eb8f69741f51 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 Dec 2010 14:13:25 -0400 Subject: response --- doc/plugins/aggregate/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/aggregate/discussion.mdwn b/doc/plugins/aggregate/discussion.mdwn index 6e6c23e61..a3336ee08 100644 --- a/doc/plugins/aggregate/discussion.mdwn +++ b/doc/plugins/aggregate/discussion.mdwn @@ -118,3 +118,6 @@ ikiwiki. Can you provide a more elegant means of allowing cookies and/or the user agent to be programmatically manipulated? --[[schmonz]] > Ping -- is the above patch perhaps acceptable (or near-acceptable)? -- [[schmonz]] + +>> Pong.. I'd be happier with a more 100% solution that let cookies be used +>> w/o needing to write a custom plugin to do it. --[[Joey]] -- cgit v1.2.3