From a2a63a096b85db5a6e6d241ba93b19a6f2d4a60a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Aug 1997 07:20:02 -0400 Subject: Spanish translation update from Victor Moral. --- debian/changelog | 1 + po/es.po | 52 +++++++++++++++++++++++++--------------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2256c24fd..6650baa5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low * Improve escaping of wikilinks and preprocessor directives in content produced by aggregate and recentchanges. * French translation update from Philippe Batailler. Closes: #506250 + * Spanish translation update from Victor Moral. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/po/es.po b/po/es.po index 8dce2940f..828bc8d9f 100644 --- a/po/es.po +++ b/po/es.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-10-31 16:37-0400\n" -"PO-Revision-Date: 2008-10-22 13:54+0200\n" +"POT-Creation-Date: 2008-11-11 20:48-0500\n" +"PO-Revision-Date: 2008-11-26 08:42+0100\n" "Last-Translator: Víctor Moral \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" @@ -48,7 +48,7 @@ msgstr "Las preferencias se han guardado." msgid "You are banned." msgstr "Ha sido expulsado." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1182 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1189 msgid "Error" msgstr "Error" @@ -121,7 +121,7 @@ msgstr "(los caracteres especiales de la fuente de datos están exceptuados)" msgid "feed crashed XML::Feed!" msgstr "¡ la fuente de datos ha provocado un error fatal en XML::Feed !" -#: ../IkiWiki/Plugin/aggregate.pm:590 +#: ../IkiWiki/Plugin/aggregate.pm:591 #, perl-format msgid "creating new page %s" msgstr "creando nueva página %s" @@ -210,9 +210,8 @@ msgid "removing old preview %s" msgstr "eliminando la antigua previsualización %s" #: ../IkiWiki/Plugin/editpage.pm:125 -#, fuzzy msgid "bad page name" -msgstr "nombre de archivo adjunto erróneo" +msgstr "nombre de página erróneo" #: ../IkiWiki/Plugin/editpage.pm:141 #, perl-format @@ -248,14 +247,14 @@ msgstr "plantilla de edición %s registrada para %s" msgid "failed to process" msgstr "fallo en el proceso" -#: ../IkiWiki/Plugin/format.pm:22 +#: ../IkiWiki/Plugin/format.pm:20 msgid "must specify format and text" -msgstr "" +msgstr "se deben especificar tanto el formato como el texto" -#: ../IkiWiki/Plugin/format.pm:25 -#, fuzzy, perl-format +#: ../IkiWiki/Plugin/format.pm:23 +#, perl-format msgid "unsupported page format %s" -msgstr "el sistema de control de versiones %s no está soportado" +msgstr "formato de página %s no soportado" #: ../IkiWiki/Plugin/fortune.pm:27 msgid "fortune failed" @@ -263,19 +262,18 @@ msgstr "el programa fortune ha fallado" #: ../IkiWiki/Plugin/git.pm:618 ../IkiWiki/Plugin/git.pm:636 #: ../IkiWiki/Receive.pm:129 -#, fuzzy, perl-format +#, perl-format msgid "you are not allowed to change %s" -msgstr "No está registrado como un administrador" +msgstr "No puede cambiar %s" #: ../IkiWiki/Plugin/git.pm:658 #, perl-format msgid "you cannot act on a file with mode %s" -msgstr "" +msgstr "no puede actuar sobre un archivo con permisos %s" #: ../IkiWiki/Plugin/git.pm:662 -#, fuzzy msgid "you are not allowed to change file modes" -msgstr "No está registrado como un administrador" +msgstr "No puede cambiar los permisos de acceso de un archivo" #: ../IkiWiki/Plugin/google.pm:27 #, perl-format @@ -831,12 +829,12 @@ msgstr "

Error: %s finaliza con código distinto de cero (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format msgid "cannot determine id of untrusted committer %s" -msgstr "" +msgstr "no puedo determinar el identificador de un usuario no fiable como %s" #: ../IkiWiki/Receive.pm:85 -#, fuzzy, perl-format +#, perl-format msgid "bad file name %s" -msgstr "ignorando el archivo %s porque su nombre no es correcto" +msgstr "el nombre de archivo %s es erróneo" #: ../IkiWiki/Render.pm:253 #, perl-format @@ -935,19 +933,19 @@ msgstr "el programa envoltorio no ha sido especificado" #. translators: The first parameter is a filename, and the second is #. translators: a (probably not translated) error message. -#: ../IkiWiki/Wrapper.pm:79 +#: ../IkiWiki/Wrapper.pm:97 #, perl-format msgid "failed to write %s: %s" msgstr "no puedo escribir en %s: %s" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:135 +#: ../IkiWiki/Wrapper.pm:154 #, perl-format msgid "failed to compile %s" msgstr "ha fallado la compilación del programa %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:155 +#: ../IkiWiki/Wrapper.pm:174 #, perl-format msgid "successfully generated %s" msgstr "creado con éxito el programa envoltorio %s" @@ -976,29 +974,29 @@ msgstr "reconstruyendo el wiki.." msgid "refreshing wiki.." msgstr "actualizando el wiki.." -#: ../IkiWiki.pm:466 +#: ../IkiWiki.pm:473 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Es obligatorio especificar un url al wiki con el parámetro --url si se " "utiliza el parámetro --cgi" -#: ../IkiWiki.pm:512 +#: ../IkiWiki.pm:519 msgid "cannot use multiple rcs plugins" msgstr "no puedo emplear varios complementos rcs" -#: ../IkiWiki.pm:541 +#: ../IkiWiki.pm:548 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "no he podido cargar el complemento externo %s necesario para %s" -#: ../IkiWiki.pm:1165 +#: ../IkiWiki.pm:1172 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" "se ha detectado en la página %s un bucle de preprocesado en la iteración " "número %i" -#: ../IkiWiki.pm:1678 +#: ../IkiWiki.pm:1673 msgid "yes" msgstr "si" -- cgit v1.2.3 From 408d483dc2938af527100f2201ceea0efb5019af Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 13 Nov 2008 04:32:02 +0100 Subject: reported my need for a global renamepage hook Signed-off-by: intrigeri --- doc/todo/need_global_renamepage_hook.mdwn | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 doc/todo/need_global_renamepage_hook.mdwn diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn new file mode 100644 index 000000000..b7aa44880 --- /dev/null +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -0,0 +1,42 @@ +As documented in [[plugins/write]], the current `renamepage` hook is +heavily oriented towards updating links in pages' content: it is run +once per page linking to the renamed page. + +That's fine, but it can't be used to trigger more general actions on +page rename. E.g. it won't be run at all if the page being renamed is +an orphan one. + +This is a real issue for the [[plugins/contrib/po]] development: what +I'm about to achieve is: + +- when a master page is renamed, the plugin takes notice of it (using + the `rename` hook), and later renames the translation pages + accordingly (in the `change` hook) +- when a master page is deleted, the plugin deletes its translations + (using the `delete` hook) + +With the current `renamepage` hook behavior, combining these two goals +has an annoying drawback: a plugin can't notice an orphan master page +has been renamed, so instead of renaming (and preserving) its +translations, it considers the oldpage as deleted, and deletes its +translations. Game over. + +It may seem like a corner case, but I want to be very careful when +deleting files automatically in `srcdir`, which is not always under +version control. + +As an sad workaround, I can still disable any deletion in `srcdir` +when it is not under version control. But I think ikiwiki deserves +a global `renamepage` hook that would be run once per rename +operation. + +My proposal is thus: + +- keep the documented `renamepage` hook as it is +- use something inspired by the trick `preprocess` uses: when `hook` + is passed an optional "global" parameter, set to a true value, the + declared `renamepage` hook is run once per rename operation, and is + passed named parameters: `src`, `srcfile`, `dest` and `destfile`. + +I'm of course volunteering to implement this, or anything related that +would solve my problem. Hmmm? --[[intrigeri]] -- cgit v1.2.3 From e7a840ed9a817cf4db59c90e680afd89e146b581 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 16 Nov 2008 18:11:39 +0000 Subject: htmlbalance: new plugin that balances tags by parsing and re-serializing --- IkiWiki/Plugin/htmlbalance.pm | 57 +++++++++++++++++++++++++++++++++++++++++++ doc/plugins/aggregate.mdwn | 6 ++--- doc/plugins/htmlbalance.mdwn | 9 +++++++ doc/plugins/htmltidy.mdwn | 3 ++- t/htmlbalance.t | 13 ++++++++++ 5 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 IkiWiki/Plugin/htmlbalance.pm create mode 100644 doc/plugins/htmlbalance.mdwn create mode 100755 t/htmlbalance.t diff --git a/IkiWiki/Plugin/htmlbalance.pm b/IkiWiki/Plugin/htmlbalance.pm new file mode 100644 index 000000000..667d73b6c --- /dev/null +++ b/IkiWiki/Plugin/htmlbalance.pm @@ -0,0 +1,57 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::htmlbalance; + +# htmlbalance: Parse and re-serialize HTML to ensure balanced tags +# +# Copyright 2008 Simon McVittie +# Licensed under the GNU GPL, version 2, or any later version published by the +# Free Software Foundation + +use warnings; +use strict; +use IkiWiki 2.00; + +sub import { #{{{ + hook(type => "getsetup", id => "htmlbalance", call => \&getsetup); + hook(type => "sanitize", id => "htmlbalance", call => \&sanitize); +} # }}} + +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => undef, + }, +} #}}} + +sub sanitize (@) { #{{{ + my %params=@_; + my $ret = ''; + + eval { + use HTML::TreeBuilder; + use XML::Atom::Util qw(encode_xml); + }; + + if ($@) { + error($@); + return $params{content}; + } + + my $tree = HTML::TreeBuilder->new_from_content($params{content}); + my @nodes = $tree->disembowel(); + foreach my $node (@nodes) { + if (ref $node) { + $ret .= $node->as_XML(); + chomp $ret; + $node->delete(); + } + else { + $ret .= encode_xml($node); + } + } + $tree->delete(); + return $ret; +} # }}} + +1 diff --git a/doc/plugins/aggregate.mdwn b/doc/plugins/aggregate.mdwn index c40a6dc22..6fc87853b 100644 --- a/doc/plugins/aggregate.mdwn +++ b/doc/plugins/aggregate.mdwn @@ -9,9 +9,9 @@ New users of aggregate should enable the `aggregateinternal => 1` option in the .setup file. If you don't do so, you will need to enable the [[html]] plugin as well as aggregate itself, since feed entries will be stored as HTML. -The [[meta]] and [[tag]] plugins are also recommended. The -[[htmltidy]] plugin is suggested, since feeds can easily contain html -problems, some of which tidy can fix. +The [[meta]] and [[tag]] plugins are also recommended. Either the +[[htmltidy]] or [[htmlbalance]] plugin is suggested, since feeds can easily +contain html problems, some of which these plugins can fix. You will need to run ikiwiki periodically from a cron job, passing it the --aggregate parameter, to make it check for new posts. Here's an example diff --git a/doc/plugins/htmlbalance.mdwn b/doc/plugins/htmlbalance.mdwn new file mode 100644 index 000000000..7cdb1f950 --- /dev/null +++ b/doc/plugins/htmlbalance.mdwn @@ -0,0 +1,9 @@ +[[!template id=plugin name=htmlbalance author="Simon McVittie"]] +[[!tag type/html]] + +This plugin ensures that the HTML emitted by ikiwiki contains well-balanced +HTML tags, by parsing it with HTML::TreeBuilder and re-serializing it. This +acts as a lighter-weight alternative to [[plugins/htmltidy]]; it doesn't +ensure validity, but it does at least ensure that formatting from a +blog post pulled in by \[[![[ikiwiki/directive/inline]]]] doesn't +leak into the rest of the page. diff --git a/doc/plugins/htmltidy.mdwn b/doc/plugins/htmltidy.mdwn index f675a01ae..580e56f59 100644 --- a/doc/plugins/htmltidy.mdwn +++ b/doc/plugins/htmltidy.mdwn @@ -7,4 +7,5 @@ emitted by ikiwiki. Besides being nicely formatted, this helps ensure that even if users enter suboptimal html, your wiki generates valid html. Note that since tidy is an external program, that is run each time a page -is built, this plugin will slow ikiwiki down somewhat. +is built, this plugin will slow ikiwiki down somewhat. [[plugins/htmlbalance]] +might provide a faster alternative. diff --git a/t/htmlbalance.t b/t/htmlbalance.t new file mode 100755 index 000000000..cd124e473 --- /dev/null +++ b/t/htmlbalance.t @@ -0,0 +1,13 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 7; + +BEGIN { use_ok("IkiWiki::Plugin::htmlbalance"); } + +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

"), "
"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

hello world

"), "

hello world

"); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => ""), ""); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "foo "), "foo "); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => " foo "), " foo "); +is(IkiWiki::Plugin::htmlbalance::sanitize(content => "a>"), "a>"); -- cgit v1.2.3 From 0e31e924e88d660b75bb8d33fb6ca1eb80a8a5e2 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:10:53 -0500 Subject: link to stuff --- doc/users/smcv.mdwn | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/users/smcv.mdwn b/doc/users/smcv.mdwn index 33ae450b2..c1cc62a81 100644 --- a/doc/users/smcv.mdwn +++ b/doc/users/smcv.mdwn @@ -1 +1,10 @@ -I'm trying to add enough features/fix enough bugs to convert [smcv.pseudorandom.co.uk](http://smcv.pseudorandom.co.uk/) from Django + Python + misc hacks to ikiwiki. +Website: [pseudorandom.co.uk](http://www.pseudorandom.co.uk/) + +Blog: [smcv.pseudorandom.co.uk](http://smcv.pseudorandom.co.uk/) + +My repository containing ikiwiki branches: + +* gitweb: http://git.pseudorandom.co.uk/smcv/ikiwiki.git +* anongit: git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git + +I'm working on the [[plugins/contrib/htmlbalance]] and [[plugins/contrib/postcomment]] plugins. -- cgit v1.2.3 From 913b516b4ea710a77947fb988a76b7689fbebd62 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:13:46 -0500 Subject: Link to third-party htmlbalance plugin --- doc/plugins/contrib/htmlbalance.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/plugins/contrib/htmlbalance.mdwn diff --git a/doc/plugins/contrib/htmlbalance.mdwn b/doc/plugins/contrib/htmlbalance.mdwn new file mode 100644 index 000000000..462e4b8e9 --- /dev/null +++ b/doc/plugins/contrib/htmlbalance.mdwn @@ -0,0 +1,11 @@ +[[!template id=plugin name=htmlbalance author="[[Simon_McVittie|smcv]]"]] +[[!tag type/html]] + +This plugin ensures that the HTML emitted by ikiwiki contains well-balanced +HTML tags, by parsing it with [[!cpan HTML::TreeBuilder]] and re-serializing it. This +acts as a lighter-weight alternative to [[plugins/htmltidy]]; it doesn't +ensure validity, but it does at least ensure that formatting from a +blog post pulled in by the [[ikiwiki/directive/inline]] directive doesn't +leak into the rest of the page. + +htmlbalance is available from the 'htmlbalance' branch in [[smcv]]'s git repository. -- cgit v1.2.3 From 8f22c2454f8963071a28c7753c7b38f96b1649c5 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:14:51 -0500 Subject: Explicitly say that I'd like to get this into ikiwiki --- doc/plugins/contrib/htmlbalance.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/plugins/contrib/htmlbalance.mdwn b/doc/plugins/contrib/htmlbalance.mdwn index 462e4b8e9..728e6afc2 100644 --- a/doc/plugins/contrib/htmlbalance.mdwn +++ b/doc/plugins/contrib/htmlbalance.mdwn @@ -9,3 +9,4 @@ blog post pulled in by the [[ikiwiki/directive/inline]] directive doesn't leak into the rest of the page. htmlbalance is available from the 'htmlbalance' branch in [[smcv]]'s git repository. +I'd like to get this plugin included in ikiwiki - any code review is welcome. -- cgit v1.2.3 From c59d9c64a3d8de6ea926953fe5298d6d9b4e1531 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:42:07 -0500 Subject: Publicise postcomment --- doc/plugins/contrib/postcomment.mdwn | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 doc/plugins/contrib/postcomment.mdwn diff --git a/doc/plugins/contrib/postcomment.mdwn b/doc/plugins/contrib/postcomment.mdwn new file mode 100644 index 000000000..4d1db6c9b --- /dev/null +++ b/doc/plugins/contrib/postcomment.mdwn @@ -0,0 +1,55 @@ +[[!template id=plugin name=postcomment author="[[Simon_McVittie|smcv]]"]] +[[!tag type=useful]] + +This plugin adds "blog-style" comments. The intention is that on a non-wiki site +(like a blog) you can lock all pages for admin-only access, then allow otherwise +unprivileged (or perhaps even anonymous) users to comment on posts. + +Comments are saved as internal pages, so they can never be edited through the CGI, +only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. +Directives and raw HTML are filtered out by default, and comment authorship should +hopefully be unforgeable by CGI users. + +When comments have been enabled generally, you still need to mark which pages +can have comments, by including the `\[[!postcomment]]` directive in them. By default, +this directive expands to a "post a comment" link plus an `\[[!inline]]` with +the comments. + +The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use +with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from +the [[plugins/lockedit]] plugin. Typical usage would be something like: + + locked_pages => "!postcomment(*)" + +to allow non-admin users to comment on pages, but not edit anything. You can also do + + anonok_pages => "postcomment(*)" + +to allow anonymous comments (the IP address will be used as the "author"). + +Optional parameters to the postcomment directive: + +* `commit=no`: by default, comments are committed to version control. Use this to + disable commits. +* `allowhtml=yes`: by default, raw HTML is filtered out. Use this to allow HTML + (you should enable [[plugins/htmlscrubber]] and either [[plugins/htmltidy]] or + [[plugins/contrib/htmlbalance]] if you do this). +* `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this + to allow directives (avoid enabling any [[plugins/type/slow]] directives if you + do this). +* `closed=yes`: use this to prevent new comments while still displaying existing ones. +* `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] + +This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", +and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk. + +Known issues: + +* Needs code review +* The access control via postcomment() is rather strange +* There is some common code cargo-culted from other plugins (notably inline and editpage) which + should probably be shared +* If the postcomment directive is removed from a page, comments can still be made on that page, + and will be committed but not displayed; to disable comments properly you have to set the + closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if + desired -- cgit v1.2.3 From a670bac3e1b53908ad880370a683b1218ecbd6aa Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:43:54 -0500 Subject: Link to postcomment --- doc/todo/supporting_comments_via_disussion_pages.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn index e0495c8c2..88effdfd5 100644 --- a/doc/todo/supporting_comments_via_disussion_pages.mdwn +++ b/doc/todo/supporting_comments_via_disussion_pages.mdwn @@ -213,3 +213,5 @@ do you think so far? Known issues include: un-wikiish). --[[smcv]] + +I've updated smcvpostcomment and publicised it as [[plugins/contrib/postcomment]]. --[[smcv]] -- cgit v1.2.3 From e204a2c2027e3c593aae0c3e334634587e286e8d Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 17 Nov 2008 06:44:50 -0500 Subject: Fix tag directive --- doc/plugins/contrib/postcomment.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/contrib/postcomment.mdwn b/doc/plugins/contrib/postcomment.mdwn index 4d1db6c9b..9875feaae 100644 --- a/doc/plugins/contrib/postcomment.mdwn +++ b/doc/plugins/contrib/postcomment.mdwn @@ -1,5 +1,5 @@ [[!template id=plugin name=postcomment author="[[Simon_McVittie|smcv]]"]] -[[!tag type=useful]] +[[!tag type/useful]] This plugin adds "blog-style" comments. The intention is that on a non-wiki site (like a blog) you can lock all pages for admin-only access, then allow otherwise -- cgit v1.2.3 From c0f4735f1fb93b47f508c18c2f94cf24f147cea5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:09:53 -0500 Subject: adding htmlbalance; housekeeping Used the contrib version of the plugin page since it seemed better than the other one. --- debian/changelog | 6 ++++++ debian/control | 2 +- debian/copyright | 4 ++++ doc/plugins/contrib/htmlbalance.mdwn | 12 ------------ doc/plugins/htmlbalance.mdwn | 6 +++--- 5 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 doc/plugins/contrib/htmlbalance.mdwn diff --git a/debian/changelog b/debian/changelog index dd19c1463..ef46370d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (2.71) UNRELEASED; urgency=low + + * htmlbalance: New plugin contributed by Simon McVittie. + + -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 + ikiwiki (2.70) unstable; urgency=low * Avoid crash on malformed utf-8 discovered by intrigeri. diff --git a/debian/control b/debian/control index fdf2a3a36..fb85551de 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Package: ikiwiki Architecture: all Depends: ${perl:Depends}, markdown | libtext-markdown-perl, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl Recommends: gcc | c-compiler, libc6-dev | libc-dev, subversion | git-core (>= 1:1.5.0) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38), libxml-simple-perl, libnet-openid-consumer-perl, liblwpx-paranoidagent-perl, libtimedate-perl, libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1), libmail-sendmail-perl, libauthen-passphrase-perl -Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng +Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-atom-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng Conflicts: ikiwiki-plugin-table Replaces: ikiwiki-plugin-table Provides: ikiwiki-plugin-table diff --git a/debian/copyright b/debian/copyright index f257234dd..546836226 100644 --- a/debian/copyright +++ b/debian/copyright @@ -76,6 +76,10 @@ Files: htmltidy.pm Copyright: © 2006 Faidon Liambotis License: GPL-2+ +Files: htmlbalance.pm +Copyright: © 2008 Simon McVittie +License: GPL-2+ + Files: polygen.pm, pagestats.pm, cutpaste.pm Copyright: © 2006 Enrico Zini License: GPL-2+ diff --git a/doc/plugins/contrib/htmlbalance.mdwn b/doc/plugins/contrib/htmlbalance.mdwn deleted file mode 100644 index 728e6afc2..000000000 --- a/doc/plugins/contrib/htmlbalance.mdwn +++ /dev/null @@ -1,12 +0,0 @@ -[[!template id=plugin name=htmlbalance author="[[Simon_McVittie|smcv]]"]] -[[!tag type/html]] - -This plugin ensures that the HTML emitted by ikiwiki contains well-balanced -HTML tags, by parsing it with [[!cpan HTML::TreeBuilder]] and re-serializing it. This -acts as a lighter-weight alternative to [[plugins/htmltidy]]; it doesn't -ensure validity, but it does at least ensure that formatting from a -blog post pulled in by the [[ikiwiki/directive/inline]] directive doesn't -leak into the rest of the page. - -htmlbalance is available from the 'htmlbalance' branch in [[smcv]]'s git repository. -I'd like to get this plugin included in ikiwiki - any code review is welcome. diff --git a/doc/plugins/htmlbalance.mdwn b/doc/plugins/htmlbalance.mdwn index 7cdb1f950..f4e2298ee 100644 --- a/doc/plugins/htmlbalance.mdwn +++ b/doc/plugins/htmlbalance.mdwn @@ -1,9 +1,9 @@ -[[!template id=plugin name=htmlbalance author="Simon McVittie"]] +[[!template id=plugin name=htmlbalance author="[[Simon_McVittie|smcv]]"]] [[!tag type/html]] This plugin ensures that the HTML emitted by ikiwiki contains well-balanced -HTML tags, by parsing it with HTML::TreeBuilder and re-serializing it. This +HTML tags, by parsing it with [[!cpan HTML::TreeBuilder]] and re-serializing it. This acts as a lighter-weight alternative to [[plugins/htmltidy]]; it doesn't ensure validity, but it does at least ensure that formatting from a -blog post pulled in by \[[![[ikiwiki/directive/inline]]]] doesn't +blog post pulled in by the [[ikiwiki/directive/inline]] directive doesn't leak into the rest of the page. -- cgit v1.2.3 From 87f360dee4673eda5e54dfb9aaf41d0de6daa422 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:10:25 -0500 Subject: thoughts --- doc/plugins/htmlbalance/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/plugins/htmlbalance/discussion.mdwn diff --git a/doc/plugins/htmlbalance/discussion.mdwn b/doc/plugins/htmlbalance/discussion.mdwn new file mode 100644 index 000000000..bad052f1c --- /dev/null +++ b/doc/plugins/htmlbalance/discussion.mdwn @@ -0,0 +1,8 @@ +Would it be possible to use [[!cpan HTML::Entities]] rather than +`XML::Atom::Util` for encoding entities? The former is already an ikiwiki +dependency (via [[!cpan HTML::Parser]]). + +I also wonder if there's any benefit to using this plugin aside from with +aggregate. Perhaps a small one but aggregate seems like the main case.. +wondering if it would be better to just have aggregate balanace the html +automatically and do away with the separate plugin. --[[Joey]] -- cgit v1.2.3 From e8a945845bd0774c2280da53f8a976c48547ede4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:19:15 -0500 Subject: use perl modules up front The old code actually did the same thing, just obfuscated -- since the eval use wasn't quoted, it used the modules on load. Thus, the error (not to mentioned the return) was bypassed, and it just failed on load. But that seems like the right thing to do, really, so just made it clearer that's what happens. --- IkiWiki/Plugin/htmlbalance.pm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/IkiWiki/Plugin/htmlbalance.pm b/IkiWiki/Plugin/htmlbalance.pm index 667d73b6c..8f43d5dac 100644 --- a/IkiWiki/Plugin/htmlbalance.pm +++ b/IkiWiki/Plugin/htmlbalance.pm @@ -10,6 +10,8 @@ package IkiWiki::Plugin::htmlbalance; use warnings; use strict; use IkiWiki 2.00; +use HTML::TreeBuilder; +use XML::Atom::Util qw(encode_xml); sub import { #{{{ hook(type => "getsetup", id => "htmlbalance", call => \&getsetup); @@ -28,16 +30,6 @@ sub sanitize (@) { #{{{ my %params=@_; my $ret = ''; - eval { - use HTML::TreeBuilder; - use XML::Atom::Util qw(encode_xml); - }; - - if ($@) { - error($@); - return $params{content}; - } - my $tree = HTML::TreeBuilder->new_from_content($params{content}); my @nodes = $tree->disembowel(); foreach my $node (@nodes) { -- cgit v1.2.3 From 43039d7d86ea66578743867a0b1d484e65816bb2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:22:11 -0500 Subject: modify to skip tests if the neccessary perl modules are not available --- t/htmlbalance.t | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/t/htmlbalance.t b/t/htmlbalance.t index cd124e473..783ed9841 100755 --- a/t/htmlbalance.t +++ b/t/htmlbalance.t @@ -1,9 +1,20 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 7; -BEGIN { use_ok("IkiWiki::Plugin::htmlbalance"); } +BEGIN { + eval q{ + use HTML::TreeBuilder; + use XML::Atom::Util qw(encode_xml); + }; + if ($@) { + eval q{use Test::More skip_all => "HTML::TreeBuilder or XML::Atom::Util not available"}; + } + else { + eval q{use Test::More tests => 7}; + } + use_ok("IkiWiki::Plugin::htmlbalance"); +} is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

"), "
"); is(IkiWiki::Plugin::htmlbalance::sanitize(content => "

hello world

"), "

hello world

"); -- cgit v1.2.3 From 181bdbe1a9a8a1eb07259466361d98bdc1378499 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:27:11 -0500 Subject: use HTML::Entities --- IkiWiki/Plugin/htmlbalance.pm | 4 ++-- doc/plugins/htmlbalance/discussion.mdwn | 2 ++ t/htmlbalance.t | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/htmlbalance.pm b/IkiWiki/Plugin/htmlbalance.pm index 8f43d5dac..3a2d62d15 100644 --- a/IkiWiki/Plugin/htmlbalance.pm +++ b/IkiWiki/Plugin/htmlbalance.pm @@ -11,7 +11,7 @@ use warnings; use strict; use IkiWiki 2.00; use HTML::TreeBuilder; -use XML::Atom::Util qw(encode_xml); +use HTML::Entities; sub import { #{{{ hook(type => "getsetup", id => "htmlbalance", call => \&getsetup); @@ -39,7 +39,7 @@ sub sanitize (@) { #{{{ $node->delete(); } else { - $ret .= encode_xml($node); + $ret .= encode_entities($node); } } $tree->delete(); diff --git a/doc/plugins/htmlbalance/discussion.mdwn b/doc/plugins/htmlbalance/discussion.mdwn index bad052f1c..c66528a4f 100644 --- a/doc/plugins/htmlbalance/discussion.mdwn +++ b/doc/plugins/htmlbalance/discussion.mdwn @@ -2,6 +2,8 @@ Would it be possible to use [[!cpan HTML::Entities]] rather than `XML::Atom::Util` for encoding entities? The former is already an ikiwiki dependency (via [[!cpan HTML::Parser]]). +> Now switched to HTML::Entities --[[Joey]] + I also wonder if there's any benefit to using this plugin aside from with aggregate. Perhaps a small one but aggregate seems like the main case.. wondering if it would be better to just have aggregate balanace the html diff --git a/t/htmlbalance.t b/t/htmlbalance.t index 783ed9841..e5a5db0ee 100755 --- a/t/htmlbalance.t +++ b/t/htmlbalance.t @@ -5,10 +5,9 @@ use strict; BEGIN { eval q{ use HTML::TreeBuilder; - use XML::Atom::Util qw(encode_xml); }; if ($@) { - eval q{use Test::More skip_all => "HTML::TreeBuilder or XML::Atom::Util not available"}; + eval q{use Test::More skip_all => "HTML::TreeBuilder not available"}; } else { eval q{use Test::More tests => 7}; -- cgit v1.2.3 From 345c94dd9d3405ca8f1115f467937872a1941eb0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:36:00 -0500 Subject: response --- doc/todo/need_global_renamepage_hook.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index b7aa44880..8265497ae 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -40,3 +40,14 @@ My proposal is thus: I'm of course volunteering to implement this, or anything related that would solve my problem. Hmmm? --[[intrigeri]] + +> I think it would be better to have a different hook that is called for +> renames, since the two hook actions are very different (unlike the +> preprocess hook, which does a very similar thing in scan mode). +> +> Just calling it `rename` seems like a reasonable name, by analogy with +> the `delete` and `change` hooks. +> +> It might make sense to rename `renamepage` to `renamelink` to make it +> clearer what it does. (I'm not very worried about this breaking things, at +> this point.) --[[Joey]] -- cgit v1.2.3 From 2e6157e97747673f4233a7bba3532ee3b609636e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 14:40:24 -0500 Subject: don't need libxml-atom-perl now --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index fb85551de..20434e528 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Package: ikiwiki Architecture: all Depends: ${perl:Depends}, markdown | libtext-markdown-perl, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl Recommends: gcc | c-compiler, libc6-dev | libc-dev, subversion | git-core (>= 1:1.5.0) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38), libxml-simple-perl, libnet-openid-consumer-perl, liblwpx-paranoidagent-perl, libtimedate-perl, libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1), libmail-sendmail-perl, libauthen-passphrase-perl -Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-atom-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng +Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng Conflicts: ikiwiki-plugin-table Replaces: ikiwiki-plugin-table Provides: ikiwiki-plugin-table -- cgit v1.2.3 From 2e8c0bce31ed5b447c031addc00f6a0c28dbc2e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 15:00:33 -0500 Subject: initial comments Done inline on the page, `scuse. --- doc/plugins/contrib/postcomment.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/plugins/contrib/postcomment.mdwn b/doc/plugins/contrib/postcomment.mdwn index 9875feaae..9934baa95 100644 --- a/doc/plugins/contrib/postcomment.mdwn +++ b/doc/plugins/contrib/postcomment.mdwn @@ -7,14 +7,29 @@ unprivileged (or perhaps even anonymous) users to comment on posts. Comments are saved as internal pages, so they can never be edited through the CGI, only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. + +> So, why do it this way, instead of using regular wiki pages in a +> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to +> limit editing of comments in more powerful ways. --[[Joey]] + Directives and raw HTML are filtered out by default, and comment authorship should hopefully be unforgeable by CGI users. +> I'm not sure that raw html should be a problem, as long as the +> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering +> out directives, as a special case. --[[Joey]] + When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!postcomment]]` directive in them. By default, this directive expands to a "post a comment" link plus an `\[[!inline]]` with the comments. +> I don't like this, because it's hard to explain to someone why they have +> to insert this into every post to their blog. Seems that the model used +> for discussion pages could work -- if comments are enabled, automatically +> add the comment posting form and comments to the end of each page. +> --[[Joey]] + The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: @@ -53,3 +68,6 @@ Known issues: and will be committed but not displayed; to disable comments properly you have to set the closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if desired + +> I haven't done a detailed code review, but I will say I'm pleased you +> avoided re-implementing inline! --[[Joey]] -- cgit v1.2.3 From 7aad3b604784a749c1681dbf9dbb89250147cbff Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 15:21:55 -0500 Subject: where can I pull this from? --- doc/todo/mbox.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/todo/mbox.mdwn b/doc/todo/mbox.mdwn index 081d51200..f7744563c 100644 --- a/doc/todo/mbox.mdwn +++ b/doc/todo/mbox.mdwn @@ -14,3 +14,6 @@ I'd like to be able to drop an unmodified RFC2822 email message into ikiwiki, an >>> to page foo). I'm not sure if this is possible and worthwhile to fix. >> It is certainly workable >>> to use a \[[!mailbox ]] directive. -- [[DavidBremner]] + +> Your gitweb doesn't tell me where I can git pull this from, which I'd +> like to do ... --[[Joey]] -- cgit v1.2.3 From 75f262f44dc1b192644252171e77cab90cc7322c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 15:56:15 -0500 Subject: call decode_utf8 inside eval holger reported that decode_utf8 was crashing with perl 5.8.8. Earlier, I thought that passing 0 to the function avoided this with old perls, but that was apparently not enough, it still crashes. So, put it inside the eval, so we can at least recover from it crashing. --- IkiWiki/Plugin/aggregate.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index c9c2880c5..f256b3ac1 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -496,15 +496,19 @@ sub aggregate (@) { #{{{ # that contains invalid UTF-8 sequences. Convert # feed to ascii to try to work around. $feed->{message}.=" ".sprintf(gettext("(invalid UTF-8 stripped from feed)")); - $content=Encode::decode_utf8($content, 0); - $f=eval{XML::Feed->parse(\$content)}; + $f=eval { + $content=Encode::decode_utf8($content, 0); + XML::Feed->parse(\$content) + }; } if ($@) { # Another possibility is badly escaped entities. $feed->{message}.=" ".sprintf(gettext("(feed entities escaped)")); $content=~s/\&(?!amp)(\w+);/&$1;/g; - $content=Encode::decode_utf8($content, 0); - $f=eval{XML::Feed->parse(\$content)}; + $f=eval { + $content=Encode::decode_utf8($content, 0); + XML::Feed->parse(\$content) + }; } if ($@) { $feed->{message}=gettext("feed crashed XML::Feed!")." ($@)"; -- cgit v1.2.3 From 6f3477bf22103239452db81656e467b079c9281b Mon Sep 17 00:00:00 2001 From: "https://id.launchpad.net/882/bielawski1" Date: Mon, 17 Nov 2008 17:34:19 -0500 Subject: --- doc/sandbox.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 986b59eac..722e40851 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -80,6 +80,8 @@ The haiku will change after every save, mind you. Test +Ḷét̨'s̀ şė͜e... + ----- This SandBox is also a [[blog]]! -- cgit v1.2.3 From b56b282bf67321ff2c4f34693b26ec37146912b9 Mon Sep 17 00:00:00 2001 From: "https://id.launchpad.net/882/bielawski1" Date: Mon, 17 Nov 2008 17:39:10 -0500 Subject: stuff --- ..._33____33____33__1__33__1__33____33__1five.html | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/sandbox/Omgwtf_a_blof_post__33____33____33____33____33__1__33__1__33__11111__33____33____33__1__33__1__33____33__1five.html diff --git a/doc/sandbox/Omgwtf_a_blof_post__33____33____33____33____33__1__33__1__33__11111__33____33____33__1__33__1__33____33__1five.html b/doc/sandbox/Omgwtf_a_blof_post__33____33____33____33____33__1__33__1__33__11111__33____33____33__1__33__1__33____33__1five.html new file mode 100644 index 000000000..fc1757d6e --- /dev/null +++ b/doc/sandbox/Omgwtf_a_blof_post__33____33____33____33____33__1__33__1__33__11111__33____33____33__1__33__1__33____33__1five.html @@ -0,0 +1,31 @@ + + + + + + a + + + + b + + + 2 + + - + + + + + x + + + y + + + + i + + + +
+test testT.

test

+øđ -- cgit v1.2.3 From 767bf9c4838277602b75522275c9f08d122f37a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 17 Nov 2008 18:45:55 -0500 Subject: Change deb dependencies to list Text::Markdown before markdown (really this time). --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ef46370d6..294cae6dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (2.71) UNRELEASED; urgency=low * htmlbalance: New plugin contributed by Simon McVittie. + * Change deb dependencies to list Text::Markdown before markdown (really + this time). -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/debian/control b/debian/control index 20434e528..0db972ff7 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Vcs-Browser: http://git.ikiwiki.info/?p=ikiwiki Package: ikiwiki Architecture: all -Depends: ${perl:Depends}, markdown | libtext-markdown-perl, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl +Depends: ${perl:Depends}, libtext-markdown-perl | markdown, libhtml-scrubber-perl, libhtml-template-perl, libhtml-parser-perl, liburi-perl Recommends: gcc | c-compiler, libc6-dev | libc-dev, subversion | git-core (>= 1:1.5.0) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38), libxml-simple-perl, libnet-openid-consumer-perl, liblwpx-paranoidagent-perl, libtimedate-perl, libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1), libmail-sendmail-perl, libauthen-passphrase-perl Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, xapian-omega (>= 1.0.5), librpc-xml-perl, libtext-wikiformat-perl, python, python-docutils, polygen, tidy, libhtml-tree-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, sparkline-php, texlive, dvipng Conflicts: ikiwiki-plugin-table -- cgit v1.2.3 From 15269fed646bf14692061e634969c98b614daaad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 02:43:17 -0500 Subject: improve escaping of wikilinks and preprocessor directives The old method failed for '[' x 3. --- IkiWiki/Plugin/aggregate.pm | 8 +++----- IkiWiki/Plugin/recentchanges.pm | 3 ++- IkiWiki/Plugin/recentchangesdiff.pm | 3 ++- debian/changelog | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index f256b3ac1..6cdbbc0e9 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -610,7 +610,7 @@ sub add_page (@) { #{{{ my $template=template($feed->{template}, blind_cache => 1); $template->param(title => $params{title}) if defined $params{title} && length($params{title}); - $template->param(content => htmlescape(htmlabs($params{content}, + $template->param(content => wikiescape(htmlabs($params{content}, defined $params{base} ? $params{base} : $feed->{feedurl}))); $template->param(name => $feed->{name}); $template->param(url => $feed->{url}); @@ -637,11 +637,9 @@ sub add_page (@) { #{{{ } } #}}} -sub htmlescape ($) { #{{{ +sub wikiescape ($) { #{{{ # escape accidental wikilinks and preprocessor stuff - my $html=shift; - $html=~s/(? "getsetup", id => "recentchanges", call => \&getsetup); @@ -163,7 +164,7 @@ sub store ($$$) { #{{{ if (ref $change->{message}) { foreach my $field (@{$change->{message}}) { if (exists $field->{line}) { - $field->{line} =~ s/(?{line} = encode_entities($field->{line}, '\[\]'); } } } diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index 36acef72e..bc793bada 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -4,6 +4,7 @@ package IkiWiki::Plugin::recentchangesdiff; use warnings; use strict; use IkiWiki 2.00; +use HTML::Entities; my $maxlines=200; @@ -39,7 +40,7 @@ sub pagetemplate (@) { #{{{ $diff=join("", @lines); } # escape links and preprocessor stuff - $diff =~ s/(?param(diff => $diff); } } diff --git a/debian/changelog b/debian/changelog index 294cae6dc..eeb9fe6ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ikiwiki (2.71) UNRELEASED; urgency=low * htmlbalance: New plugin contributed by Simon McVittie. * Change deb dependencies to list Text::Markdown before markdown (really this time). + * Improve escaping of wikilinks and preprocessor directives in content + produced by aggregate and recentchanges. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 -- cgit v1.2.3 From e307eeda3d55446f4bdeb2ac48f4fef0c24b1f3d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 02:48:24 -0500 Subject: html escaping complication Can't escape things to entities if the template then escapes the entities. (aggregate doesn't have this problem.) --- IkiWiki/Plugin/recentchanges.pm | 4 +++- IkiWiki/Plugin/recentchangesdiff.pm | 2 ++ templates/change.tmpl | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 39a123ccf..4d7023c1c 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -160,10 +160,12 @@ sub store ($$$) { #{{{ ); } - # escape wikilinks and preprocessor stuff in commit messages if (ref $change->{message}) { foreach my $field (@{$change->{message}}) { if (exists $field->{line}) { + # escape html + $field->{line} = encode_entities($field->{line}); + # escape links and preprocessor stuff $field->{line} = encode_entities($field->{line}, '\[\]'); } } diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index bc793bada..08cec3f5a 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -39,6 +39,8 @@ sub pagetemplate (@) { #{{{ else { $diff=join("", @lines); } + # escape html + $diff = encode_entities($diff); # escape links and preprocessor stuff $diff = encode_entities($diff, '\[\]'); $template->param(diff => $diff); diff --git a/templates/change.tmpl b/templates/change.tmpl index 0aebae61e..0e61a80f4 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -32,14 +32,14 @@
-
+
-
+
 
-- cgit v1.2.3 From 2953b9d850718f2b27badc5d204b930fa23872cc Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 04:15:58 -0500 Subject: response --- doc/plugins/contrib/postcomment.mdwn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/plugins/contrib/postcomment.mdwn b/doc/plugins/contrib/postcomment.mdwn index 9934baa95..2e501995f 100644 --- a/doc/plugins/contrib/postcomment.mdwn +++ b/doc/plugins/contrib/postcomment.mdwn @@ -12,6 +12,19 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] > namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to > limit editing of comments in more powerful ways. --[[Joey]] +>> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines +>> rather than as individual pages (same reasoning as aggregated posts), though. +>> +>> lockedit is actually somewhat insufficient, since `check_canedit()` +>> doesn't distinguish between creation and editing; I'd have to continue to use +>> some sort of odd hack to allow creation but not editing. +>> +>> I also can't think of any circumstance where you'd want a user other than +>> admins (~= git committers) and possibly the commenter (who we can't check for +>> at the moment anyway, I don't think?) to be able to edit comments - I think +>> user expectations for something that looks like ordinary blog comments are +>> likely to include "others can't put words into my mouth". --[[smcv]] + Directives and raw HTML are filtered out by default, and comment authorship should hopefully be unforgeable by CGI users. @@ -19,6 +32,13 @@ hopefully be unforgeable by CGI users. > htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering > out directives, as a special case. --[[Joey]] +>> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy +>> or htmlbalance turned on, then there should be no way the user can forge a comment; +>> I was initially wary of allowing meta directives, but I think those are OK, as long +>> as the comment template puts the \[[!meta author]] at the *end*. Disallowing +>> directives is more a way to avoid commenters causing expensive processing than +>> anything else, at this point. --[[smcv]] + When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!postcomment]]` directive in them. By default, this directive expands to a "post a comment" link plus an `\[[!inline]]` with @@ -30,6 +50,16 @@ the comments. > add the comment posting form and comments to the end of each page. > --[[Joey]] +>> I don't think I'd want comments on *every* page (particularly, not the +>> front page). Perhaps a pagespec in the setup file, where the default is "*"? +>> Then control freaks like me could use "link(tags/comments)" and tag pages +>> as allowing comments. +>> +>> The model used for discussion pages does require patching the existing +>> page template, which I was trying to avoid - I'm not convinced that having +>> every possible feature hard-coded there really scales (and obviously it's +>> rather annoying while this plugin is on a branch). --[[smcv]] + The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: -- cgit v1.2.3 From 8f43b3ff8db0f76f5d1c39a95118347c9057e19b Mon Sep 17 00:00:00 2001 From: "http://technorati.com/people/technorati/drajt" Date: Tue, 18 Nov 2008 04:48:06 -0500 Subject: --- doc/ikiwikiusers.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 2492fd211..ac46fcc7f 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -104,6 +104,7 @@ Personal sites and blogs * [[JonDowland]]'s [homepage](http://jmtd.net/) * [[xma]] is using ikiwiki () * [[JanWalzer|jwalzer]]'s [homepage](http://wa.lzer.net/) -- Work in Progress +* [Adam Trickett's home intranet and sanbox system](http://www.iredale.net) -- no wiki component visible yet Please feel free to add your own ikiwiki site! -- cgit v1.2.3 From 75a333539929f12b465071f9203f58f2eacd5f3f Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:12:44 -0500 Subject: rename plugins/contrib/postcomment.mdwn to plugins/contrib/comments.mdwn --- doc/plugins/contrib/comments.mdwn | 103 +++++++++++++++++++++++++++++++++++ doc/plugins/contrib/postcomment.mdwn | 103 ----------------------------------- 2 files changed, 103 insertions(+), 103 deletions(-) create mode 100644 doc/plugins/contrib/comments.mdwn delete mode 100644 doc/plugins/contrib/postcomment.mdwn diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn new file mode 100644 index 000000000..2e501995f --- /dev/null +++ b/doc/plugins/contrib/comments.mdwn @@ -0,0 +1,103 @@ +[[!template id=plugin name=postcomment author="[[Simon_McVittie|smcv]]"]] +[[!tag type/useful]] + +This plugin adds "blog-style" comments. The intention is that on a non-wiki site +(like a blog) you can lock all pages for admin-only access, then allow otherwise +unprivileged (or perhaps even anonymous) users to comment on posts. + +Comments are saved as internal pages, so they can never be edited through the CGI, +only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. + +> So, why do it this way, instead of using regular wiki pages in a +> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to +> limit editing of comments in more powerful ways. --[[Joey]] + +>> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines +>> rather than as individual pages (same reasoning as aggregated posts), though. +>> +>> lockedit is actually somewhat insufficient, since `check_canedit()` +>> doesn't distinguish between creation and editing; I'd have to continue to use +>> some sort of odd hack to allow creation but not editing. +>> +>> I also can't think of any circumstance where you'd want a user other than +>> admins (~= git committers) and possibly the commenter (who we can't check for +>> at the moment anyway, I don't think?) to be able to edit comments - I think +>> user expectations for something that looks like ordinary blog comments are +>> likely to include "others can't put words into my mouth". --[[smcv]] + +Directives and raw HTML are filtered out by default, and comment authorship should +hopefully be unforgeable by CGI users. + +> I'm not sure that raw html should be a problem, as long as the +> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering +> out directives, as a special case. --[[Joey]] + +>> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy +>> or htmlbalance turned on, then there should be no way the user can forge a comment; +>> I was initially wary of allowing meta directives, but I think those are OK, as long +>> as the comment template puts the \[[!meta author]] at the *end*. Disallowing +>> directives is more a way to avoid commenters causing expensive processing than +>> anything else, at this point. --[[smcv]] + +When comments have been enabled generally, you still need to mark which pages +can have comments, by including the `\[[!postcomment]]` directive in them. By default, +this directive expands to a "post a comment" link plus an `\[[!inline]]` with +the comments. + +> I don't like this, because it's hard to explain to someone why they have +> to insert this into every post to their blog. Seems that the model used +> for discussion pages could work -- if comments are enabled, automatically +> add the comment posting form and comments to the end of each page. +> --[[Joey]] + +>> I don't think I'd want comments on *every* page (particularly, not the +>> front page). Perhaps a pagespec in the setup file, where the default is "*"? +>> Then control freaks like me could use "link(tags/comments)" and tag pages +>> as allowing comments. +>> +>> The model used for discussion pages does require patching the existing +>> page template, which I was trying to avoid - I'm not convinced that having +>> every possible feature hard-coded there really scales (and obviously it's +>> rather annoying while this plugin is on a branch). --[[smcv]] + +The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use +with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from +the [[plugins/lockedit]] plugin. Typical usage would be something like: + + locked_pages => "!postcomment(*)" + +to allow non-admin users to comment on pages, but not edit anything. You can also do + + anonok_pages => "postcomment(*)" + +to allow anonymous comments (the IP address will be used as the "author"). + +Optional parameters to the postcomment directive: + +* `commit=no`: by default, comments are committed to version control. Use this to + disable commits. +* `allowhtml=yes`: by default, raw HTML is filtered out. Use this to allow HTML + (you should enable [[plugins/htmlscrubber]] and either [[plugins/htmltidy]] or + [[plugins/contrib/htmlbalance]] if you do this). +* `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this + to allow directives (avoid enabling any [[plugins/type/slow]] directives if you + do this). +* `closed=yes`: use this to prevent new comments while still displaying existing ones. +* `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] + +This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", +and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk. + +Known issues: + +* Needs code review +* The access control via postcomment() is rather strange +* There is some common code cargo-culted from other plugins (notably inline and editpage) which + should probably be shared +* If the postcomment directive is removed from a page, comments can still be made on that page, + and will be committed but not displayed; to disable comments properly you have to set the + closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if + desired + +> I haven't done a detailed code review, but I will say I'm pleased you +> avoided re-implementing inline! --[[Joey]] diff --git a/doc/plugins/contrib/postcomment.mdwn b/doc/plugins/contrib/postcomment.mdwn deleted file mode 100644 index 2e501995f..000000000 --- a/doc/plugins/contrib/postcomment.mdwn +++ /dev/null @@ -1,103 +0,0 @@ -[[!template id=plugin name=postcomment author="[[Simon_McVittie|smcv]]"]] -[[!tag type/useful]] - -This plugin adds "blog-style" comments. The intention is that on a non-wiki site -(like a blog) you can lock all pages for admin-only access, then allow otherwise -unprivileged (or perhaps even anonymous) users to comment on posts. - -Comments are saved as internal pages, so they can never be edited through the CGI, -only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. - -> So, why do it this way, instead of using regular wiki pages in a -> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to -> limit editing of comments in more powerful ways. --[[Joey]] - ->> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines ->> rather than as individual pages (same reasoning as aggregated posts), though. ->> ->> lockedit is actually somewhat insufficient, since `check_canedit()` ->> doesn't distinguish between creation and editing; I'd have to continue to use ->> some sort of odd hack to allow creation but not editing. ->> ->> I also can't think of any circumstance where you'd want a user other than ->> admins (~= git committers) and possibly the commenter (who we can't check for ->> at the moment anyway, I don't think?) to be able to edit comments - I think ->> user expectations for something that looks like ordinary blog comments are ->> likely to include "others can't put words into my mouth". --[[smcv]] - -Directives and raw HTML are filtered out by default, and comment authorship should -hopefully be unforgeable by CGI users. - -> I'm not sure that raw html should be a problem, as long as the -> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering -> out directives, as a special case. --[[Joey]] - ->> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy ->> or htmlbalance turned on, then there should be no way the user can forge a comment; ->> I was initially wary of allowing meta directives, but I think those are OK, as long ->> as the comment template puts the \[[!meta author]] at the *end*. Disallowing ->> directives is more a way to avoid commenters causing expensive processing than ->> anything else, at this point. --[[smcv]] - -When comments have been enabled generally, you still need to mark which pages -can have comments, by including the `\[[!postcomment]]` directive in them. By default, -this directive expands to a "post a comment" link plus an `\[[!inline]]` with -the comments. - -> I don't like this, because it's hard to explain to someone why they have -> to insert this into every post to their blog. Seems that the model used -> for discussion pages could work -- if comments are enabled, automatically -> add the comment posting form and comments to the end of each page. -> --[[Joey]] - ->> I don't think I'd want comments on *every* page (particularly, not the ->> front page). Perhaps a pagespec in the setup file, where the default is "*"? ->> Then control freaks like me could use "link(tags/comments)" and tag pages ->> as allowing comments. ->> ->> The model used for discussion pages does require patching the existing ->> page template, which I was trying to avoid - I'm not convinced that having ->> every possible feature hard-coded there really scales (and obviously it's ->> rather annoying while this plugin is on a branch). --[[smcv]] - -The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use -with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from -the [[plugins/lockedit]] plugin. Typical usage would be something like: - - locked_pages => "!postcomment(*)" - -to allow non-admin users to comment on pages, but not edit anything. You can also do - - anonok_pages => "postcomment(*)" - -to allow anonymous comments (the IP address will be used as the "author"). - -Optional parameters to the postcomment directive: - -* `commit=no`: by default, comments are committed to version control. Use this to - disable commits. -* `allowhtml=yes`: by default, raw HTML is filtered out. Use this to allow HTML - (you should enable [[plugins/htmlscrubber]] and either [[plugins/htmltidy]] or - [[plugins/contrib/htmlbalance]] if you do this). -* `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this - to allow directives (avoid enabling any [[plugins/type/slow]] directives if you - do this). -* `closed=yes`: use this to prevent new comments while still displaying existing ones. -* `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] - -This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", -and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk. - -Known issues: - -* Needs code review -* The access control via postcomment() is rather strange -* There is some common code cargo-culted from other plugins (notably inline and editpage) which - should probably be shared -* If the postcomment directive is removed from a page, comments can still be made on that page, - and will be committed but not displayed; to disable comments properly you have to set the - closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if - desired - -> I haven't done a detailed code review, but I will say I'm pleased you -> avoided re-implementing inline! --[[Joey]] -- cgit v1.2.3 From 284b79b36aa924366f34048b2ee8c40ea5b8d180 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:12:52 -0500 Subject: update for rename of plugins/contrib/postcomment.mdwn to plugins/contrib/comments.mdwn --- doc/todo/supporting_comments_via_disussion_pages.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn index 88effdfd5..bc4e331d0 100644 --- a/doc/todo/supporting_comments_via_disussion_pages.mdwn +++ b/doc/todo/supporting_comments_via_disussion_pages.mdwn @@ -214,4 +214,4 @@ do you think so far? Known issues include: --[[smcv]] -I've updated smcvpostcomment and publicised it as [[plugins/contrib/postcomment]]. --[[smcv]] +I've updated smcvpostcomment and publicised it as [[plugins/contrib/comments]]. --[[smcv]] -- cgit v1.2.3 From 22fb4e4d3394b010288bd2a34df64f01110123d1 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:12:53 -0500 Subject: update for rename of plugins/contrib/postcomment.mdwn to plugins/contrib/comments.mdwn --- doc/users/smcv.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/smcv.mdwn b/doc/users/smcv.mdwn index c1cc62a81..abd443563 100644 --- a/doc/users/smcv.mdwn +++ b/doc/users/smcv.mdwn @@ -7,4 +7,4 @@ My repository containing ikiwiki branches: * gitweb: http://git.pseudorandom.co.uk/smcv/ikiwiki.git * anongit: git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git -I'm working on the [[plugins/contrib/htmlbalance]] and [[plugins/contrib/postcomment]] plugins. +I'm working on the [[plugins/contrib/htmlbalance]] and [[plugins/contrib/comments]] plugins. -- cgit v1.2.3 From bd14203c0b8ca9b736a73e70440c4ee3b571618f Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:37:36 -0500 Subject: update --- doc/plugins/contrib/comments.mdwn | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 2e501995f..3e6dcfd76 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -1,4 +1,4 @@ -[[!template id=plugin name=postcomment author="[[Simon_McVittie|smcv]]"]] +[[!template id=plugin name=comments author="[[Simon_McVittie|smcv]]"]] [[!tag type/useful]] This plugin adds "blog-style" comments. The intention is that on a non-wiki site @@ -23,7 +23,12 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> admins (~= git committers) and possibly the commenter (who we can't check for >> at the moment anyway, I don't think?) to be able to edit comments - I think >> user expectations for something that looks like ordinary blog comments are ->> likely to include "others can't put words into my mouth". --[[smcv]] +>> likely to include "others can't put words into my mouth". +>> +>> My other objection to using a namespace is that I'm not particularly happy about +>> plugins consuming arbitrary pieces of the wiki namespace - /discussion is bad +>> enough already. Indeed, this very page would accidentally get matched by rules +>> aiming to control comment-posting... :-) --[[smcv]] Directives and raw HTML are filtered out by default, and comment authorship should hopefully be unforgeable by CGI users. @@ -37,10 +42,14 @@ hopefully be unforgeable by CGI users. >> I was initially wary of allowing meta directives, but I think those are OK, as long >> as the comment template puts the \[[!meta author]] at the *end*. Disallowing >> directives is more a way to avoid commenters causing expensive processing than ->> anything else, at this point. --[[smcv]] +>> anything else, at this point. +>> +>> I've rebased the plugin on master and made it sanitize individual posts' content now. +>> Disallowing HTML is still optional and on by default, but it's trivial to remove +>> the code. --[[smcv]] When comments have been enabled generally, you still need to mark which pages -can have comments, by including the `\[[!postcomment]]` directive in them. By default, +can have comments, by including the `\[[!comments]]` directive in them. By default, this directive expands to a "post a comment" link plus an `\[[!inline]]` with the comments. @@ -72,7 +81,10 @@ to allow non-admin users to comment on pages, but not edit anything. You can als to allow anonymous comments (the IP address will be used as the "author"). -Optional parameters to the postcomment directive: +> This is still called postcomment, although I've renamed the rest of the plugin +> to comments as suggested on #ikiwiki --[[smcv]] + +Optional parameters to the comments directive: * `commit=no`: by default, comments are committed to version control. Use this to disable commits. @@ -86,7 +98,8 @@ Optional parameters to the postcomment directive: * `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", -and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk. +and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the +`postcomment` branch). Known issues: @@ -94,7 +107,7 @@ Known issues: * The access control via postcomment() is rather strange * There is some common code cargo-culted from other plugins (notably inline and editpage) which should probably be shared -* If the postcomment directive is removed from a page, comments can still be made on that page, +* If the comments directive is removed from a page, comments can still be made on that page, and will be committed but not displayed; to disable comments properly you have to set the closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if desired -- cgit v1.2.3 From c66a3f9ca7bc3ae827e9cfe19ee0aef728218d0e Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:40:23 -0500 Subject: Fix link to htmlbalance --- doc/plugins/contrib/comments.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 3e6dcfd76..6e6202993 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -89,8 +89,8 @@ Optional parameters to the comments directive: * `commit=no`: by default, comments are committed to version control. Use this to disable commits. * `allowhtml=yes`: by default, raw HTML is filtered out. Use this to allow HTML - (you should enable [[plugins/htmlscrubber]] and either [[plugins/htmltidy]] or - [[plugins/contrib/htmlbalance]] if you do this). + (you should enable [[htmlscrubber]] and either [[htmltidy]] or + [[htmlbalance]] if you do this). * `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this to allow directives (avoid enabling any [[plugins/type/slow]] directives if you do this). -- cgit v1.2.3 From c9bddc159192ca7b8c69fd958586ac2717f56121 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 05:54:34 -0500 Subject: update --- doc/users/smcv.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/smcv.mdwn b/doc/users/smcv.mdwn index abd443563..4ec100a72 100644 --- a/doc/users/smcv.mdwn +++ b/doc/users/smcv.mdwn @@ -7,4 +7,4 @@ My repository containing ikiwiki branches: * gitweb: http://git.pseudorandom.co.uk/smcv/ikiwiki.git * anongit: git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git -I'm working on the [[plugins/contrib/htmlbalance]] and [[plugins/contrib/comments]] plugins. +Currently working on the [[comments]] plugin. -- cgit v1.2.3 From c5a7d98b54623cf501bd2cd6c188641c406318ff Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 06:14:08 -0500 Subject: Raw HTML now allowed, joeyh convinced me :-) --- doc/plugins/contrib/comments.mdwn | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 6e6202993..6ba181232 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -30,8 +30,10 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> enough already. Indeed, this very page would accidentally get matched by rules >> aiming to control comment-posting... :-) --[[smcv]] -Directives and raw HTML are filtered out by default, and comment authorship should -hopefully be unforgeable by CGI users. +When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] +or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing +down the wiki by causing time-consuming processing. As long as the recommended plugins +are enabled, comment authorship should hopefully be unforgeable by CGI users. > I'm not sure that raw html should be a problem, as long as the > htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering @@ -44,9 +46,8 @@ hopefully be unforgeable by CGI users. >> directives is more a way to avoid commenters causing expensive processing than >> anything else, at this point. >> ->> I've rebased the plugin on master and made it sanitize individual posts' content now. ->> Disallowing HTML is still optional and on by default, but it's trivial to remove ->> the code. --[[smcv]] +>> I've rebased the plugin on master, made it sanitize individual posts' content +>> and removed the option to disallow raw HTML. --[[smcv]] When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!comments]]` directive in them. By default, @@ -88,9 +89,6 @@ Optional parameters to the comments directive: * `commit=no`: by default, comments are committed to version control. Use this to disable commits. -* `allowhtml=yes`: by default, raw HTML is filtered out. Use this to allow HTML - (you should enable [[htmlscrubber]] and either [[htmltidy]] or - [[htmlbalance]] if you do this). * `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this to allow directives (avoid enabling any [[plugins/type/slow]] directives if you do this). -- cgit v1.2.3 From 1c4a005986b7fcf9cf99f370ca91ffe41484e34b Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 06:58:39 -0500 Subject: Fix link --- doc/users/smcv.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/smcv.mdwn b/doc/users/smcv.mdwn index 4ec100a72..c52aa8f0f 100644 --- a/doc/users/smcv.mdwn +++ b/doc/users/smcv.mdwn @@ -7,4 +7,4 @@ My repository containing ikiwiki branches: * gitweb: http://git.pseudorandom.co.uk/smcv/ikiwiki.git * anongit: git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git -Currently working on the [[comments]] plugin. +Currently working on the [[plugins/contrib/comments]] plugin. -- cgit v1.2.3 From 28ffff103045a75b984a6cb8aa6958c736cc8cb4 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Tue, 18 Nov 2008 07:07:25 -0500 Subject: --- doc/plugins/contrib/comments.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 6ba181232..d56de4466 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -97,7 +97,8 @@ Optional parameters to the comments directive: This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the -`postcomment` branch). +`postcomment` branch). A demo wiki with the plugin enabled is running at +. Known issues: -- cgit v1.2.3 From 0eca0b4dffd2df534ac815195207bc889895fa47 Mon Sep 17 00:00:00 2001 From: "http://mjr.towers.org.uk/" Date: Tue, 18 Nov 2008 08:14:57 -0500 Subject: auto-hosting sites --- doc/ikiwikiusers/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ikiwikiusers/discussion.mdwn b/doc/ikiwikiusers/discussion.mdwn index 2da3668d4..39a9bb921 100644 --- a/doc/ikiwikiusers/discussion.mdwn +++ b/doc/ikiwikiusers/discussion.mdwn @@ -29,3 +29,7 @@ Thanks, --[[Chao]] Thanks for the reply Joey! ikiwiki is a fantastic wiki complier, though I do not have my own machine momentarily, i will pay close attention to its development. Hopefully I will be one of the ikiwiki users one day :) cheers --[[Chao]] + +---- + +Are there automated hosting sites for ikiwiki yet? If you know one, can you add one in a new section on [[ikiwikiusers]] please? If you don't know any and you're willing to pay to set one up (shouldn't be much more expensive than a single ikiwiki IMO), [contact me](http://www.ttllp.co.uk/contact.html) and let's talk. -- MJR -- cgit v1.2.3 From 447d3ae258070be5e421b17b2aef4fe80031583c Mon Sep 17 00:00:00 2001 From: "http://mjr.towers.org.uk/" Date: Tue, 18 Nov 2008 08:20:30 -0500 Subject: Further details --- doc/bugs/login_page_should_note_cookie_requirement.mdwn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/bugs/login_page_should_note_cookie_requirement.mdwn b/doc/bugs/login_page_should_note_cookie_requirement.mdwn index e2d5a352b..bd52f1c21 100644 --- a/doc/bugs/login_page_should_note_cookie_requirement.mdwn +++ b/doc/bugs/login_page_should_note_cookie_requirement.mdwn @@ -4,6 +4,9 @@ At the moment, you go through the login shuffle and then are told that cookies a > websites that have a login require cookies. Such warnings used to be > common, but few sites bother with them anymore. --[[Joey]] +>> Very few websites break without cookies. Even fewer lose data. +>> Can ikiwiki avoid being below average by default? --[MJR](http://mjr.towers.org.uk) + Even better would be to only display the cookie note as a warning if the login page doesn't receive a session cookie. > I considered doing this before, but it would require running the cgi once @@ -15,3 +18,5 @@ Best of all would be to use URL-based or hidden-field-based session tokens if co > This is not very doable since most of the pages the user browses are > static pages in a static location. + +>> The pages that lose data without cookies (the edit pages, primarily) don't look static. Are they really? --[MJR](http://mjr.towers.org.uk) -- cgit v1.2.3 From 19e34cb62ec8c891f060cbf9b2340510c7cb0331 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 12:56:02 -0500 Subject: respond, sheesh --- doc/bugs/login_page_should_note_cookie_requirement.mdwn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/bugs/login_page_should_note_cookie_requirement.mdwn b/doc/bugs/login_page_should_note_cookie_requirement.mdwn index bd52f1c21..32d971548 100644 --- a/doc/bugs/login_page_should_note_cookie_requirement.mdwn +++ b/doc/bugs/login_page_should_note_cookie_requirement.mdwn @@ -7,6 +7,10 @@ At the moment, you go through the login shuffle and then are told that cookies a >> Very few websites break without cookies. Even fewer lose data. >> Can ikiwiki avoid being below average by default? --[MJR](http://mjr.towers.org.uk) +>>> Can we avoid engaging in hyperbole? (Hint: Your browser probably has a +>>> back button. Hint 2: A username/password does not count as "lost data". +>>> Hint 3: Now we're arguing, which is pointless.) --[[Joey]] + Even better would be to only display the cookie note as a warning if the login page doesn't receive a session cookie. > I considered doing this before, but it would require running the cgi once @@ -19,4 +23,7 @@ Best of all would be to use URL-based or hidden-field-based session tokens if co > This is not very doable since most of the pages the user browses are > static pages in a static location. ->> The pages that lose data without cookies (the edit pages, primarily) don't look static. Are they really? --[MJR](http://mjr.towers.org.uk) +>> The pages that lose data without cookies (the edit pages, primarily) +>> don't look static. Are they really? --[MJR](http://mjr.towers.org.uk)a + +>>> As soon as you post an edit page, you are back to a static website. -- cgit v1.2.3 From a990afd2f735381c81684c8faac011bbdafd09ee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 13:46:03 -0500 Subject: avoid uninitialized value warning --- IkiWiki/Plugin/aggregate.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 6cdbbc0e9..adaa619ab 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -535,7 +535,7 @@ sub aggregate (@) { #{{{ copyright => $f->copyright, title => defined $entry->title ? decode_entities($entry->title) : "untitled", link => $entry->link, - content => defined $c ? $c->body : "", + content => (defined $c && defined $c->body) ? $c->body : "", guid => defined $entry->id ? $entry->id : time."_".$feed->{name}, ctime => $entry->issued ? ($entry->issued->epoch || time) : time, base => (defined $c && $c->can("base")) ? $c->base : undef, -- cgit v1.2.3 From 9b1be757ddb2f1982cb0ca89bff11a78d76faa00 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 14:03:44 -0500 Subject: responses --- doc/plugins/contrib/comments.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index d56de4466..41bfa0004 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -30,6 +30,11 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> enough already. Indeed, this very page would accidentally get matched by rules >> aiming to control comment-posting... :-) --[[smcv]] +>> The best reason to keep the pages internal seems to me to be that you +>> don't want the overhead of every comment spawning its own wiki page. +>> The worst problem with it though is that you have to assume the pages +>> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] + When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing down the wiki by causing time-consuming processing. As long as the recommended plugins @@ -49,6 +54,16 @@ are enabled, comment authorship should hopefully be unforgeable by CGI users. >> I've rebased the plugin on master, made it sanitize individual posts' content >> and removed the option to disallow raw HTML. --[[smcv]] +>> There might be some use cases for other directives, such as img, in +>> comments. +>> +>> I don't know if meta is "safe" (ie, guaranteed to be inexpensive and not +>> allow users to do annoying things) or if it will continue to be in the +>> future. Hard to predict really, all that can be said with certainty is +>> all directives will contine to be inexpensive and safe enough that it's +>> sensible to allow users to (ab)use them on open wikis. +>> --[[Joey]] + When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!comments]]` directive in them. By default, this directive expands to a "post a comment" link plus an `\[[!inline]]` with @@ -65,11 +80,16 @@ the comments. >> Then control freaks like me could use "link(tags/comments)" and tag pages >> as allowing comments. >> +>>> Yes, I think a pagespec is the way to go. --[[Joey]] +>> >> The model used for discussion pages does require patching the existing >> page template, which I was trying to avoid - I'm not convinced that having >> every possible feature hard-coded there really scales (and obviously it's >> rather annoying while this plugin is on a branch). --[[smcv]] +>>> Using the template would allow customising the html around the comments +>>> which seems like a good thing? + The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: -- cgit v1.2.3 From 23f5874a56f66c0bb5d5921d21418c7363786b1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2008 14:12:52 -0500 Subject: another thought --- doc/plugins/contrib/comments.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 41bfa0004..0957e74fa 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -33,7 +33,13 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> The best reason to keep the pages internal seems to me to be that you >> don't want the overhead of every comment spawning its own wiki page. >> The worst problem with it though is that you have to assume the pages ->> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] +>> are mdwn (or `default_pageext`) and not support other formats. + +>> By the way, I think that who can post comments should be controllable by +>> the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing +>> posting comments w/o any login, while a nice capability, can lead to +>> spam problems. So, use `check_canedit` as at least a first-level check? +>> --[[Joey]] When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing -- cgit v1.2.3 From 3c9c348578abbb0f687ccb6a41540d4a5e124af5 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Wed, 19 Nov 2008 00:10:10 -0500 Subject: Client side cookie detection with javascript? --- doc/bugs/login_page_should_note_cookie_requirement.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/bugs/login_page_should_note_cookie_requirement.mdwn b/doc/bugs/login_page_should_note_cookie_requirement.mdwn index 32d971548..96686053c 100644 --- a/doc/bugs/login_page_should_note_cookie_requirement.mdwn +++ b/doc/bugs/login_page_should_note_cookie_requirement.mdwn @@ -18,12 +18,16 @@ Even better would be to only display the cookie note as a warning if the login p > time to check if it took, which is both complicated and probably would > look bad. +>> Might this be possible client-side with javascript? A quick google suggests it is possible: +>> . MJR, want to try adding +>> that? -- [[Will]] + Best of all would be to use URL-based or hidden-field-based session tokens if cookies are not permitted. > This is not very doable since most of the pages the user browses are > static pages in a static location. >> The pages that lose data without cookies (the edit pages, primarily) ->> don't look static. Are they really? --[MJR](http://mjr.towers.org.uk)a +>> don't look static. Are they really? --[MJR](http://mjr.towers.org.uk) >>> As soon as you post an edit page, you are back to a static website. -- cgit v1.2.3 From 1ecb72160b1bb6bfa37c7417e398871a381e8771 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 19 Nov 2008 05:30:27 -0500 Subject: respond to joey, some more suggestions --- doc/plugins/contrib/comments.mdwn | 71 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 0957e74fa..89566d051 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -30,10 +30,34 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> enough already. Indeed, this very page would accidentally get matched by rules >> aiming to control comment-posting... :-) --[[smcv]] +>> Thinking about it, perhaps one way to address this would be to have the suffix +>> (e.g. whether commenting on Sandbox creates sandbox/comment1 or sandbox/c1 or +>> what) be configurable by the wiki admin, in the same way that recentchanges has +>> recentchangespage => 'recentchanges'? I'd like to see fewer hard-coded page +>> names in general, really - it seems odd to me that shortcuts and smileys +>> hard-code the name of the page to look at. Perhaps I could add +>> discussionpage => 'discussion' too? --[[smcv]] + >> The best reason to keep the pages internal seems to me to be that you >> don't want the overhead of every comment spawning its own wiki page. >> The worst problem with it though is that you have to assume the pages ->> are mdwn (or `default_pageext`) and not support other formats. +>> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] + +>> Well, you could always have `comment1._mdwn`, `comment2._creole` etc. and +>> alter the htmlize logic so that the `mdwn` hook is called for both `mdwn` +>> and `_mdwn` (assuming this is not already the case). I'm not convinced +>> that multi-format comments are a killer feature, though - part of the point +>> of this plugin, in my mind, is that it's less flexible than the full power +>> of ikiwiki and gives users fewer options. This could be construed +>> to be a feature, for people who don't care how flexible the technology is +>> and just want a simple way to leave a comment. The FormattingHelp page +>> assumes you're writing 100% Markdown in any case... +>> +>> Internal pages do too many things, perhaps: they suppress generation of +>> HTML pages, they disable editing over the web, and they have a different +>> namespace of htmlize hooks. I think the first two of those are useful +>> for this plugin, and the last is harmless; you seem to think the first +>> is useful, and the other two are harmful. --[[smcv]] >> By the way, I think that who can post comments should be controllable by >> the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing @@ -41,6 +65,29 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> spam problems. So, use `check_canedit` as at least a first-level check? >> --[[Joey]] +>> This plugin already uses `check_canedit`, but that function doesn't have a concept +>> of different actions. The hack I use is that when a user comments on, say, sandbox, +>> I call `check_canedit` for the pseudo-page "sandbox[postcomment]". The +>> special `postcomment(glob)` [[ikiwiki/pagespec]] returns true if the page ends with +>> "[postcomment]" and the part before (e.g. sandbox) matches the glob. So, you can +>> have postcomment(blog/*) or something. (Perhaps instead of taking a glob, postcomment +>> should take a pagespec, so you can have postcomment(link(tags/commentable))?) +>> +>> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'` +>> are necessary to allow anonymous and logged-in editing (respectively). +>> +>> This is ugly - one alternative would be to add `check_permission()` that takes a +>> page and a verb (create, edit, rename, remove and maybe comment are the ones I +>> can think of so far), use that, and port the plugins you mentioned to use that +>> API too. This plugin could either call `check_can("$page/comment1", 'create')` or +>> call `check_can($page, 'comment')`. +>> +>> One odd effect of the code structure I've used is that we check for the ability to +>> create the page before we actually know what page name we're going to use - when +>> posting the comment I just increment a number until I reach an unused one - so +>> either the code needs restructuring, or the permission check for 'create' would +>> always be for 'comment1' and never 'comment123'. --[[smcv]] + When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing down the wiki by causing time-consuming processing. As long as the recommended plugins @@ -58,7 +105,10 @@ are enabled, comment authorship should hopefully be unforgeable by CGI users. >> anything else, at this point. >> >> I've rebased the plugin on master, made it sanitize individual posts' content ->> and removed the option to disallow raw HTML. --[[smcv]] +>> and removed the option to disallow raw HTML. Sanitizing individual posts before +>> they've been htmlized required me to preserve whitespace in the htmlbalance +>> plugin, so I did that. Alternatively, we could htmlize immediately and always +>> save out raw HTML? --[[smcv]] >> There might be some use cases for other directives, such as img, in >> comments. @@ -94,7 +144,20 @@ the comments. >> rather annoying while this plugin is on a branch). --[[smcv]] >>> Using the template would allow customising the html around the comments ->>> which seems like a good thing? +>>> which seems like a good thing? --[[Joey]] + +>>> The \[[!comments]] directive is already template-friendly - it expands to +>>> the contents of the template `comments_embed.tmpl`, possibly with the +>>> result of an \[[!inline]] appended. I should change `comments_embed.tmpl` +>>> so it uses a template variable `INLINE` for the inline result rather than +>>> having the perl code concatenate it, which would allow a bit more +>>> customization (whether the "post" link was before or after the inline). +>>> Even if you want comments in page.tmpl, keeping the separate comments_embed.tmpl +>>> and having a `COMMENTS` variable in page.tmpl might be the way forward, +>>> since the smaller each templates is, the easier it will be for users +>>> to maintain a patched set of templates. (I think so, anyway, based on what happens +>>> with dpkg prompts in Debian packages with monolithic vs split +>>> conffiles.) --[[smcv]] The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from @@ -121,6 +184,8 @@ Optional parameters to the comments directive: * `closed=yes`: use this to prevent new comments while still displaying existing ones. * `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] +>> I don't think feedonly actually makes sense here, so I'll remove it. --[[smcv]] + This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the `postcomment` branch). A demo wiki with the plugin enabled is running at -- cgit v1.2.3 From 4dc7143b5a020dcc881ea595ac678d3e845b5b9a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 19 Nov 2008 05:39:23 -0500 Subject: wishlist from IRC --- doc/plugins/contrib/comments.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 89566d051..75a329b51 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -204,3 +204,12 @@ Known issues: > I haven't done a detailed code review, but I will say I'm pleased you > avoided re-implementing inline! --[[Joey]] + +Wishlist: + +* tbm would like anonymous people to be able to enter their name and possibly email + address +* smcv would like an indication of who you're posting as / the ability to log in + as someone else (even if anonymous comments are allowed, it'd be nice to be + able to choose to log in with a username or OpenID, like in Livejournal); + perhaps editpage needs this too -- cgit v1.2.3 From d169fcbde8a0334aa6f6f647c1149bf717203cf7 Mon Sep 17 00:00:00 2001 From: essaywriter Date: Wed, 19 Nov 2008 05:44:09 -0500 Subject: --- doc/TourBusStop.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/TourBusStop.mdwn b/doc/TourBusStop.mdwn index 8e382bd77..b634079a8 100644 --- a/doc/TourBusStop.mdwn +++ b/doc/TourBusStop.mdwn @@ -28,3 +28,6 @@ Famous sights to visit here at **ikiwiki** * [[ikiwikiusers]]: The list of projects, personal sites, and blogs that use ikiwiki. * [[plugins]]: See the many ways people have extended ikiwiki. * [[examples]]: Example sites built using ikiwiki. + +Other Websites: +*Language Translation -- cgit v1.2.3 From e60b4e3eba0b2b4f2c5bf4d092fc59f6c80b142d Mon Sep 17 00:00:00 2001 From: essaywriter Date: Wed, 19 Nov 2008 05:57:56 -0500 Subject: --- doc/TourBusStop.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/TourBusStop.mdwn b/doc/TourBusStop.mdwn index b634079a8..7979ad6ed 100644 --- a/doc/TourBusStop.mdwn +++ b/doc/TourBusStop.mdwn @@ -29,5 +29,11 @@ Famous sights to visit here at **ikiwiki** * [[plugins]]: See the many ways people have extended ikiwiki. * [[examples]]: Example sites built using ikiwiki. -Other Websites: + +========================================== +Ikiwiki TourBus Stop Educational Links: + +*Harvard Business School +*University of Virginia +*Stanford University *Language Translation -- cgit v1.2.3 From 903b7ff5ae020dfd240156957100a2cd3b4c3806 Mon Sep 17 00:00:00 2001 From: essaywriter Date: Wed, 19 Nov 2008 06:00:34 -0500 Subject: --- doc/TourBusStop.mdwn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/TourBusStop.mdwn b/doc/TourBusStop.mdwn index 7979ad6ed..4cb75f78f 100644 --- a/doc/TourBusStop.mdwn +++ b/doc/TourBusStop.mdwn @@ -30,10 +30,10 @@ Famous sights to visit here at **ikiwiki** * [[examples]]: Example sites built using ikiwiki. -========================================== -Ikiwiki TourBus Stop Educational Links: - -*Harvard Business School -*University of Virginia -*Stanford University -*Language Translation +

Ikiwiki TourBus Stop Educational Links:

+ -- cgit v1.2.3 From a493752a4d90f3ff72d30f6b0527c806d9f8ae72 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Nov 2008 17:30:21 -0500 Subject: French translation update from Philippe Batailler. Closes: #506250 --- debian/changelog | 1 + po/fr.po | 116 ++++++++++++++++++++++++------------------------------- 2 files changed, 51 insertions(+), 66 deletions(-) diff --git a/debian/changelog b/debian/changelog index eeb9fe6ce..2256c24fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low this time). * Improve escaping of wikilinks and preprocessor directives in content produced by aggregate and recentchanges. + * French translation update from Philippe Batailler. Closes: #506250 -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/po/fr.po b/po/fr.po index 53095c5e1..b8e84f930 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,16 +7,15 @@ # Cyril Brulebois , 2007. msgid "" msgstr "" -"Project-Id-Version: \n" +"Project-Id-Version: ikiwiki 2.70 \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-10-31 16:37-0400\n" -"PO-Revision-Date: 2008-10-11 10:34+0200\n" -"Last-Translator: Julien Patriarca \n" +"PO-Revision-Date: 2008-11-19 21:53+0100\n" +"Last-Translator: Philippe Batailler \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" #: ../IkiWiki/CGI.pm:113 msgid "You need to log in first." @@ -24,8 +23,7 @@ msgstr "Vous devez d'abord vous identifier." #: ../IkiWiki/CGI.pm:145 msgid "login failed, perhaps you need to turn on cookies?" -msgstr "" -"Échec de l'identification, vous devriez peut-être autoriser les cookies." +msgstr "Échec de l'identification, vous devez autoriser les cookies." #: ../IkiWiki/CGI.pm:163 ../IkiWiki/Plugin/editpage.pm:350 msgid "Your login session has expired." @@ -57,11 +55,11 @@ msgstr "Erreur" #: ../IkiWiki/Plugin/aggregate.pm:80 msgid "Aggregation triggered via web." -msgstr "Agrégation déclenchée via Internet" +msgstr "Agrégation déclenchée par le web" #: ../IkiWiki/Plugin/aggregate.pm:89 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "Rien à faire pour le moment, tous les flux sont à jour!" +msgstr "Rien à faire pour le moment, tous les flux sont à jour !" #: ../IkiWiki/Plugin/aggregate.pm:216 #, perl-format @@ -93,7 +91,7 @@ msgstr "Fin de validité de %s" #: ../IkiWiki/Plugin/aggregate.pm:463 #, perl-format msgid "last checked %s" -msgstr "" +msgstr "dernière vérification : %s" #: ../IkiWiki/Plugin/aggregate.pm:467 #, perl-format @@ -129,9 +127,8 @@ msgid "creating new page %s" msgstr "Création de la nouvelle page %s" #: ../IkiWiki/Plugin/amazon_s3.pm:31 -#, fuzzy msgid "deleting bucket.." -msgstr "suppression du compartiment (« bucket »)..." +msgstr "suppression du compartiment S3 (« bucket »)..." #: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206 msgid "done" @@ -143,17 +140,14 @@ msgid "Must specify %s" msgstr "Vous devez spécifier %s" #: ../IkiWiki/Plugin/amazon_s3.pm:136 -#, fuzzy msgid "Failed to create bucket in S3: " -msgstr "Échec lors de la création du compartiment sur S3 :" +msgstr "Impossible de créer un compartiment S3 :" #: ../IkiWiki/Plugin/amazon_s3.pm:221 -#, fuzzy msgid "Failed to save file to S3: " -msgstr "Échec lors de la création du fichier sur S3 :" +msgstr "Impossible de sauvegarder le fichier dans le compartiment S3 :" #: ../IkiWiki/Plugin/amazon_s3.pm:243 -#, fuzzy msgid "Failed to delete file from S3: " msgstr "Échec lors de la suppression du fichier sur S3 :" @@ -163,13 +157,12 @@ msgid "there is already a page named %s" msgstr "il existe déjà une page nommée %s" #: ../IkiWiki/Plugin/attachment.pm:82 -#, fuzzy msgid "prohibited by allowed_attachments" msgstr "action interdite par allowed_attachments" #: ../IkiWiki/Plugin/attachment.pm:190 msgid "bad attachment filename" -msgstr "Mauvais nom de la pièce jointe" +msgstr "Nom de la pièce jointe incorrect" #: ../IkiWiki/Plugin/attachment.pm:232 msgid "attachment upload" @@ -212,14 +205,13 @@ msgid "no text was copied in this page with id %s" msgstr "Aucun texte n'a été copié dans cette page avec l'identifiant %s" #: ../IkiWiki/Plugin/editpage.pm:40 -#, fuzzy, perl-format +#, perl-format msgid "removing old preview %s" msgstr "Suppression de l'ancienne prévisualisation %s" #: ../IkiWiki/Plugin/editpage.pm:125 -#, fuzzy msgid "bad page name" -msgstr "Mauvais nom de la pièce jointe" +msgstr "nom de page incorrect" #: ../IkiWiki/Plugin/editpage.pm:141 #, perl-format @@ -257,12 +249,12 @@ msgstr "Échec du traitement" #: ../IkiWiki/Plugin/format.pm:22 msgid "must specify format and text" -msgstr "" +msgstr "le format et le texte doivent être indiqués" #: ../IkiWiki/Plugin/format.pm:25 -#, fuzzy, perl-format +#, perl-format msgid "unsupported page format %s" -msgstr "Système de contrôle de version non reconnu" +msgstr "format de page non reconnu %s" #: ../IkiWiki/Plugin/fortune.pm:27 msgid "fortune failed" @@ -270,32 +262,31 @@ msgstr "Échec du lancement de « fortune »" #: ../IkiWiki/Plugin/git.pm:618 ../IkiWiki/Plugin/git.pm:636 #: ../IkiWiki/Receive.pm:129 -#, fuzzy, perl-format +#, perl-format msgid "you are not allowed to change %s" -msgstr "vous n'êtes pas authentifié comme administrateur" +msgstr "vous n'êtes pas autorisé à modifier %s" #: ../IkiWiki/Plugin/git.pm:658 #, perl-format msgid "you cannot act on a file with mode %s" -msgstr "" +msgstr "Vous ne pouvez utiliser le mode %s pour les fichiers" #: ../IkiWiki/Plugin/git.pm:662 -#, fuzzy msgid "you are not allowed to change file modes" -msgstr "vous n'êtes pas authentifié comme administrateur" +msgstr "vous n'êtes pas autorisé à modifier le mode des fichiers" #: ../IkiWiki/Plugin/google.pm:27 -#, fuzzy, perl-format +#, perl-format msgid "Must specify %s when using the google search plugin" -msgstr "Vous devez indiquer %s lors de l'utilisation du greffon « search »." +msgstr "Vous devez indiquer %s lors de l'utilisation du greffon « google »." #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" -msgstr "" +msgstr "Impossible d'analyser l'url, pas de nom de domaine" #: ../IkiWiki/Plugin/googlecalendar.pm:32 msgid "failed to find url in html" -msgstr "Échec dans la recherche d'une URL dans le Code HTML" +msgstr "Impossible de trouver une URL dans le code HTML" #: ../IkiWiki/Plugin/graphviz.pm:67 msgid "failed to run graphviz" @@ -337,12 +328,10 @@ msgstr "" "ou --atom" #: ../IkiWiki/Plugin/inline.pm:139 -#, fuzzy msgid "page editing not allowed" msgstr "Modification de page interdite" #: ../IkiWiki/Plugin/inline.pm:156 -#, fuzzy msgid "missing pages parameter" msgstr "paramètre « pages » manquant" @@ -358,7 +347,7 @@ msgstr "Ajouter un nouvel article dont le titre est :" #: ../IkiWiki/Plugin/inline.pm:301 #, perl-format msgid "nonexistant template %s" -msgstr "Le modèle (« template ») %s n'existe pas" +msgstr "Le modèle de page %s n'existe pas" #: ../IkiWiki/Plugin/inline.pm:335 ../IkiWiki/Render.pm:83 msgid "Discussion" @@ -430,7 +419,7 @@ msgstr "Toutes les pages sont liées à d'autres pages." #: ../IkiWiki/Plugin/pagetemplate.pm:30 msgid "bad or missing template" -msgstr "Modèle incorrect ou manquant" +msgstr "Modèle de page incorrect ou manquant" #: ../IkiWiki/Plugin/passwordauth.pm:247 msgid "Account creation successful. Now you can Login." @@ -448,7 +437,7 @@ msgstr "" #: ../IkiWiki/Plugin/passwordauth.pm:291 msgid "Failed to send mail" -msgstr "Échec de l'envoi du courriel" +msgstr "Impossible d'envoyer un courriel" #: ../IkiWiki/Plugin/passwordauth.pm:293 msgid "You have been mailed password reset instructions." @@ -480,7 +469,7 @@ msgstr "va envoyer un ping à %s" #: ../IkiWiki/Plugin/pinger.pm:61 #, perl-format msgid "Ignoring ping directive for wiki %s (this wiki is %s)" -msgstr "les instructions du wiki %s sont ignorées (ce wiki est %s)" +msgstr "Les instructions du wiki %s sont ignorées (ce wiki est %s)" #: ../IkiWiki/Plugin/pinger.pm:77 msgid "LWP not found, not pinging" @@ -500,7 +489,7 @@ msgstr "polygen n'est pas installé" #: ../IkiWiki/Plugin/polygen.pm:60 msgid "command failed" -msgstr "Échec lors du lancement de la commande" +msgstr "Échec de la commande" #: ../IkiWiki/Plugin/postsparkline.pm:41 msgid "missing formula" @@ -548,15 +537,15 @@ msgstr "%A après-midi" #: ../IkiWiki/Plugin/prettydate.pm:32 msgid "late %A afternoon" -msgstr "tard l'après-midi de %A" +msgstr "tard dans l'après-midi de %A" #: ../IkiWiki/Plugin/prettydate.pm:33 msgid "%A evening" -msgstr "%A soir" +msgstr "%A en soirée" #: ../IkiWiki/Plugin/prettydate.pm:35 msgid "late %A evening" -msgstr "tard %A soir" +msgstr "tard %A en soirée" #: ../IkiWiki/Plugin/prettydate.pm:37 msgid "%A night" @@ -575,12 +564,11 @@ msgid "at noon on %A" msgstr "%A, à midi" #: ../IkiWiki/Plugin/progress.pm:34 -#, fuzzy, perl-format +#, perl-format msgid "illegal percent value %s" msgstr "pourcentage %s illégal" #: ../IkiWiki/Plugin/progress.pm:59 -#, fuzzy msgid "need either `percent` or `totalpages` and `donepages` parameters" msgstr "" "L'un des paramètres « percent », « totalpages » ou « donepages » est nécessaire." @@ -638,7 +626,7 @@ msgstr "Aucun changement dans le nom du fichier n'a été spécifié" #: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" -msgstr "appellation non autorisé" +msgstr "appellation non autorisée" #: ../IkiWiki/Plugin/rename.pm:73 #, perl-format @@ -656,13 +644,12 @@ msgid "rename %s" msgstr "%s renommé" #: ../IkiWiki/Plugin/rename.pm:138 -#, fuzzy msgid "Also rename SubPages and attachments" msgstr "« SubPages » et attachements renommés." #: ../IkiWiki/Plugin/rename.pm:224 msgid "Only one attachment can be renamed at a time." -msgstr "Seule une pièce jointe peut être renommée à la fois" +msgstr "Une seule pièce jointe peut être renommée à la fois" #: ../IkiWiki/Plugin/rename.pm:227 msgid "Please select the attachment to rename." @@ -676,7 +663,7 @@ msgstr "renomme %s en %s" #: ../IkiWiki/Plugin/rename.pm:490 #, perl-format msgid "update for rename of %s to %s" -msgstr "du nouveau nom de %s en %s" +msgstr "mise à jour, suite au changement de %s en %s" #: ../IkiWiki/Plugin/search.pm:36 #, perl-format @@ -754,7 +741,7 @@ msgstr "Format de données inconnu" #: ../IkiWiki/Plugin/table.pm:81 msgid "empty data" -msgstr "Données vides" +msgstr "Pas de données" #: ../IkiWiki/Plugin/table.pm:100 msgid "Direct data download" @@ -772,7 +759,7 @@ msgstr "Paramètre d'identification manquant" #: ../IkiWiki/Plugin/template.pm:35 #, perl-format msgid "template %s not found" -msgstr "Modèle (« template ») %s introuvable " +msgstr "Modèle de page %s introuvable" #: ../IkiWiki/Plugin/template.pm:54 msgid "failed to process:" @@ -797,7 +784,7 @@ msgstr "greffon" #: ../IkiWiki/Plugin/websetup.pm:108 #, perl-format msgid "enable %s?" -msgstr "activer %s?" +msgstr "activer %s ?" #: ../IkiWiki/Plugin/websetup.pm:236 msgid "you are not logged in as an admin" @@ -813,7 +800,7 @@ msgstr "Partie principale" #: ../IkiWiki/Plugin/websetup.pm:257 msgid "plugins" -msgstr "greffons" +msgstr "Greffons" #: ../IkiWiki/Plugin/websetup.pm:395 msgid "" @@ -833,17 +820,17 @@ msgstr "" #: ../IkiWiki/Plugin/websetup.pm:433 #, perl-format msgid "

Error: %s exited nonzero (%s)" -msgstr "

Erreur: %s a quitté nonzero (%s)" +msgstr "

Erreur : %s s'est terminé, valeur de sortie nonzero (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format msgid "cannot determine id of untrusted committer %s" -msgstr "" +msgstr "Impossible de déterminer l'identifiant de %s, (enregistrement non fiable)" #: ../IkiWiki/Receive.pm:85 -#, fuzzy, perl-format +#, perl-format msgid "bad file name %s" -msgstr "Omission du fichier au nom incorrect %s" +msgstr "nom de fichier incorrect %s" #: ../IkiWiki/Render.pm:253 #, perl-format @@ -860,7 +847,7 @@ msgid "skipping bad filename %s" msgstr "Omission du fichier au nom incorrect %s" #: ../IkiWiki/Render.pm:284 -#, fuzzy, perl-format +#, perl-format msgid "%s has multiple possible source pages" msgstr "%s peut être associé à plusieurs pages source." @@ -895,9 +882,9 @@ msgid "rendering %s, to update its backlinks" msgstr "Reconstruction de %s, afin de mettre à jour ses rétroliens" #: ../IkiWiki/Render.pm:498 -#, fuzzy, perl-format +#, perl-format msgid "removing %s, no longer rendered by %s" -msgstr "Suppression de %s, qui n'est plus affiché par %s" +msgstr "Suppression de %s, qui n'est plus rendu par %s" #: ../IkiWiki/Render.pm:522 #, perl-format @@ -920,7 +907,7 @@ msgstr "" #: ../IkiWiki/Setup/Automator.pm:67 #, perl-format msgid "unsupported revision control system %s" -msgstr "Système de contrôle de version non reconnu" +msgstr "Système de contrôle de version non reconnu : %s" #: ../IkiWiki/Setup/Automator.pm:83 msgid "failed to set up the repository with ikiwiki-makerepo" @@ -964,7 +951,6 @@ msgid "usage: ikiwiki [options] source dest" msgstr "Syntaxe : ikiwiki [options] source destination" #: ../ikiwiki.in:14 -#, fuzzy msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup fichier de configuration" @@ -986,16 +972,14 @@ msgstr "Rafraîchissement du wiki..." #: ../IkiWiki.pm:466 msgid "Must specify url to wiki with --url when using --cgi" -msgstr "" -"Vous devez indiquer une URL vers le wiki par --url lors de l'utilisation de " -"--cgi" +msgstr "Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi" #: ../IkiWiki.pm:512 msgid "cannot use multiple rcs plugins" msgstr "impossible d'utiliser plusieurs systèmes de contrôle des versions" #: ../IkiWiki.pm:541 -#, fuzzy, perl-format +#, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Impossible de charger le greffon externe nécessaire au greffon %s : %s" -- cgit v1.2.3 From a10533fe7cd72e1c5a3f030c09cef4412b2e83f0 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Wed, 19 Nov 2008 22:52:36 -0500 Subject: does change to ikiwiki.cgi locking help? --- doc/plugins/contrib/unixauth/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/contrib/unixauth/discussion.mdwn b/doc/plugins/contrib/unixauth/discussion.mdwn index dfa4fe6cc..46f86d351 100644 --- a/doc/plugins/contrib/unixauth/discussion.mdwn +++ b/doc/plugins/contrib/unixauth/discussion.mdwn @@ -32,3 +32,5 @@ I've added support for [checkpassword](http://cr.yp.to/checkpwd/interface.html), > to disentangle the two locks. --[[Joey]] >> Ah, ok, I misunderstood your comment. I'll see what I can figure out. --[[schmonz]] + +>>> My time's been limited for this, but I just saw [[todo/avoid_thrashing]]. How does that interact with pwauth or checkpassword? --[[schmonz]] -- cgit v1.2.3 From 34093ff3105428ab3c3ad8ccccb126366a46db3f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Nov 2008 12:41:26 -0500 Subject: essaywriter: nice try, but your spam was recognised and removed --- doc/TourBusStop.mdwn | 9 --------- 1 file changed, 9 deletions(-) diff --git a/doc/TourBusStop.mdwn b/doc/TourBusStop.mdwn index 4cb75f78f..8e382bd77 100644 --- a/doc/TourBusStop.mdwn +++ b/doc/TourBusStop.mdwn @@ -28,12 +28,3 @@ Famous sights to visit here at **ikiwiki** * [[ikiwikiusers]]: The list of projects, personal sites, and blogs that use ikiwiki. * [[plugins]]: See the many ways people have extended ikiwiki. * [[examples]]: Example sites built using ikiwiki. - - -

Ikiwiki TourBus Stop Educational Links:

- -- cgit v1.2.3 From fb4534ddf8727609b05b312bb4f62d180c71b344 Mon Sep 17 00:00:00 2001 From: "http://joey.kitenet.net/" Date: Thu, 20 Nov 2008 12:42:08 -0500 Subject: test commit --- doc/sandbox.mdwn | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 722e40851..001a838e9 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -78,10 +78,6 @@ The haiku will change after every save, mind you. * [[foo]] * WikiLink -Test - -Ḷét̨'s̀ şė͜e... - ----- This SandBox is also a [[blog]]! -- cgit v1.2.3 From 17659599f3ea76c3c2e88de625e40265a20a93d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Nov 2008 12:44:23 -0500 Subject: response --- doc/plugins/contrib/unixauth/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/contrib/unixauth/discussion.mdwn b/doc/plugins/contrib/unixauth/discussion.mdwn index 46f86d351..232649863 100644 --- a/doc/plugins/contrib/unixauth/discussion.mdwn +++ b/doc/plugins/contrib/unixauth/discussion.mdwn @@ -34,3 +34,5 @@ I've added support for [checkpassword](http://cr.yp.to/checkpwd/interface.html), >> Ah, ok, I misunderstood your comment. I'll see what I can figure out. --[[schmonz]] >>> My time's been limited for this, but I just saw [[todo/avoid_thrashing]]. How does that interact with pwauth or checkpassword? --[[schmonz]] + +>>>> The DOS still happens, it just uses less memory. --[[Joey]] -- cgit v1.2.3 From dca6c835fe2e97331751e1cdedf1dbf0009309ef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Nov 2008 12:55:57 -0500 Subject: avoid adding ./ to urls unnecessarily This avoids constructing urls like "./../foo/". The leading "../" avoids any colon confusion already. I noticed in my logs that certain badly written web spiders (hello again, Yahoo!) fail to follow urls like ikiwiki was constructing to the right place (instead ending up at "./foo/") --- IkiWiki.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 735dc97b1..17e2a2a85 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -942,9 +942,9 @@ sub beautify_urlpath ($) { #{{{ $url =~ s!/index.$config{htmlext}$!/!; } - # Ensure url is not an empty link, and - # if it's relative, make that explicit to avoid colon confusion. - if ($url !~ /^\//) { + # Ensure url is not an empty link, and if necessary, + # add ./ to avoid colon confusion. + if ($url !~ /^\// && $url !~ /^\.\.\//) { $url="./$url"; } -- cgit v1.2.3 From 3cd0660a44f072c42a7442351c484037aa7f5f0f Mon Sep 17 00:00:00 2001 From: "http://www.iredale.net/b/" Date: Thu, 20 Nov 2008 18:08:06 -0500 Subject: --- doc/users/ajt.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/users/ajt.mdwn diff --git a/doc/users/ajt.mdwn b/doc/users/ajt.mdwn new file mode 100644 index 000000000..5d8120ed6 --- /dev/null +++ b/doc/users/ajt.mdwn @@ -0,0 +1,20 @@ +[[!meta title="Adam Trickett"]] + +# Adam Trickett + +## ajt + +I'm a long time hacker of sorts, I like to program in Perl on Debian systems but work pays me to program in ABAP (COBOL) on SAP. + +I like wikis and I'm currently in love with ikiwiki, having moved my home intranet from a home made template solution to ikiwiki over a weekend. I'm using ikiwiki more like a web content management system (e.g. RedDot) rather than a traditional wiki. + +### My Links + +* [iredale dot net](http://www.iredale.net/) my web server and main blog +* [ajt](http://www.perlmonks.org/index.pl?node_id=113686) my Perkmonks home node +* [ajt](http://use.perl.org/~ajt) my use Perl home +* [ATRICKETT](http://search.cpan.org/~atrickett/) my CPAN folder +* [ajt](http://www.debian-administration.org/users/ajt) my Debian-Administration home (good site btw) +* [drajt](http://www.linkedin.com/in/drajt) my LinkedIn profile +* [drajt](http://www.slideshare.net/drajt) my "Slidespace" on SlideShare +* [AdamTrickett](http://www.hants.lug.org.uk/cgi-bin/wiki.pl?AdamTrickett) my wiki page on my LUG's site -- cgit v1.2.3 From 5c377f477d2cb9c06248e40c01ebe0bdc13ab8b5 Mon Sep 17 00:00:00 2001 From: "http://www.iredale.net/b/" Date: Thu, 20 Nov 2008 18:14:35 -0500 Subject: --- doc/ikiwikiusers.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index ac46fcc7f..7d8e41826 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -104,7 +104,7 @@ Personal sites and blogs * [[JonDowland]]'s [homepage](http://jmtd.net/) * [[xma]] is using ikiwiki () * [[JanWalzer|jwalzer]]'s [homepage](http://wa.lzer.net/) -- Work in Progress -* [Adam Trickett's home intranet and sanbox system](http://www.iredale.net) -- no wiki component visible yet +* [[Adam_Trickett|ajt]]'s home intranet/sanbox system ([Internet site & blog](http://www.iredale.net/) -- not ikiwiki yet) Please feel free to add your own ikiwiki site! -- cgit v1.2.3 From 7d11e73f5737852d0fc9712741a6ef6561e5709e Mon Sep 17 00:00:00 2001 From: "http://www.iredale.net/b/" Date: Thu, 20 Nov 2008 18:17:34 -0500 Subject: --- doc/users/ajt.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/ajt.mdwn b/doc/users/ajt.mdwn index 5d8120ed6..bc47040b6 100644 --- a/doc/users/ajt.mdwn +++ b/doc/users/ajt.mdwn @@ -2,7 +2,7 @@ # Adam Trickett -## ajt +## "ajt" I'm a long time hacker of sorts, I like to program in Perl on Debian systems but work pays me to program in ABAP (COBOL) on SAP. -- cgit v1.2.3 From 37648a4c098b848294115128315600a57b8a834a Mon Sep 17 00:00:00 2001 From: "https://brian.may.myopenid.com//" Date: Sat, 22 Nov 2008 03:54:48 -0500 Subject: links broken in CSV files --- doc/bugs/links_misparsed_in_CSV_files.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/bugs/links_misparsed_in_CSV_files.mdwn diff --git a/doc/bugs/links_misparsed_in_CSV_files.mdwn b/doc/bugs/links_misparsed_in_CSV_files.mdwn new file mode 100644 index 000000000..e356e2229 --- /dev/null +++ b/doc/bugs/links_misparsed_in_CSV_files.mdwn @@ -0,0 +1,7 @@ +If a link inside a CSV file contains two or more underscores (\_), then it will get mis-parsed by the table plugin. + +e.g. \[[single\_track\_lines]] becomes "em>lines". + +Links with only one underscore are OK. + +-- Brian May -- cgit v1.2.3 From 61415acfb84480d4fe4f0952b559deabe12883c6 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sat, 22 Nov 2008 13:38:02 -0500 Subject: Unbalanced

appears in some situations, particularly with htmltidy --- doc/bugs/stray___60____47__p__62___tags.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/bugs/stray___60____47__p__62___tags.mdwn diff --git a/doc/bugs/stray___60____47__p__62___tags.mdwn b/doc/bugs/stray___60____47__p__62___tags.mdwn new file mode 100644 index 000000000..6e508ffda --- /dev/null +++ b/doc/bugs/stray___60____47__p__62___tags.mdwn @@ -0,0 +1,15 @@ +When using the [[plugins/htmltidy]] plugin (and possibly in other circumstances), ikiwiki sometimes creates more `

` tags than `

` tags, causing unbalanced markup. I've previously noticed unbalanced tags when a `\[[!map]]` matches no pages. This is part of the reason I developed [[plugins/htmlbalance]]. + +This is particularly noticeable if htmltidy is enabled when building the docwiki: on the 'contrib' plugin pages, the title becomes `foo

(third-party plugin)` (with the angle-brackets escaped - it seems the text gets sanitized but is then escaped anyway). + +I believe that this snippet in `IkiWiki.pm` might be the reason for the imbalance: + + if ($oneline) { + # hack to get rid of enclosing junk added by markdown + # and other htmlizers + $content=~s/^

//i; + $content=~s/<\/p>$//i; + chomp $content; + } + +The fact that HTML in a `\[[!meta title]]` is added but then escaped might indicate that some other bug is involved. -- cgit v1.2.3 From bf808c2f52d3572583d489de8ae6409b879fe685 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 23 Nov 2008 13:53:18 -0500 Subject: --- doc/plugins/contrib/comments.mdwn | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 75a329b51..1a6e7f465 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -38,6 +38,8 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> hard-code the name of the page to look at. Perhaps I could add >> discussionpage => 'discussion' too? --[[smcv]] +>> (I've now implemented this in my branch. --[[smcv]]) + >> The best reason to keep the pages internal seems to me to be that you >> don't want the overhead of every comment spawning its own wiki page. >> The worst problem with it though is that you have to assume the pages @@ -88,6 +90,11 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >> either the code needs restructuring, or the permission check for 'create' would >> always be for 'comment1' and never 'comment123'. --[[smcv]] +>> Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`. +>> However, this makes the "comments can only be created, not edited" feature completely +>> reliant on the fact that internal pages can't be edited. Perhaps there should be a +>> `editable_pages` pagespec, defaulting to `'*'`? + When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing down the wiki by causing time-consuming processing. As long as the recommended plugins @@ -123,7 +130,7 @@ are enabled, comment authorship should hopefully be unforgeable by CGI users. When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!comments]]` directive in them. By default, this directive expands to a "post a comment" link plus an `\[[!inline]]` with -the comments. +the comments. [This requirement has now been removed --[[smcv]]] > I don't like this, because it's hard to explain to someone why they have > to insert this into every post to their blog. Seems that the model used @@ -137,6 +144,9 @@ the comments. >> as allowing comments. >> >>> Yes, I think a pagespec is the way to go. --[[Joey]] + +>>> Implemented --[[smcv]] + >> >> The model used for discussion pages does require patching the existing >> page template, which I was trying to avoid - I'm not convinced that having @@ -159,6 +169,8 @@ the comments. >>> with dpkg prompts in Debian packages with monolithic vs split >>> conffiles.) --[[smcv]] +>>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]] + The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: @@ -174,17 +186,18 @@ to allow anonymous comments (the IP address will be used as the "author"). > This is still called postcomment, although I've renamed the rest of the plugin > to comments as suggested on #ikiwiki --[[smcv]] -Optional parameters to the comments directive: - -* `commit=no`: by default, comments are committed to version control. Use this to - disable commits. -* `allowdirectives=yes`: by default, IkiWiki directives are filtered out. Use this - to allow directives (avoid enabling any [[plugins/type/slow]] directives if you - do this). -* `closed=yes`: use this to prevent new comments while still displaying existing ones. -* `atom`, `rss`, `feeds`, `feedshow`, `timeformat`, `feedonly`: the same as for [[plugins/inline]] +There are some global options for the setup file: ->> I don't think feedonly actually makes sense here, so I'll remove it. --[[smcv]] +* comments_shown_pagespec: pages where comments will be displayed inline, e.g. `blog/*` + or `*/discussion`. +* comments_open_pagespec: pages where new comments can be posted, e.g. + `blog/* and created_after(close_old_comments)` or `*/discussion` +* comments_pagename: if this is e.g. `comment_` (the default), then comments on the + [[sandbox]] will be called something like `sandbox/comment_12` +* comments_allowdirectives: if true (default false), comments may contain IkiWiki + directives +* comments_commit: if true (default true), comments will be committed to the version + control system This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the @@ -197,10 +210,6 @@ Known issues: * The access control via postcomment() is rather strange * There is some common code cargo-culted from other plugins (notably inline and editpage) which should probably be shared -* If the comments directive is removed from a page, comments can still be made on that page, - and will be committed but not displayed; to disable comments properly you have to set the - closed="yes" directive parameter (and refresh the wiki), *then* remove the directive if - desired > I haven't done a detailed code review, but I will say I'm pleased you > avoided re-implementing inline! --[[Joey]] -- cgit v1.2.3 From a8090bfff8efba0f04b0ef547b052d2a13a19083 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 23 Nov 2008 13:56:51 -0500 Subject: generalization of recentchanges_link --- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn diff --git a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn new file mode 100644 index 000000000..ba484c877 --- /dev/null +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -0,0 +1,9 @@ +The [[plugins/recentchanges]] plugin has a `do=recentchanges_link` feature that will +redirect to a given wiki page, or an error page with a creation link. + +In the [[plugins/contrib/comments]] plugin I've found that it would be useful to do +the same for users. For now I've just cloned the functionality into the comments +plugin, but perhaps this functionality could be renamed to `do=goto` or +something, and moved to `IkiWiki/CGI.pm`? + +If there's general approval I'm happy to write a patch. -- cgit v1.2.3 From 8adc460bb12fb2040197ce1de6e885f74a389b84 Mon Sep 17 00:00:00 2001 From: "https://brian.may.myopenid.com//" Date: Sun, 23 Nov 2008 19:51:20 -0500 Subject: Update to CSV link issue --- doc/bugs/links_misparsed_in_CSV_files.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/bugs/links_misparsed_in_CSV_files.mdwn b/doc/bugs/links_misparsed_in_CSV_files.mdwn index e356e2229..54f099935 100644 --- a/doc/bugs/links_misparsed_in_CSV_files.mdwn +++ b/doc/bugs/links_misparsed_in_CSV_files.mdwn @@ -4,4 +4,6 @@ e.g. \[[single\_track\_lines]] becomes "em>lines". Links with only one underscore are OK. +Update 2008-11-24: The problem only occurs if the CSV data is in an external file. If I load it using data="""...""" then it works fine. + -- Brian May -- cgit v1.2.3 From c807d043aac28502e14becf3b126793d7a5ee20d Mon Sep 17 00:00:00 2001 From: "https://brian.may.myopenid.com//" Date: Sun, 23 Nov 2008 22:20:54 -0500 Subject: more details --- doc/bugs/links_misparsed_in_CSV_files.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/bugs/links_misparsed_in_CSV_files.mdwn b/doc/bugs/links_misparsed_in_CSV_files.mdwn index 54f099935..8a137e81c 100644 --- a/doc/bugs/links_misparsed_in_CSV_files.mdwn +++ b/doc/bugs/links_misparsed_in_CSV_files.mdwn @@ -6,4 +6,6 @@ Links with only one underscore are OK. Update 2008-11-24: The problem only occurs if the CSV data is in an external file. If I load it using data="""...""" then it works fine. +The problem appears to be the call to htmlize inside genrow. If the data is inline, then wikilinks get expanded before they get here, and are OK. If the data is from an external file, the wikilinks aren't expanded, and htmlize will expand \[[single\_track\_lines]] into \[[single<em>track</em>lines]]. + -- Brian May -- cgit v1.2.3 From 1fe1d1de1c1a16d92793d9b6c66154c040465937 Mon Sep 17 00:00:00 2001 From: "https://brian.may.myopenid.com//" Date: Sun, 23 Nov 2008 22:34:22 -0500 Subject: more details --- doc/bugs/links_misparsed_in_CSV_files.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/bugs/links_misparsed_in_CSV_files.mdwn b/doc/bugs/links_misparsed_in_CSV_files.mdwn index 8a137e81c..169c070e7 100644 --- a/doc/bugs/links_misparsed_in_CSV_files.mdwn +++ b/doc/bugs/links_misparsed_in_CSV_files.mdwn @@ -8,4 +8,10 @@ Update 2008-11-24: The problem only occurs if the CSV data is in an external fil The problem appears to be the call to htmlize inside genrow. If the data is inline, then wikilinks get expanded before they get here, and are OK. If the data is from an external file, the wikilinks aren't expanded, and htmlize will expand \[[single\_track\_lines]] into \[[single<em>track</em>lines]]. +Oh, wait, I see the problem. IkiWiki::linkify is only called if the external file doesn't exist. If I remove this check and always call IkiWiki::linkify, then the problem is solved. + +(this is inside /usr/share/perl5/IkiWiki/Plugin/table.pm). + +I am rather confused what this check does, and the fact the comments are very different for CSV and DSV when the code is the same doesn't seem to help. + -- Brian May -- cgit v1.2.3 From 70ecf4d1ef98d985ba867864abcb4457bae1f2ad Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 24 Nov 2008 03:51:28 -0500 Subject: Indicate whose offer of a patch this is :-) --- doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn index ba484c877..1828f0a7b 100644 --- a/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn +++ b/doc/todo/generic___39__do__61__goto__39___for_CGI.mdwn @@ -6,4 +6,4 @@ the same for users. For now I've just cloned the functionality into the comments plugin, but perhaps this functionality could be renamed to `do=goto` or something, and moved to `IkiWiki/CGI.pm`? -If there's general approval I'm happy to write a patch. +If there's general approval I'm happy to write a patch. --[[smcv]] -- cgit v1.2.3 From 53af988255ed248d419029e4d5c760f6a4037c5a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 24 Nov 2008 04:04:50 -0500 Subject: Suggest ErrorDocument 404 CGI wrapper --- doc/todo/apache_404_ErrorDocument_handler.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/todo/apache_404_ErrorDocument_handler.mdwn diff --git a/doc/todo/apache_404_ErrorDocument_handler.mdwn b/doc/todo/apache_404_ErrorDocument_handler.mdwn new file mode 100644 index 000000000..b200ff3b2 --- /dev/null +++ b/doc/todo/apache_404_ErrorDocument_handler.mdwn @@ -0,0 +1,18 @@ +Apache's ErrorDocument directive lets you write a CGI script that will be invoked for all 404s. +IkiWiki could offer one as an optional wrapper; it would do much the same thing that the +existing recentchanges_link (or [[generic___39__do__61__goto__39___for_CGI]]) does when +encountering a nonexistent page. + +I think it'd probably have to be a separate CGI script because the environment with which +404 handlers are invoked is somewhat odd, and because it needs to return a 404 status +(having said that, it might make sense for `recentchanges_link` to return 404 rather than +200 anyway if the page doesn't exist). + +This would give IkiWiki the behaviour of many other wikis, where visiting a page that +does not yet exist prompts you to create it, without having to invoke the CGI for +successful requests. + +Due to [a well-known MSIE misfeature](http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807), +error output needs to be at least 512 bytes long, so some padding might also be required. + +I'm happy to write such a script if there is interest. --[[smcv]] -- cgit v1.2.3 From fbfe1e314c1a9437d9a5ffc1a8c60b6e1f9c8117 Mon Sep 17 00:00:00 2001 From: "http://yam655.livejournal.com/" Date: Tue, 25 Nov 2008 21:56:45 -0500 Subject: New page --- doc/users/StevenBlack.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/users/StevenBlack.mdwn diff --git a/doc/users/StevenBlack.mdwn b/doc/users/StevenBlack.mdwn new file mode 100644 index 000000000..ea7a6a97a --- /dev/null +++ b/doc/users/StevenBlack.mdwn @@ -0,0 +1,5 @@ +It feels like there are a lot of people named Steven Black. While I'm just one of many with my name, sometimes it is actually just me and I've forgotten that I had an account somewhere. + +I'm not a doctor, though I would certainly trust any doctor, dentist, or philosopher named Steven Black. (There are several.) + +I *am* a huge Ikiwiki fan. I've had my eye on it for many years for personal projects (though I never quite got around to installing it). Recently, however, I managed to convince my coworkers that it would be a good idea for an internal wiki. Boy was I right. The thing is practically designed to be the perfect developer-centered wiki. -- cgit v1.2.3 From c1f7b0af1ce7841a1a9baa831155e51887081be0 Mon Sep 17 00:00:00 2001 From: "http://madduck.net/" Date: Wed, 26 Nov 2008 04:16:11 -0500 Subject: proper spelling of viruses --- doc/ikiwiki/pagespec/attachment.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ikiwiki/pagespec/attachment.mdwn b/doc/ikiwiki/pagespec/attachment.mdwn index 2d33db748..344a4a734 100644 --- a/doc/ikiwiki/pagespec/attachment.mdwn +++ b/doc/ikiwiki/pagespec/attachment.mdwn @@ -9,7 +9,7 @@ configuration setting. For example, to limit arbitrary files to 50 kilobytes, but allow larger mp3 files to be uploaded by joey into a specific directory, and -check all attachments for virii, something like this could be used: +check all attachments for viruses, something like this could be used: virusfree() and ((user(joey) and podcast/*.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (!ispage() and maxsize(50kb))) -- cgit v1.2.3 From 0c666558e4b736a62914648e05e54796da25b6d4 Mon Sep 17 00:00:00 2001 From: "http://thm.id.fedoraproject.org/" Date: Wed, 26 Nov 2008 08:58:52 -0500 Subject: --- doc/bugs/dumpsetup_does_not_save_destdir.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/bugs/dumpsetup_does_not_save_destdir.mdwn diff --git a/doc/bugs/dumpsetup_does_not_save_destdir.mdwn b/doc/bugs/dumpsetup_does_not_save_destdir.mdwn new file mode 100644 index 000000000..2f62489af --- /dev/null +++ b/doc/bugs/dumpsetup_does_not_save_destdir.mdwn @@ -0,0 +1 @@ +Calling ikiwiki with a bunch of options, including the --dumpsetup somefile.setup option creates somefile.setup for later reuse with the --setup option. The destination dir however is not saved in the setup file, it has destdir => ''. -- cgit v1.2.3 From 2e3473d77dba6f6576a3c443bef17e980e51d2f1 Mon Sep 17 00:00:00 2001 From: "http://thm.id.fedoraproject.org/" Date: Wed, 26 Nov 2008 09:35:14 -0500 Subject: --- doc/todo/location_of_external_plugins.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/todo/location_of_external_plugins.mdwn diff --git a/doc/todo/location_of_external_plugins.mdwn b/doc/todo/location_of_external_plugins.mdwn new file mode 100644 index 000000000..b55bca324 --- /dev/null +++ b/doc/todo/location_of_external_plugins.mdwn @@ -0,0 +1,3 @@ +Would it be possible to make the installation location for the external plugins (those talked to via xmlrpc) configurable? Currently, they are installed into (and later expected to be in) /usr/lib/ikiwiki/plugins. For the Fedora package (which I maintain), I move them to /usr/libexec/ikiwiki/plugins. While not covered by the FHS, this seems to be a more appropriate place, see: https://fedoraproject.org/wiki/Packaging/Guidelines#Libexecdir. + +As a side note, the accompanying proxy.py might better be placed into some directory on the python path. -- cgit v1.2.3 From dc31c1100cd58dbe10c1aab10ad2291eaece554a Mon Sep 17 00:00:00 2001 From: "http://thm.id.fedoraproject.org/" Date: Wed, 26 Nov 2008 10:38:27 -0500 Subject: --- doc/todo/location_of_ikiwiki-w3m.cgi.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/todo/location_of_ikiwiki-w3m.cgi.mdwn diff --git a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn new file mode 100644 index 000000000..6e1941c91 --- /dev/null +++ b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn @@ -0,0 +1 @@ +The ikiwiki-w3m.cgi script is installed (hard-coded) into /usr/lib/w3m/cgi-bin/. On Fedora however, the w3m package expects it in /usr/libexec/w3m/cgi-bin. So, it would be nice if the destination for this script could be configured. -- cgit v1.2.3 From da7cc0408d1c2a7a1dc4f1d286c0c85237603f5f Mon Sep 17 00:00:00 2001 From: "http://yam655.livejournal.com/" Date: Wed, 26 Nov 2008 11:41:27 -0500 Subject: Relative previous months? --- doc/plugins/calendar/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/calendar/discussion.mdwn b/doc/plugins/calendar/discussion.mdwn index 148b83522..49826e4d9 100644 --- a/doc/plugins/calendar/discussion.mdwn +++ b/doc/plugins/calendar/discussion.mdwn @@ -2,3 +2,5 @@ It would be nice if the "month" type calendar could collect all of the matching pages on a given date in some inline type way. --[[DavidBremner]] Is it possible to get the calendar to link to pages based not on their timestamp (as I understand that it does now, or have I misunderstood this?) and instead on for example their location in a directory hierarchy. That way the calendar could be used as a planning / timeline device which I think would be great. --[[Alexander]] + +I would like the ability to specify relative previous months. This way I could have a sidebar with the last three months by specifying no month, then 'month="-1"' and 'month="-2"'. Negative numbers for the month would otherwise be invalid, so this shouldn't produce any conflicts with expected behavior. (Right?) -- [[StevneBlack]] -- cgit v1.2.3 From 0a15052262b22eb6349a653a2999ec79430a041b Mon Sep 17 00:00:00 2001 From: "http://yam655.livejournal.com/" Date: Wed, 26 Nov 2008 11:42:10 -0500 Subject: --- doc/plugins/calendar/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/calendar/discussion.mdwn b/doc/plugins/calendar/discussion.mdwn index 49826e4d9..9d57b7a1e 100644 --- a/doc/plugins/calendar/discussion.mdwn +++ b/doc/plugins/calendar/discussion.mdwn @@ -3,4 +3,4 @@ matching pages on a given date in some inline type way. --[[DavidBremner]] Is it possible to get the calendar to link to pages based not on their timestamp (as I understand that it does now, or have I misunderstood this?) and instead on for example their location in a directory hierarchy. That way the calendar could be used as a planning / timeline device which I think would be great. --[[Alexander]] -I would like the ability to specify relative previous months. This way I could have a sidebar with the last three months by specifying no month, then 'month="-1"' and 'month="-2"'. Negative numbers for the month would otherwise be invalid, so this shouldn't produce any conflicts with expected behavior. (Right?) -- [[StevneBlack]] +I would like the ability to specify relative previous months. This way I could have a sidebar with the last three months by specifying no month, then 'month="-1"' and 'month="-2"'. Negative numbers for the month would otherwise be invalid, so this shouldn't produce any conflicts with expected behavior. (Right?) -- [[StevenBlack]] -- cgit v1.2.3 From 17e4fc51be34b871d8637235c4f1ce064f3bd6fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Nov 2008 13:24:36 -0500 Subject: link to tip --- doc/rcs/git.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rcs/git.mdwn b/doc/rcs/git.mdwn index 6ba0da894..deddfbd6d 100644 --- a/doc/rcs/git.mdwn +++ b/doc/rcs/git.mdwn @@ -124,8 +124,8 @@ ignores the git authorship information, and uses the username of the unix user who made the commit. Then tests including the `locked_pages` [[PageSpec]] are checked to see if that user can edit the pages in the commit. -You can even set up an anonymous user, to allow anyone to push -changes in via git rather than using the web interface. +You can even set up an [[anonymous_user|tips/untrusted_git_push]], to allow +anyone to push changes in via git rather than using the web interface. ## Optionally using a local wiki to preview changes -- cgit v1.2.3 From 7cc14ddf441b3eb2879489f93a6986425c424bb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Nov 2008 13:28:16 -0500 Subject: fix handling of wrappergroup option Had forgot to include it in the option list. --- IkiWiki.pm | 9 ++++++++- debian/changelog | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 17e2a2a85..2ad2f792d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -277,13 +277,20 @@ sub getsetup () { #{{{ }, umask => { type => "integer", - description => "", example => "022", description => "force ikiwiki to use a particular umask", advanced => 1, safe => 0, # paranoia rebuild => 0, }, + wrappergroup => { + type => "string", + example => "ikiwiki", + description => "group for wrappers to run in", + advanced => 1, + safe => 0, # paranoia + rebuild => 0, + }, libdir => { type => "string", default => "", diff --git a/debian/changelog b/debian/changelog index 6650baa5b..39bca7a10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low produced by aggregate and recentchanges. * French translation update from Philippe Batailler. Closes: #506250 * Spanish translation update from Victor Moral. + * Fix handling of wrappergroup option. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 -- cgit v1.2.3 From 96ff36b872f65801332c628d23b9f851b058823d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Aug 1997 07:48:11 -0400 Subject: fix --wrappergroup Was documented to work at command line, but didn't --- ikiwiki.in | 1 + 1 file changed, 1 insertion(+) diff --git a/ikiwiki.in b/ikiwiki.in index 1a6d18a60..344b88148 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -40,6 +40,7 @@ sub getconfig () { #{{{ "post-commit" => \$config{post_commit}, "render=s" => \$config{render}, "wrappers!" => \$config{genwrappers}, + "wrappergroup=s" => \$config{wrappergroup}, "usedirs!" => \$config{usedirs}, "prefix-directives!" => \$config{prefix_directives}, "getctime" => \$config{getctime}, -- cgit v1.2.3 From 8d2084092ecea30cf7e1dd44ac04f48f90dba5a7 Mon Sep 17 00:00:00 2001 From: "http://joey.kitenet.net/" Date: Wed, 26 Nov 2008 13:43:08 -0500 Subject: test commit --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 001a838e9..582d46e84 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -4,7 +4,7 @@ testing 1..2..3!! ---- -Here's a paragraph. สวัสดี +Here's a paragraph. The following code block is pre-formatted: -- cgit v1.2.3 From 30360b3f5349f70dce994f0a6fbc8b71cd7ba708 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Aug 1997 08:26:03 -0400 Subject: add W3M_CGI_BIN setting --- Makefile.PL | 7 +++++-- doc/todo/location_of_ikiwiki-w3m.cgi.mdwn | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 2137b9dde..d92d54d1e 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,6 +23,9 @@ PROBABLE_INST_LIB=$(shell \\ fi \\ ) +# Additional configurable path variables. +W3M_CGI_BIN?=$(PREFIX)/lib/w3m/cgi-bin + tflag=$(shell if [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; then printf -- "-T"; fi) extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:Profile"; fi) @@ -94,8 +97,8 @@ extra_install: install -d $(DESTDIR)$(PREFIX)/sbin install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin - install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin - install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin + install -d $(DESTDIR)$(W3M_CGI_BIN) + install ikiwiki-w3m.cgi $(DESTDIR)$(W3M_CGI_BIN) install -d $(DESTDIR)$(PREFIX)/bin install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki diff --git a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn index 6e1941c91..2ccb7b088 100644 --- a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn +++ b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn @@ -1 +1,3 @@ The ikiwiki-w3m.cgi script is installed (hard-coded) into /usr/lib/w3m/cgi-bin/. On Fedora however, the w3m package expects it in /usr/libexec/w3m/cgi-bin. So, it would be nice if the destination for this script could be configured. + +> You can use W3M_CGI_BIN now. [[done]] --[[Joey]] -- cgit v1.2.3 From 04a03c097a46f28de4b803ef28b33c3dda2c3297 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Aug 1997 08:26:46 -0400 Subject: comment --- doc/todo/location_of_external_plugins.mdwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/todo/location_of_external_plugins.mdwn b/doc/todo/location_of_external_plugins.mdwn index b55bca324..28b762080 100644 --- a/doc/todo/location_of_external_plugins.mdwn +++ b/doc/todo/location_of_external_plugins.mdwn @@ -1,3 +1,15 @@ -Would it be possible to make the installation location for the external plugins (those talked to via xmlrpc) configurable? Currently, they are installed into (and later expected to be in) /usr/lib/ikiwiki/plugins. For the Fedora package (which I maintain), I move them to /usr/libexec/ikiwiki/plugins. While not covered by the FHS, this seems to be a more appropriate place, see: https://fedoraproject.org/wiki/Packaging/Guidelines#Libexecdir. +Would it be possible to make the installation location for the external +plugins (those talked to via xmlrpc) configurable? Currently, they are +installed into (and later expected to be in) /usr/lib/ikiwiki/plugins. For +the Fedora package (which I maintain), I move them to +/usr/libexec/ikiwiki/plugins. While not covered by the FHS, this seems to +be a more appropriate place, see: +https://fedoraproject.org/wiki/Packaging/Guidelines#Libexecdir. + +> This would need to be a build time configuration setting so the directory +> is built into ikiwiki for use at runtime. --[[Joey]] As a side note, the accompanying proxy.py might better be placed into some directory on the python path. + +> If someone can show how to do so without needing a Setup.py and all the +> pain that using one entails.. --[[Joey]] -- cgit v1.2.3 From 91cb55d96b549e3b29afb398a79d15591e39e3aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Aug 1997 08:31:42 -0400 Subject: Correct --dumpsetup to include the srcdir in the setup file. --- debian/changelog | 1 + doc/bugs/dumpsetup_does_not_save_destdir.mdwn | 2 ++ ikiwiki.in | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 39bca7a10..649dfeb0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low * French translation update from Philippe Batailler. Closes: #506250 * Spanish translation update from Victor Moral. * Fix handling of wrappergroup option. + * Correct --dumpsetup to include the srcdir in the setup file. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/doc/bugs/dumpsetup_does_not_save_destdir.mdwn b/doc/bugs/dumpsetup_does_not_save_destdir.mdwn index 2f62489af..768c3fc5e 100644 --- a/doc/bugs/dumpsetup_does_not_save_destdir.mdwn +++ b/doc/bugs/dumpsetup_does_not_save_destdir.mdwn @@ -1 +1,3 @@ Calling ikiwiki with a bunch of options, including the --dumpsetup somefile.setup option creates somefile.setup for later reuse with the --setup option. The destination dir however is not saved in the setup file, it has destdir => ''. + +> that broke in version 2.64 .. fixed [[done]] --[[Joey]] diff --git a/ikiwiki.in b/ikiwiki.in index 344b88148..473cbdbfd 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -163,7 +163,8 @@ sub main () { #{{{ } if ($config{dumpsetup}) { - $config{srdir}=$config{destdir}=""; + $config{srcdir}="" if ! defined $config{srcdir}; + $config{destdir}="" if ! defined $config{destdir}; $config{syslog}=1 if $config{setupsyslog}; require IkiWiki::Setup; IkiWiki::Setup::dump($config{dumpsetup}); -- cgit v1.2.3 From d056a01a55e63388973787c133d27ccd3cc8f4a1 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:15:00 -0500 Subject: Fix formatting by adding `...` --- doc/todo/location_of_ikiwiki-w3m.cgi.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn index 2ccb7b088..8ca925bee 100644 --- a/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn +++ b/doc/todo/location_of_ikiwiki-w3m.cgi.mdwn @@ -1,3 +1,3 @@ -The ikiwiki-w3m.cgi script is installed (hard-coded) into /usr/lib/w3m/cgi-bin/. On Fedora however, the w3m package expects it in /usr/libexec/w3m/cgi-bin. So, it would be nice if the destination for this script could be configured. +The `ikiwiki-w3m.cgi` script is installed (hard-coded) into `/usr/lib/w3m/cgi-bin`. On Fedora however, the w3m package expects it in `/usr/libexec/w3m/cgi-bin`. So, it would be nice if the destination for this script could be configured. -> You can use W3M_CGI_BIN now. [[done]] --[[Joey]] +> You can use `W3M_CGI_BIN now`. [[done]] --[[Joey]] -- cgit v1.2.3 From 7592a6f5b6349ecd6d52d701c2975cb509c98292 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:26:28 -0500 Subject: I don't think putting proxy.py in the system Python path is appropriate --- doc/todo/location_of_external_plugins.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/todo/location_of_external_plugins.mdwn b/doc/todo/location_of_external_plugins.mdwn index 28b762080..c28003e74 100644 --- a/doc/todo/location_of_external_plugins.mdwn +++ b/doc/todo/location_of_external_plugins.mdwn @@ -13,3 +13,12 @@ As a side note, the accompanying proxy.py might better be placed into some direc > If someone can show how to do so without needing a Setup.py and all the > pain that using one entails.. --[[Joey]] + +>> At the very least I don't think proxy.py should be on the `sys.path` +>> under its current name. If it was renamed to ikiwiki_proxy or some such, +>> possibly; but I think it's more appropriate to have it in an +>> ikiwiki-specific directory (a "private module") since it's not useful for +>> anything outside ikiwiki, and putting it in the same directory as the +>> external plugins means it's automatically in their `sys.path` without +>> needing special configuration. --[[smcv]] +>> (a mostly-inactive member of Debian's Python modules packaging team) -- cgit v1.2.3 From 7a7f4a3cb60376dc46756e968161acb8e73ff88f Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:38:37 -0500 Subject: Move some discussion from comments page to here --- doc/plugins/contrib/comments/discussion.mdwn | 139 +++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 doc/plugins/contrib/comments/discussion.mdwn diff --git a/doc/plugins/contrib/comments/discussion.mdwn b/doc/plugins/contrib/comments/discussion.mdwn new file mode 100644 index 000000000..8f98c1cb5 --- /dev/null +++ b/doc/plugins/contrib/comments/discussion.mdwn @@ -0,0 +1,139 @@ +# Why internal pages? (unresolved) + +Comments are saved as internal pages, so they can never be edited through the CGI, +only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. + +> So, why do it this way, instead of using regular wiki pages in a +> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to +> limit editing of comments in more powerful ways. --[[Joey]] + +>> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines +>> rather than as individual pages (same reasoning as aggregated posts), though. +>> +>> lockedit is actually somewhat insufficient, since `check_canedit()` +>> doesn't distinguish between creation and editing; I'd have to continue to use +>> some sort of odd hack to allow creation but not editing. +>> +>> I also can't think of any circumstance where you'd want a user other than +>> admins (~= git committers) and possibly the commenter (who we can't check for +>> at the moment anyway, I don't think?) to be able to edit comments - I think +>> user expectations for something that looks like ordinary blog comments are +>> likely to include "others can't put words into my mouth". +>> +>> My other objection to using a namespace is that I'm not particularly happy about +>> plugins consuming arbitrary pieces of the wiki namespace - /discussion is bad +>> enough already. Indeed, this very page would accidentally get matched by rules +>> aiming to control comment-posting... :-) --[[smcv]] + +>>> Thinking about it, perhaps one way to address this would be to have the suffix +>>> (e.g. whether commenting on Sandbox creates sandbox/comment1 or sandbox/c1 or +>>> what) be configurable by the wiki admin, in the same way that recentchanges has +>>> recentchangespage => 'recentchanges'? I'd like to see fewer hard-coded page +>>> names in general, really - it seems odd to me that shortcuts and smileys +>>> hard-code the name of the page to look at. Perhaps I could add +>>> discussionpage => 'discussion' too? --[[smcv]] + +>>> (I've now implemented this in my branch. --[[smcv]]) + +>> The best reason to keep the pages internal seems to me to be that you +>> don't want the overhead of every comment spawning its own wiki page. +>> The worst problem with it though is that you have to assume the pages +>> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] + +>>> Well, you could always have `comment1._mdwn`, `comment2._creole` etc. and +>>> alter the htmlize logic so that the `mdwn` hook is called for both `mdwn` +>>> and `_mdwn` (assuming this is not already the case). I'm not convinced +>>> that multi-format comments are a killer feature, though - part of the point +>>> of this plugin, in my mind, is that it's less flexible than the full power +>>> of ikiwiki and gives users fewer options. This could be construed +>>> to be a feature, for people who don't care how flexible the technology is +>>> and just want a simple way to leave a comment. The FormattingHelp page +>>> assumes you're writing 100% Markdown in any case... +>>> +>>> Internal pages do too many things, perhaps: they suppress generation of +>>> HTML pages, they disable editing over the web, and they have a different +>>> namespace of htmlize hooks. I think the first two of those are useful +>>> for this plugin, and the last is harmless; you seem to think the first +>>> is useful, and the other two are harmful. --[[smcv]] + +# Access control (unresolved?) + +By the way, I think that who can post comments should be controllable by +the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing +posting comments w/o any login, while a nice capability, can lead to +spam problems. So, use `check_canedit` as at least a first-level check? +--[[Joey]] + +> This plugin already uses `check_canedit`, but that function doesn't have a concept +> of different actions. The hack I use is that when a user comments on, say, sandbox, +> I call `check_canedit` for the pseudo-page "sandbox[postcomment]". The +> special `postcomment(glob)` [[ikiwiki/pagespec]] returns true if the page ends with +> "[postcomment]" and the part before (e.g. sandbox) matches the glob. So, you can +> have postcomment(blog/*) or something. (Perhaps instead of taking a glob, postcomment +> should take a pagespec, so you can have postcomment(link(tags/commentable))?) +> +> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'` +> are necessary to allow anonymous and logged-in editing (respectively). +> +> This is ugly - one alternative would be to add `check_permission()` that takes a +> page and a verb (create, edit, rename, remove and maybe comment are the ones I +> can think of so far), use that, and port the plugins you mentioned to use that +> API too. This plugin could either call `check_can("$page/comment1", 'create')` or +> call `check_can($page, 'comment')`. +> +> One odd effect of the code structure I've used is that we check for the ability to +> create the page before we actually know what page name we're going to use - when +> posting the comment I just increment a number until I reach an unused one - so +> either the code needs restructuring, or the permission check for 'create' would +> always be for 'comment1' and never 'comment123'. + +> Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`. +> However, this makes the "comments can only be created, not edited" feature completely +> reliant on the fact that internal pages can't be edited. Perhaps there should be a +> `editable_pages` pagespec, defaulting to `'*'`? --[[smcv]] + +# comments directive vs global setting (resolved?) + +When comments have been enabled generally, you still need to mark which pages +can have comments, by including the `\[[!comments]]` directive in them. By default, +this directive expands to a "post a comment" link plus an `\[[!inline]]` with +the comments. [This requirement has now been removed --[[smcv]]] + +> I don't like this, because it's hard to explain to someone why they have +> to insert this into every post to their blog. Seems that the model used +> for discussion pages could work -- if comments are enabled, automatically +> add the comment posting form and comments to the end of each page. +> --[[Joey]] + +>> I don't think I'd want comments on *every* page (particularly, not the +>> front page). Perhaps a pagespec in the setup file, where the default is "*"? +>> Then control freaks like me could use "link(tags/comments)" and tag pages +>> as allowing comments. +>> +>>> Yes, I think a pagespec is the way to go. --[[Joey]] + +>>>> Implemented --[[smcv]] + +>> +>> The model used for discussion pages does require patching the existing +>> page template, which I was trying to avoid - I'm not convinced that having +>> every possible feature hard-coded there really scales (and obviously it's +>> rather annoying while this plugin is on a branch). --[[smcv]] + +>>> Using the template would allow customising the html around the comments +>>> which seems like a good thing? --[[Joey]] + +>>>> The \[[!comments]] directive is already template-friendly - it expands to +>>>> the contents of the template `comments_embed.tmpl`, possibly with the +>>>> result of an \[[!inline]] appended. I should change `comments_embed.tmpl` +>>>> so it uses a template variable `INLINE` for the inline result rather than +>>>> having the perl code concatenate it, which would allow a bit more +>>>> customization (whether the "post" link was before or after the inline). +>>>> Even if you want comments in page.tmpl, keeping the separate comments_embed.tmpl +>>>> and having a `COMMENTS` variable in page.tmpl might be the way forward, +>>>> since the smaller each templates is, the easier it will be for users +>>>> to maintain a patched set of templates. (I think so, anyway, based on what happens +>>>> with dpkg prompts in Debian packages with monolithic vs split +>>>> conffiles.) --[[smcv]] + +>>>>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]] -- cgit v1.2.3 From 92efb9c000825e1f16af4a27c51fb3e82a490a3f Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:39:16 -0500 Subject: Move some discussion to discussion/ --- doc/plugins/contrib/comments.mdwn | 147 ++------------------------------------ 1 file changed, 5 insertions(+), 142 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 1a6e7f465..891d3dee5 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -5,96 +5,6 @@ This plugin adds "blog-style" comments. The intention is that on a non-wiki site (like a blog) you can lock all pages for admin-only access, then allow otherwise unprivileged (or perhaps even anonymous) users to comment on posts. -Comments are saved as internal pages, so they can never be edited through the CGI, -only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. - -> So, why do it this way, instead of using regular wiki pages in a -> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to -> limit editing of comments in more powerful ways. --[[Joey]] - ->> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines ->> rather than as individual pages (same reasoning as aggregated posts), though. ->> ->> lockedit is actually somewhat insufficient, since `check_canedit()` ->> doesn't distinguish between creation and editing; I'd have to continue to use ->> some sort of odd hack to allow creation but not editing. ->> ->> I also can't think of any circumstance where you'd want a user other than ->> admins (~= git committers) and possibly the commenter (who we can't check for ->> at the moment anyway, I don't think?) to be able to edit comments - I think ->> user expectations for something that looks like ordinary blog comments are ->> likely to include "others can't put words into my mouth". ->> ->> My other objection to using a namespace is that I'm not particularly happy about ->> plugins consuming arbitrary pieces of the wiki namespace - /discussion is bad ->> enough already. Indeed, this very page would accidentally get matched by rules ->> aiming to control comment-posting... :-) --[[smcv]] - ->> Thinking about it, perhaps one way to address this would be to have the suffix ->> (e.g. whether commenting on Sandbox creates sandbox/comment1 or sandbox/c1 or ->> what) be configurable by the wiki admin, in the same way that recentchanges has ->> recentchangespage => 'recentchanges'? I'd like to see fewer hard-coded page ->> names in general, really - it seems odd to me that shortcuts and smileys ->> hard-code the name of the page to look at. Perhaps I could add ->> discussionpage => 'discussion' too? --[[smcv]] - ->> (I've now implemented this in my branch. --[[smcv]]) - ->> The best reason to keep the pages internal seems to me to be that you ->> don't want the overhead of every comment spawning its own wiki page. ->> The worst problem with it though is that you have to assume the pages ->> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] - ->> Well, you could always have `comment1._mdwn`, `comment2._creole` etc. and ->> alter the htmlize logic so that the `mdwn` hook is called for both `mdwn` ->> and `_mdwn` (assuming this is not already the case). I'm not convinced ->> that multi-format comments are a killer feature, though - part of the point ->> of this plugin, in my mind, is that it's less flexible than the full power ->> of ikiwiki and gives users fewer options. This could be construed ->> to be a feature, for people who don't care how flexible the technology is ->> and just want a simple way to leave a comment. The FormattingHelp page ->> assumes you're writing 100% Markdown in any case... ->> ->> Internal pages do too many things, perhaps: they suppress generation of ->> HTML pages, they disable editing over the web, and they have a different ->> namespace of htmlize hooks. I think the first two of those are useful ->> for this plugin, and the last is harmless; you seem to think the first ->> is useful, and the other two are harmful. --[[smcv]] - ->> By the way, I think that who can post comments should be controllable by ->> the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing ->> posting comments w/o any login, while a nice capability, can lead to ->> spam problems. So, use `check_canedit` as at least a first-level check? ->> --[[Joey]] - ->> This plugin already uses `check_canedit`, but that function doesn't have a concept ->> of different actions. The hack I use is that when a user comments on, say, sandbox, ->> I call `check_canedit` for the pseudo-page "sandbox[postcomment]". The ->> special `postcomment(glob)` [[ikiwiki/pagespec]] returns true if the page ends with ->> "[postcomment]" and the part before (e.g. sandbox) matches the glob. So, you can ->> have postcomment(blog/*) or something. (Perhaps instead of taking a glob, postcomment ->> should take a pagespec, so you can have postcomment(link(tags/commentable))?) ->> ->> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'` ->> are necessary to allow anonymous and logged-in editing (respectively). ->> ->> This is ugly - one alternative would be to add `check_permission()` that takes a ->> page and a verb (create, edit, rename, remove and maybe comment are the ones I ->> can think of so far), use that, and port the plugins you mentioned to use that ->> API too. This plugin could either call `check_can("$page/comment1", 'create')` or ->> call `check_can($page, 'comment')`. ->> ->> One odd effect of the code structure I've used is that we check for the ability to ->> create the page before we actually know what page name we're going to use - when ->> posting the comment I just increment a number until I reach an unused one - so ->> either the code needs restructuring, or the permission check for 'create' would ->> always be for 'comment1' and never 'comment123'. --[[smcv]] - ->> Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`. ->> However, this makes the "comments can only be created, not edited" feature completely ->> reliant on the fact that internal pages can't be edited. Perhaps there should be a ->> `editable_pages` pagespec, defaulting to `'*'`? - When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing down the wiki by causing time-consuming processing. As long as the recommended plugins @@ -127,50 +37,6 @@ are enabled, comment authorship should hopefully be unforgeable by CGI users. >> sensible to allow users to (ab)use them on open wikis. >> --[[Joey]] -When comments have been enabled generally, you still need to mark which pages -can have comments, by including the `\[[!comments]]` directive in them. By default, -this directive expands to a "post a comment" link plus an `\[[!inline]]` with -the comments. [This requirement has now been removed --[[smcv]]] - -> I don't like this, because it's hard to explain to someone why they have -> to insert this into every post to their blog. Seems that the model used -> for discussion pages could work -- if comments are enabled, automatically -> add the comment posting form and comments to the end of each page. -> --[[Joey]] - ->> I don't think I'd want comments on *every* page (particularly, not the ->> front page). Perhaps a pagespec in the setup file, where the default is "*"? ->> Then control freaks like me could use "link(tags/comments)" and tag pages ->> as allowing comments. ->> ->>> Yes, I think a pagespec is the way to go. --[[Joey]] - ->>> Implemented --[[smcv]] - ->> ->> The model used for discussion pages does require patching the existing ->> page template, which I was trying to avoid - I'm not convinced that having ->> every possible feature hard-coded there really scales (and obviously it's ->> rather annoying while this plugin is on a branch). --[[smcv]] - ->>> Using the template would allow customising the html around the comments ->>> which seems like a good thing? --[[Joey]] - ->>> The \[[!comments]] directive is already template-friendly - it expands to ->>> the contents of the template `comments_embed.tmpl`, possibly with the ->>> result of an \[[!inline]] appended. I should change `comments_embed.tmpl` ->>> so it uses a template variable `INLINE` for the inline result rather than ->>> having the perl code concatenate it, which would allow a bit more ->>> customization (whether the "post" link was before or after the inline). ->>> Even if you want comments in page.tmpl, keeping the separate comments_embed.tmpl ->>> and having a `COMMENTS` variable in page.tmpl might be the way forward, ->>> since the smaller each templates is, the easier it will be for users ->>> to maintain a patched set of templates. (I think so, anyway, based on what happens ->>> with dpkg prompts in Debian packages with monolithic vs split ->>> conffiles.) --[[smcv]] - ->>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]] - The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: @@ -183,20 +49,17 @@ to allow non-admin users to comment on pages, but not edit anything. You can als to allow anonymous comments (the IP address will be used as the "author"). -> This is still called postcomment, although I've renamed the rest of the plugin -> to comments as suggested on #ikiwiki --[[smcv]] - There are some global options for the setup file: -* comments_shown_pagespec: pages where comments will be displayed inline, e.g. `blog/*` +* `comments_shown_pagespec`: pages where comments will be displayed inline, e.g. `blog/*` or `*/discussion`. -* comments_open_pagespec: pages where new comments can be posted, e.g. +* `comments_open_pagespec`: pages where new comments can be posted, e.g. `blog/* and created_after(close_old_comments)` or `*/discussion` -* comments_pagename: if this is e.g. `comment_` (the default), then comments on the +* `comments_pagename`: if this is e.g. `comment_` (the default), then comments on the [[sandbox]] will be called something like `sandbox/comment_12` -* comments_allowdirectives: if true (default false), comments may contain IkiWiki +* `comments_allowdirectives`: if true (default false), comments may contain IkiWiki directives -* comments_commit: if true (default true), comments will be committed to the version +* `comments_commit`: if true (default true), comments will be committed to the version control system This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", -- cgit v1.2.3 From ec03c89f3e01a2b1d374e1ae66d3f5fb0370ca99 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:42:07 -0500 Subject: Move some more discussion here --- doc/plugins/contrib/comments/discussion.mdwn | 37 +++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/doc/plugins/contrib/comments/discussion.mdwn b/doc/plugins/contrib/comments/discussion.mdwn index 8f98c1cb5..a054dd55d 100644 --- a/doc/plugins/contrib/comments/discussion.mdwn +++ b/doc/plugins/contrib/comments/discussion.mdwn @@ -1,4 +1,4 @@ -# Why internal pages? (unresolved) +## Why internal pages? (unresolved) Comments are saved as internal pages, so they can never be edited through the CGI, only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. @@ -56,7 +56,7 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >>> for this plugin, and the last is harmless; you seem to think the first >>> is useful, and the other two are harmful. --[[smcv]] -# Access control (unresolved?) +## Access control (unresolved?) By the way, I think that who can post comments should be controllable by the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing @@ -92,7 +92,7 @@ spam problems. So, use `check_canedit` as at least a first-level check? > reliant on the fact that internal pages can't be edited. Perhaps there should be a > `editable_pages` pagespec, defaulting to `'*'`? --[[smcv]] -# comments directive vs global setting (resolved?) +## comments directive vs global setting (resolved?) When comments have been enabled generally, you still need to mark which pages can have comments, by including the `\[[!comments]]` directive in them. By default, @@ -137,3 +137,34 @@ the comments. [This requirement has now been removed --[[smcv]]] >>>> conffiles.) --[[smcv]] >>>>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]] + +## Raw HTML (resolved?) + +Raw HTML was not initially allowed by default (this was configurable). + +> I'm not sure that raw html should be a problem, as long as the +> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering +> out directives, as a special case. --[[Joey]] + +>> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy +>> or htmlbalance turned on, then there should be no way the user can forge a comment; +>> I was initially wary of allowing meta directives, but I think those are OK, as long +>> as the comment template puts the \[[!meta author]] at the *end*. Disallowing +>> directives is more a way to avoid commenters causing expensive processing than +>> anything else, at this point. +>> +>> I've rebased the plugin on master, made it sanitize individual posts' content +>> and removed the option to disallow raw HTML. Sanitizing individual posts before +>> they've been htmlized required me to preserve whitespace in the htmlbalance +>> plugin, so I did that. Alternatively, we could htmlize immediately and always +>> save out raw HTML? --[[smcv]] + +>>> There might be some use cases for other directives, such as img, in +>>> comments. +>>> +>>> I don't know if meta is "safe" (ie, guaranteed to be inexpensive and not +>>> allow users to do annoying things) or if it will continue to be in the +>>> future. Hard to predict really, all that can be said with certainty is +>>> all directives will contine to be inexpensive and safe enough that it's +>>> sensible to allow users to (ab)use them on open wikis. +>>> --[[Joey]] -- cgit v1.2.3 From e69095504cb36705494b43d134cea6745755e4ba Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 27 Nov 2008 05:56:36 -0500 Subject: --- doc/plugins/contrib/comments.mdwn | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 891d3dee5..ef067f4d0 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -10,33 +10,6 @@ or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters down the wiki by causing time-consuming processing. As long as the recommended plugins are enabled, comment authorship should hopefully be unforgeable by CGI users. -> I'm not sure that raw html should be a problem, as long as the -> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering -> out directives, as a special case. --[[Joey]] - ->> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy ->> or htmlbalance turned on, then there should be no way the user can forge a comment; ->> I was initially wary of allowing meta directives, but I think those are OK, as long ->> as the comment template puts the \[[!meta author]] at the *end*. Disallowing ->> directives is more a way to avoid commenters causing expensive processing than ->> anything else, at this point. ->> ->> I've rebased the plugin on master, made it sanitize individual posts' content ->> and removed the option to disallow raw HTML. Sanitizing individual posts before ->> they've been htmlized required me to preserve whitespace in the htmlbalance ->> plugin, so I did that. Alternatively, we could htmlize immediately and always ->> save out raw HTML? --[[smcv]] - ->> There might be some use cases for other directives, such as img, in ->> comments. ->> ->> I don't know if meta is "safe" (ie, guaranteed to be inexpensive and not ->> allow users to do annoying things) or if it will continue to be in the ->> future. Hard to predict really, all that can be said with certainty is ->> all directives will contine to be inexpensive and safe enough that it's ->> sensible to allow users to (ab)use them on open wikis. ->> --[[Joey]] - The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from the [[plugins/lockedit]] plugin. Typical usage would be something like: @@ -70,9 +43,10 @@ and is currently available from [[smcv]]'s git repository on git.pseudorandom.co Known issues: * Needs code review -* The access control via postcomment() is rather strange +* The access control via postcomment() is rather strange (see [[discussion]] for more details) * There is some common code cargo-culted from other plugins (notably inline and editpage) which should probably be shared +* Joey doesn't think it should necessarily use internal pages (see [[discussion]]) > I haven't done a detailed code review, but I will say I'm pleased you > avoided re-implementing inline! --[[Joey]] @@ -85,3 +59,9 @@ Wishlist: as someone else (even if anonymous comments are allowed, it'd be nice to be able to choose to log in with a username or OpenID, like in Livejournal); perhaps editpage needs this too + +Fixed issues: + +* Joey didn't think the `\[[!comments]]` directive was appropriate; comments now appear + on pages selected with a [[ikiwiki/pagespec]] +* Joey thought that raw HTML should always be allowed; it now is -- cgit v1.2.3 From 708ff7870dfb9ae9e3d289f886433b82e016b58f Mon Sep 17 00:00:00 2001 From: "http://hadleywickham.myopenid.com/" Date: Thu, 27 Nov 2008 18:53:18 -0500 Subject: --- doc/setup/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/setup/discussion.mdwn b/doc/setup/discussion.mdwn index 7d8c525e7..ba74c5771 100644 --- a/doc/setup/discussion.mdwn +++ b/doc/setup/discussion.mdwn @@ -138,3 +138,10 @@ Thanks for your response. You're right. Ubuntu does have ikiwiki, except that it Anyway, I think I might be able to install it from the tarball I downloaded. I've been reading the discussions, had a look at your screencasts, etc. I will give it another bash. -- [[WillDioneda]] ---- + +How do I set up cgi editing? In setup I have: + + * cgiurl => 'http://wiki.had.co.nz/edit.cgi' + * cgi_wrapper => 'edit.cgi' + +But I don't get an edit link on my pages? What am I doing wrong? -- cgit v1.2.3 From c9646ac23c526f2c2d7c9eeb77ff4fdcd59dbee1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Nov 2008 08:52:56 -0800 Subject: German translation update from Kai Wasserbäch. Closes: #507056 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 1 + po/de.po | 264 ++++++++++++++++++++++++++----------------------------- 2 files changed, 128 insertions(+), 137 deletions(-) diff --git a/debian/changelog b/debian/changelog index 649dfeb0a..8d2b6661f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low * Spanish translation update from Victor Moral. * Fix handling of wrappergroup option. * Correct --dumpsetup to include the srcdir in the setup file. + * German translation update from Kai Wasserbäch. Closes: #507056 -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/po/de.po b/po/de.po index 022fbfef1..55234a909 100644 --- a/po/de.po +++ b/po/de.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: ikiwiki 2.40\n" -"Report-Msgid-Bugs-To: \n" +"Project-Id-Version: ikiwiki 2.70\n" +"Report-Msgid-Bugs-To: ikiwiki@packages.debian.org\n" "POT-Creation-Date: 2008-10-31 16:37-0400\n" -"PO-Revision-Date: 2008-03-03 21:22+0100\n" +"PO-Revision-Date: 2008-11-20 19:58+0100\n" "Last-Translator: Kai Wasserbäch \n" "Language-Team: German \n" "MIME-Version: 1.0\n" @@ -25,7 +25,7 @@ msgstr "" #: ../IkiWiki/CGI.pm:163 ../IkiWiki/Plugin/editpage.pm:350 msgid "Your login session has expired." -msgstr "" +msgstr "Ihre Anmeldung für die aktuelle Sitzung ist abgelaufen." #: ../IkiWiki/CGI.pm:184 msgid "Login" @@ -53,11 +53,11 @@ msgstr "Fehler" #: ../IkiWiki/Plugin/aggregate.pm:80 msgid "Aggregation triggered via web." -msgstr "" +msgstr "Feed-Erstellung wurde über das Web ausgelöst." #: ../IkiWiki/Plugin/aggregate.pm:89 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "" +msgstr "Derzeit nichts zu tun, alle Feeds sind auf dem neusten Stand!" #: ../IkiWiki/Plugin/aggregate.pm:216 #, perl-format @@ -89,7 +89,7 @@ msgstr "%s läuft aus" #: ../IkiWiki/Plugin/aggregate.pm:463 #, perl-format msgid "last checked %s" -msgstr "" +msgstr "zuletzt überprüft am %s" #: ../IkiWiki/Plugin/aggregate.pm:467 #, perl-format @@ -108,12 +108,12 @@ msgstr "Feed nicht gefunden" #: ../IkiWiki/Plugin/aggregate.pm:498 #, perl-format msgid "(invalid UTF-8 stripped from feed)" -msgstr "(ungültiges UTF-8 wurde aus dem Feed entfernt)" +msgstr "(ungültiges UTF-8-Zeichen wurde aus dem Feed entfernt)" #: ../IkiWiki/Plugin/aggregate.pm:504 #, perl-format msgid "(feed entities escaped)" -msgstr "(Feedentitäten maskiert)" +msgstr "(Feed-Entitäten maskiert)" #: ../IkiWiki/Plugin/aggregate.pm:510 msgid "feed crashed XML::Feed!" @@ -126,7 +126,7 @@ msgstr "erstelle neue Seite %s" #: ../IkiWiki/Plugin/amazon_s3.pm:31 msgid "deleting bucket.." -msgstr "" +msgstr "Lösche Bucket..." #: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206 msgid "done" @@ -135,42 +135,40 @@ msgstr "fertig" #: ../IkiWiki/Plugin/amazon_s3.pm:97 #, perl-format msgid "Must specify %s" -msgstr "" +msgstr "%s muss angegeben werden" #: ../IkiWiki/Plugin/amazon_s3.pm:136 msgid "Failed to create bucket in S3: " -msgstr "" +msgstr "Konnte keinen Bucket in S3 erstellen: " #: ../IkiWiki/Plugin/amazon_s3.pm:221 -#, fuzzy msgid "Failed to save file to S3: " -msgstr "Es konnte keine E-Mail versandt werden" +msgstr "Konnte Datei nicht bei S3 speichern: " #: ../IkiWiki/Plugin/amazon_s3.pm:243 -#, fuzzy msgid "Failed to delete file from S3: " -msgstr "konnte kein Bild aus dem Code erzeugen" +msgstr "Konnte Datei nicht bei S3 löschen: " #: ../IkiWiki/Plugin/attachment.pm:49 #, perl-format msgid "there is already a page named %s" -msgstr "" +msgstr "eine Seite mit dem Namen %s existiert bereits" #: ../IkiWiki/Plugin/attachment.pm:82 msgid "prohibited by allowed_attachments" -msgstr "" +msgstr "durch allowed_attachements verboten" #: ../IkiWiki/Plugin/attachment.pm:190 msgid "bad attachment filename" -msgstr "" +msgstr "fehlerhafter Dateiname für Anhang" #: ../IkiWiki/Plugin/attachment.pm:232 msgid "attachment upload" -msgstr "" +msgstr "Anhang hochladen" #: ../IkiWiki/Plugin/autoindex.pm:105 msgid "automatic index generation" -msgstr "" +msgstr "automatische Index-Erstellung" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:261 #: ../IkiWiki/Plugin/inline.pm:327 ../IkiWiki/Plugin/opendiscussion.pm:26 @@ -197,21 +195,21 @@ msgstr "der Parameter %s wird benötigt" #: ../IkiWiki/Plugin/cutpaste.pm:66 msgid "no text was copied in this page" -msgstr "" +msgstr "es wurde kein Text in diese Seite kopiert" #: ../IkiWiki/Plugin/cutpaste.pm:69 #, perl-format msgid "no text was copied in this page with id %s" -msgstr "" +msgstr "es wurde kein Text in die Seite mit der ID %s kopiert" #: ../IkiWiki/Plugin/editpage.pm:40 -#, fuzzy, perl-format +#, perl-format msgid "removing old preview %s" -msgstr "entferne alte Seite %s" +msgstr "entferne alte Vorschau %s" #: ../IkiWiki/Plugin/editpage.pm:125 msgid "bad page name" -msgstr "" +msgstr "fehlerhafter Seitenname" #: ../IkiWiki/Plugin/editpage.pm:141 #, perl-format @@ -249,12 +247,12 @@ msgstr "Bearbeitung fehlgeschlagen" #: ../IkiWiki/Plugin/format.pm:22 msgid "must specify format and text" -msgstr "" +msgstr "Format und Text muss spezifiziert werden" #: ../IkiWiki/Plugin/format.pm:25 #, perl-format msgid "unsupported page format %s" -msgstr "" +msgstr "nicht unterstütztes Seitenformat %s" #: ../IkiWiki/Plugin/fortune.pm:27 msgid "fortune failed" @@ -264,25 +262,26 @@ msgstr "»fortune« fehlgeschlagen" #: ../IkiWiki/Receive.pm:129 #, perl-format msgid "you are not allowed to change %s" -msgstr "" +msgstr "es ist Ihnen nicht erlaubt, %s zu ändern" #: ../IkiWiki/Plugin/git.pm:658 #, perl-format msgid "you cannot act on a file with mode %s" -msgstr "" +msgstr "Sie können Dateien mit den Zugriffsrechten %s nicht verändern" #: ../IkiWiki/Plugin/git.pm:662 msgid "you are not allowed to change file modes" -msgstr "" +msgstr "Es ist Ihnen nicht erlaubt, Dateizugriffsrechte zu ändern" #: ../IkiWiki/Plugin/google.pm:27 -#, fuzzy, perl-format +#, perl-format msgid "Must specify %s when using the google search plugin" -msgstr "%s muss angegeben werden, wenn die Sucherweiterung verwandt wird" +msgstr "%s muss angegeben werden, wenn die Google-Sucherweiterung verwandt wird" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" msgstr "" +"Verarbeiten der URL fehlgeschlagen, konnte Domainnamen nicht feststellen" #: ../IkiWiki/Plugin/googlecalendar.pm:32 msgid "failed to find url in html" @@ -297,14 +296,13 @@ msgid "prog not a valid graphviz program" msgstr "prog ist kein gültiges graphviz-Programm" #: ../IkiWiki/Plugin/img.pm:62 -#, fuzzy msgid "Image::Magick is not installed" -msgstr "polygen ist nicht installiert" +msgstr "Image::Magick ist nicht installiert" #: ../IkiWiki/Plugin/img.pm:69 #, perl-format msgid "bad size \"%s\"" -msgstr "falsche Größe \"%s\"" +msgstr "falsche Größe »%s«" #: ../IkiWiki/Plugin/img.pm:80 ../IkiWiki/Plugin/img.pm:84 #: ../IkiWiki/Plugin/img.pm:101 @@ -329,14 +327,12 @@ msgstr "" "genutzt wird" #: ../IkiWiki/Plugin/inline.pm:139 -#, fuzzy msgid "page editing not allowed" -msgstr "Zyklische Umleitungen sind nicht erlaubt" +msgstr "Seitenbearbeitungen sind nicht erlaubt" #: ../IkiWiki/Plugin/inline.pm:156 -#, fuzzy msgid "missing pages parameter" -msgstr "Parameter %s fehlt" +msgstr "Fehlender Seitenparameter" #: ../IkiWiki/Plugin/inline.pm:204 #, perl-format @@ -358,26 +354,27 @@ msgstr "Diskussion" #: ../IkiWiki/Plugin/inline.pm:572 msgid "RPC::XML::Client not found, not pinging" -msgstr "RPC::XML::Client nicht gefunden, pinge nicht" +msgstr "RPC::XML::Client nicht gefunden, führe Ping nicht aus" #: ../IkiWiki/Plugin/linkmap.pm:106 msgid "failed to run dot" msgstr "dot konnte nicht ausgeführt werden" #: ../IkiWiki/Plugin/lockedit.pm:49 ../IkiWiki/Plugin/lockedit.pm:66 -#, fuzzy, perl-format +#, perl-format msgid "%s is locked and cannot be edited" -msgstr "%s wurde von %s gesperrt und kann nicht bearbeitet werden" +msgstr "%s wurde gesperrt und kann nicht bearbeitet werden" #: ../IkiWiki/Plugin/mdwn.pm:44 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed" msgstr "" +"»multimarkdown« ist aktiviert, aber Text::MultiMarkdown ist nicht installiert" #: ../IkiWiki/Plugin/mdwn.pm:67 #, perl-format msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)" msgstr "" -"Laden des des Perl-Moduls »Markdown.pm« (%s) oder von »/usr/bin/markdown« (%s) " +"Laden des Perl-Moduls »Markdown.pm« (%s) oder »/usr/bin/markdown« (%s) " "fehlgeschlagen" #: ../IkiWiki/Plugin/meta.pm:150 @@ -435,6 +432,8 @@ msgstr "Konto konnte nicht erstellt werden." #: ../IkiWiki/Plugin/passwordauth.pm:257 msgid "No email address, so cannot email password reset instructions." msgstr "" +"Keine E-Mail-Adresse angegeben; deshalb können keine Anweisungen zum " +"Zurücksetzen des Passworts via E-Mail versandt werden." #: ../IkiWiki/Plugin/passwordauth.pm:291 msgid "Failed to send mail" @@ -442,38 +441,37 @@ msgstr "Es konnte keine E-Mail versandt werden" #: ../IkiWiki/Plugin/passwordauth.pm:293 msgid "You have been mailed password reset instructions." -msgstr "" +msgstr "Ihnen wurden Anweisungen zum Zurücksetzen des Passworts zugesandt." #: ../IkiWiki/Plugin/passwordauth.pm:328 msgid "incorrect password reset url" -msgstr "" +msgstr "Fehlerhafte URL zum Zurücksetzen des Passworts" #: ../IkiWiki/Plugin/passwordauth.pm:331 msgid "password reset denied" -msgstr "" +msgstr "Zurücksetzen des Passworts verboten" #: ../IkiWiki/Plugin/pingee.pm:30 msgid "Ping received." -msgstr "" +msgstr "Ping empfangen." #: ../IkiWiki/Plugin/pinger.pm:53 msgid "requires 'from' and 'to' parameters" -msgstr "" +msgstr "erfordert die Parameter »from« und »to«" #: ../IkiWiki/Plugin/pinger.pm:58 -#, fuzzy, perl-format +#, perl-format msgid "Will ping %s" -msgstr "bearbeite %s" +msgstr "Werde Ping %s senden" #: ../IkiWiki/Plugin/pinger.pm:61 #, perl-format msgid "Ignoring ping directive for wiki %s (this wiki is %s)" -msgstr "" +msgstr "Ignoriere Ping-Direktiven für Wiki %s (dies ist Wiki %s)" #: ../IkiWiki/Plugin/pinger.pm:77 -#, fuzzy msgid "LWP not found, not pinging" -msgstr "RPC::XML::Client nicht gefunden, pinge nicht" +msgstr "LWP nicht gefunden, führe Ping nicht aus" #: ../IkiWiki/Plugin/poll.pm:69 msgid "vote" @@ -488,9 +486,8 @@ msgid "polygen not installed" msgstr "polygen ist nicht installiert" #: ../IkiWiki/Plugin/polygen.pm:60 -#, fuzzy msgid "command failed" -msgstr "»fortune« fehlgeschlagen" +msgstr "Befehl fehlgeschlagen" #: ../IkiWiki/Plugin/postsparkline.pm:41 msgid "missing formula" @@ -506,11 +503,11 @@ msgstr "unbekannte Formel" #. translators: %A- is the name of the previous day. #: ../IkiWiki/Plugin/prettydate.pm:15 msgid "late %A- night" -msgstr "spät am %A- in der Nacht" +msgstr "%A- spät in der Nacht" #: ../IkiWiki/Plugin/prettydate.pm:17 msgid "in the wee hours of %A- night" -msgstr "in den frühen Morgenstunden %A-" +msgstr "%A- in den frühen Morgenstunden" #: ../IkiWiki/Plugin/prettydate.pm:20 msgid "terribly early %A morning" @@ -562,16 +559,18 @@ msgstr "um Mitternacht" #: ../IkiWiki/Plugin/prettydate.pm:108 msgid "at noon on %A" -msgstr "am Nachmittag des %A" +msgstr "%A am Nachmittag" #: ../IkiWiki/Plugin/progress.pm:34 #, perl-format msgid "illegal percent value %s" -msgstr "" +msgstr "Unzulässiger Prozentwert (%s)" #: ../IkiWiki/Plugin/progress.pm:59 msgid "need either `percent` or `totalpages` and `donepages` parameters" msgstr "" +"Benötige entweder »percent«- oder »totalpages«- und " +"»donepages«-Parameter" #: ../IkiWiki/Plugin/recentchanges.pm:100 msgid "missing page" @@ -580,91 +579,91 @@ msgstr "fehlende Seite" #: ../IkiWiki/Plugin/recentchanges.pm:102 #, perl-format msgid "The page %s does not exist." -msgstr "Die Seite %s exisitiert nicht." +msgstr "Die Seite %s existiert nicht." #: ../IkiWiki/Plugin/recentchangesdiff.pm:36 msgid "(Diff truncated)" -msgstr "" +msgstr "(Diff beschnitten)" #: ../IkiWiki/Plugin/remove.pm:31 ../IkiWiki/Plugin/rename.pm:36 -#, fuzzy, perl-format +#, perl-format msgid "%s does not exist" -msgstr "Die Seite %s exisitiert nicht." +msgstr "%s existiert nicht" #: ../IkiWiki/Plugin/remove.pm:38 -#, fuzzy, perl-format +#, perl-format msgid "%s is not in the srcdir, so it cannot be deleted" -msgstr "%s wurde von %s gesperrt und kann nicht bearbeitet werden" +msgstr "%s ist nicht im Quellverzeichnis und kann deshalb nicht gelöscht werden" #: ../IkiWiki/Plugin/remove.pm:41 ../IkiWiki/Plugin/rename.pm:45 -#, fuzzy, perl-format +#, perl-format msgid "%s is not a file" -msgstr "%s ist keine bearbeitbare Seite" +msgstr "%s ist keine Datei" #: ../IkiWiki/Plugin/remove.pm:115 #, perl-format msgid "confirm removal of %s" -msgstr "" +msgstr "Bestätigen Sie die Entfernung von %s" #: ../IkiWiki/Plugin/remove.pm:152 msgid "Please select the attachments to remove." -msgstr "" +msgstr "Bitte wählen Sie die zu entfernenden Anhänge aus." #: ../IkiWiki/Plugin/remove.pm:192 msgid "removed" -msgstr "" +msgstr "entfernt" #: ../IkiWiki/Plugin/rename.pm:42 #, perl-format msgid "%s is not in the srcdir, so it cannot be renamed" msgstr "" +"%s ist nicht im Quellverzeichnis und kann deshalb nicht umbenannt werden" #: ../IkiWiki/Plugin/rename.pm:62 -#, fuzzy msgid "no change to the file name was specified" -msgstr "Dateiname des Wrappers nicht angegeben" +msgstr "Es wurde keine Änderung des Dateinames angegeben" #: ../IkiWiki/Plugin/rename.pm:68 #, perl-format msgid "illegal name" -msgstr "" +msgstr "unzulässiger Name" #: ../IkiWiki/Plugin/rename.pm:73 #, perl-format msgid "%s already exists" -msgstr "" +msgstr "%s existiert bereits" #: ../IkiWiki/Plugin/rename.pm:79 #, perl-format msgid "%s already exists on disk" -msgstr "" +msgstr "%s existiert bereits auf der Festplatte" #: ../IkiWiki/Plugin/rename.pm:101 -#, fuzzy, perl-format +#, perl-format msgid "rename %s" -msgstr "erzeuge %s" +msgstr "benenne %s um" #: ../IkiWiki/Plugin/rename.pm:138 msgid "Also rename SubPages and attachments" -msgstr "" +msgstr "Auch SubPages und Anhänge umbenennen" #: ../IkiWiki/Plugin/rename.pm:224 msgid "Only one attachment can be renamed at a time." -msgstr "" +msgstr "Es kann immer nur ein Anhang zur Zeit umbenannt werden." #: ../IkiWiki/Plugin/rename.pm:227 msgid "Please select the attachment to rename." -msgstr "" +msgstr "Bitte wählen Sie den umzubenennenden Anhang aus." #: ../IkiWiki/Plugin/rename.pm:338 #, perl-format msgid "rename %s to %s" -msgstr "" +msgstr "Benenne %s in %s um" #: ../IkiWiki/Plugin/rename.pm:490 #, perl-format msgid "update for rename of %s to %s" -msgstr "" +msgstr "Aktualisierung für Umbenennung von %s in %s" #: ../IkiWiki/Plugin/search.pm:36 #, perl-format @@ -674,15 +673,15 @@ msgstr "%s muss angegeben werden, wenn die Sucherweiterung verwandt wird" #: ../IkiWiki/Plugin/search.pm:182 #, perl-format msgid "need Digest::SHA1 to index %s" -msgstr "" +msgstr "Benötige Digest::SHA1, um %s zu indexieren" #: ../IkiWiki/Plugin/search.pm:217 msgid "search" -msgstr "" +msgstr "suchen" #: ../IkiWiki/Plugin/shortcut.pm:28 msgid "shortcut plugin will not work without a shortcuts.mdwn" -msgstr "das »shortcut«-Plugin funktioniert nicht ohne eine »shortcuts.mdwn«" +msgstr "die »shortcut«-Erweiterung funktioniert nicht ohne eine »shortcuts.mdwn«" #: ../IkiWiki/Plugin/shortcut.pm:38 msgid "missing name or url parameter" @@ -698,11 +697,11 @@ msgstr "Shortcut %s zeigt auf %s" #: ../IkiWiki/Plugin/smiley.pm:43 msgid "failed to parse any smileys" -msgstr "Smileys konnten nicht geparst werden" +msgstr "Smileys konnten nicht verarbeitet werden" #: ../IkiWiki/Plugin/sparkline.pm:72 msgid "parse error" -msgstr "Parse-Fehler" +msgstr "Verarbeitungsfehler" #: ../IkiWiki/Plugin/sparkline.pm:78 msgid "bad featurepoint diameter" @@ -751,7 +750,7 @@ msgstr "Direkter Daten-Download" #: ../IkiWiki/Plugin/table.pm:134 #, perl-format msgid "parse fail at line %d: %s" -msgstr "Parse-Fehler in Zeile %d: %s" +msgstr "Verarbeitungsfehler in Zeile %d: %s" #: ../IkiWiki/Plugin/template.pm:28 msgid "missing id parameter" @@ -780,55 +779,59 @@ msgstr "konnte kein Bild aus dem Code erzeugen" #: ../IkiWiki/Plugin/websetup.pm:89 msgid "plugin" -msgstr "" +msgstr "Erweiterung" #: ../IkiWiki/Plugin/websetup.pm:108 #, perl-format msgid "enable %s?" -msgstr "" +msgstr "%s aktivieren?" #: ../IkiWiki/Plugin/websetup.pm:236 msgid "you are not logged in as an admin" -msgstr "" +msgstr "Sie sind nicht als Administrator angemeldet" #: ../IkiWiki/Plugin/websetup.pm:240 msgid "setup file for this wiki is not known" -msgstr "" +msgstr "Die Einrichtungsdatei für dieses Wiki ist unbekannt" #: ../IkiWiki/Plugin/websetup.pm:256 -#, fuzzy msgid "main" -msgstr "Administrator" +msgstr "Hauptseite" #: ../IkiWiki/Plugin/websetup.pm:257 msgid "plugins" -msgstr "" +msgstr "Erweiterungen" #: ../IkiWiki/Plugin/websetup.pm:395 msgid "" "The configuration changes shown below require a wiki rebuild to take effect." msgstr "" +"Die unten aufgeführten Konfigurationsänderungen erfordern eine erneute " +"Erzeugung des Wikis, um aktiv zu werden." #: ../IkiWiki/Plugin/websetup.pm:399 msgid "" "For the configuration changes shown below to fully take effect, you may need " "to rebuild the wiki." msgstr "" +"Damit die unten aufgeführten Konfigurationsänderungen aktiv werden, kann es " +"erforderlich sein, das Wiki neu zu erzeugen." #: ../IkiWiki/Plugin/websetup.pm:433 #, perl-format msgid "

Error: %s exited nonzero (%s)" msgstr "" +"

Fehler: %s beendete sich mit einem Wert ungleich Null (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format msgid "cannot determine id of untrusted committer %s" -msgstr "" +msgstr "Kann ID des nicht vertrauenswürdigen Bearbeiters %s nicht feststellen" #: ../IkiWiki/Receive.pm:85 -#, fuzzy, perl-format +#, perl-format msgid "bad file name %s" -msgstr "überspringe fehlerhaften Dateinamen %s" +msgstr "fehlerhafter Dateiname %s" #: ../IkiWiki/Render.pm:253 #, perl-format @@ -836,6 +839,8 @@ msgid "" "symlink found in srcdir path (%s) -- set allow_symlinks_before_srcdir to " "allow this" msgstr "" +"Symbolischer Verweis im Quellverzeichnis (%s) gefunden -- setzen Sie " +"allow_symlinks_before_srcdir, um dies zu erlauben" #: ../IkiWiki/Render.pm:277 ../IkiWiki/Render.pm:302 #, perl-format @@ -845,7 +850,7 @@ msgstr "überspringe fehlerhaften Dateinamen %s" #: ../IkiWiki/Render.pm:284 #, perl-format msgid "%s has multiple possible source pages" -msgstr "" +msgstr "%s hat mehrere mögliche Quellseiten" #: ../IkiWiki/Render.pm:360 #, perl-format @@ -865,12 +870,12 @@ msgstr "erzeuge %s" #: ../IkiWiki/Render.pm:426 #, perl-format msgid "rendering %s, which links to %s" -msgstr "erzeuge %s, was auf %s verweist" +msgstr "erzeuge %s, die auf %s verweist" #: ../IkiWiki/Render.pm:447 #, perl-format msgid "rendering %s, which depends on %s" -msgstr "erzeuge %s, das von %s abhängt" +msgstr "erzeuge %s, die von %s abhängt" #: ../IkiWiki/Render.pm:486 #, perl-format @@ -897,15 +902,16 @@ msgstr "kann %s nicht lesen: %s" #: ../IkiWiki/Setup/Automator.pm:33 msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" +"Sie müssen einen Wiki-Namen eingeben (der alphanumerische Zeichen enthält)" #: ../IkiWiki/Setup/Automator.pm:67 #, perl-format msgid "unsupported revision control system %s" -msgstr "" +msgstr "Nicht unterstütztes Versionskontrollsystem %s" #: ../IkiWiki/Setup/Automator.pm:83 msgid "failed to set up the repository with ikiwiki-makerepo" -msgstr "" +msgstr "Erstellen des Depots mit ikiwiki-makerepo ist fehlgeschlagen" #: ../IkiWiki/Wrapper.pm:16 #, perl-format @@ -925,13 +931,13 @@ msgstr "Dateiname des Wrappers nicht angegeben" #: ../IkiWiki/Wrapper.pm:79 #, perl-format msgid "failed to write %s: %s" -msgstr "schreiben von %s fehlgeschlagen: %s" +msgstr "Schreiben von %s fehlgeschlagen: %s" #. translators: The parameter is a C filename. #: ../IkiWiki/Wrapper.pm:135 #, perl-format msgid "failed to compile %s" -msgstr "erzeugen von %s fehlgeschlagen" +msgstr "Erzeugen von %s fehlgeschlagen" #. translators: The parameter is a filename. #: ../IkiWiki/Wrapper.pm:155 @@ -945,7 +951,7 @@ msgstr "Benutzung: ikiwiki [Optionen] Quelle Ziel" #: ../ikiwiki.in:14 msgid " ikiwiki --setup configfile" -msgstr "" +msgstr " ikiwiki --setup Konfigurationsdatei " #: ../ikiwiki.in:90 msgid "usage: --set var=value" @@ -953,15 +959,15 @@ msgstr "Benutzung: --set Variable=Wert" #: ../ikiwiki.in:138 msgid "generating wrappers.." -msgstr "erzeuge Wrapper.." +msgstr "erzeuge Wrapper..." #: ../ikiwiki.in:195 msgid "rebuilding wiki.." -msgstr "erzeuge Wiki neu.." +msgstr "erzeuge Wiki neu..." #: ../ikiwiki.in:198 msgid "refreshing wiki.." -msgstr "aktualisiere Wiki.." +msgstr "aktualisiere Wiki..." #: ../IkiWiki.pm:466 msgid "Must specify url to wiki with --url when using --cgi" @@ -971,56 +977,40 @@ msgstr "" #: ../IkiWiki.pm:512 msgid "cannot use multiple rcs plugins" -msgstr "" +msgstr "Kann nicht mehrere Versionskontrollsystem-Erweiterungen verwenden" #: ../IkiWiki.pm:541 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" -msgstr "" +msgstr "Laden der für %s benötigten externen Erweiterung fehlgeschlagen: %s" #: ../IkiWiki.pm:1165 -#, fuzzy, perl-format +#, perl-format msgid "preprocessing loop detected on %s at depth %i" -msgstr "Präprozessorschleife %s auf Seite %s in Tiefe %i erkannt" +msgstr "Präprozessorschleife auf %s in Tiefe %i erkannt" #: ../IkiWiki.pm:1678 msgid "yes" -msgstr "" +msgstr "ja" #: ../auto.setup:16 msgid "What will the wiki be named?" -msgstr "" +msgstr "Wie soll das Wiki heißen?" #: ../auto.setup:16 msgid "wiki" -msgstr "" +msgstr "Wiki" #: ../auto.setup:18 msgid "What revision control system to use?" -msgstr "" +msgstr "Welches Versionskontrollsystem soll verwandt werden?" #: ../auto.setup:20 msgid "What wiki user (or openid) will be wiki admin?" msgstr "" +"Welcher Wiki-Benutzer (oder welche OpenID) soll der Administrator des Wikis " +"sein?" #: ../auto.setup:23 msgid "What is the domain name of the web server?" -msgstr "" - -#~ msgid "processed ok at %s" -#~ msgstr "normal verarbeitet um %s" - -#~ msgid "Your password has been emailed to you." -#~ msgstr "Ihr Passwort wurde Ihnen via E-Mail zugesandt." - -#~ msgid "polygen failed" -#~ msgstr "polygen fehlgeschlagen" - -#~ msgid "cleaning hyperestraier search index" -#~ msgstr "bereinige hyperestraier-Suchindex" - -#~ msgid "updating hyperestraier search index" -#~ msgstr "aktualisiere hyperestraier-Suchindex" - -#~ msgid "(not toggleable in preview mode)" -#~ msgstr "(nicht aus-/einklappbar im Vorschaumodus)" +msgstr "Wie lautet der Domainname des Webservers?" -- cgit v1.2.3 From 9986650ecf64820ab091ccfaf81faf2307ce19ee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Nov 2008 17:40:41 -0800 Subject: response --- doc/setup/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/setup/discussion.mdwn b/doc/setup/discussion.mdwn index ba74c5771..3ec123eb5 100644 --- a/doc/setup/discussion.mdwn +++ b/doc/setup/discussion.mdwn @@ -145,3 +145,7 @@ How do I set up cgi editing? In setup I have: * cgi_wrapper => 'edit.cgi' But I don't get an edit link on my pages? What am I doing wrong? + +> Assuming you don't have the editpage plugin disabled, all you should need +> to so is re-run `ikiwiki -setup` with the above config and it should +> rebuild your wiki and add the edit links to pages. --[[Joey]] -- cgit v1.2.3 From 13d938d3514e929f1c9c7d699908afb1123fd327 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Sat, 29 Nov 2008 09:06:04 -0500 Subject: behaviour of inline with meta-provided times --- .../inline_sort_order_and_meta_date_value.mdwn | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/bugs/inline_sort_order_and_meta_date_value.mdwn diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn new file mode 100644 index 000000000..8aea8d0ac --- /dev/null +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -0,0 +1,28 @@ +I have a directory containing two files. f1 has + + meta date="2008-07-02 14:13:17" + +f2 has + + meta date="2008-07-02 21:04:21" + +They have both been modified recently: + + >>> stat(f1) + (33188, 459250L, 65027L, 1, 1000, 1000, 1686L, 1227967177, 1227966706, 1227966706) + >>> stat(f2) + (33188, 458868L, 65027L, 1, 1000, 1000, 938L, 1227967187, 1227966705, 1227966705) + +Note that f1 is fractionally newer than f2 in terms of ctime and mtime, but f2 is much newer in terms of the meta information. + +Another page includes them both via inline. The inclusion pagespec is not based on date, but on path (and the files are sorted into directories based on their dates) + + inline pages="2008/07/*/*" show=5 + +The resulting page is rendered with f1 above f2, seemingly not using the meta directive information. The italic-footer in the inline pages does use the correct time e.g. Posted Wed 02 Jul 2008 14:13:17 BST. + +If I instead include them using creation_year in the pagespec, they are ordered correctly. + +I'm working on importing a blosxom site into ikiwiki. I'll try and reproduce this online. + +-- [[JonDowland]] -- cgit v1.2.3 From b683c70b44e1e646081793209e3a644662a1e9e2 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Sat, 29 Nov 2008 10:19:26 -0500 Subject: update with examples --- doc/bugs/inline_sort_order_and_meta_date_value.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index 8aea8d0ac..dfb9c6085 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -1,8 +1,8 @@ -I have a directory containing two files. f1 has +I have a directory containing two files. f1 () has meta date="2008-07-02 14:13:17" -f2 has +f2 () has meta date="2008-07-02 21:04:21" @@ -19,10 +19,10 @@ Another page includes them both via inline. The inclusion pagespec is not based inline pages="2008/07/*/*" show=5 -The resulting page is rendered with f1 above f2, seemingly not using the meta directive information. The italic-footer in the inline pages does use the correct time e.g. Posted Wed 02 Jul 2008 14:13:17 BST. +The resulting page is rendered with f1 above f2, seemingly not using the meta directive information: . The footer in the inline pages does use the correct time e.g. Posted Wed 02 Jul 2008 14:13:17 BST. If I instead include them using creation_year in the pagespec, they are ordered correctly. -I'm working on importing a blosxom site into ikiwiki. I'll try and reproduce this online. + contains the src used to reproduce this, the precise ikiwiki invocation (inside Makefile) and the results (dest). -- [[JonDowland]] -- cgit v1.2.3 From e156758766e6b729a3314db503c2e2bb334c31a3 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Sat, 29 Nov 2008 10:24:04 -0500 Subject: simplify example --- doc/bugs/inline_sort_order_and_meta_date_value.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index dfb9c6085..1a88dd514 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -1,8 +1,8 @@ -I have a directory containing two files. f1 () has +I have a directory containing two files. f1 () has meta date="2008-07-02 14:13:17" -f2 () has +f2 () has meta date="2008-07-02 21:04:21" @@ -15,14 +15,14 @@ They have both been modified recently: Note that f1 is fractionally newer than f2 in terms of ctime and mtime, but f2 is much newer in terms of the meta information. -Another page includes them both via inline. The inclusion pagespec is not based on date, but on path (and the files are sorted into directories based on their dates) +Another page includes them both via inline: - inline pages="2008/07/*/*" show=5 + inline pages="blog/*" show=5 -The resulting page is rendered with f1 above f2, seemingly not using the meta directive information: . The footer in the inline pages does use the correct time e.g. Posted Wed 02 Jul 2008 14:13:17 BST. +The resulting page is rendered with f1 above f2, seemingly not using the meta directive information: . The footer in the inline pages does use the correct time e.g. Posted Wed 02 Jul 2008 14:13:17 BST. If I instead include them using creation_year in the pagespec, they are ordered correctly. - contains the src used to reproduce this, the precise ikiwiki invocation (inside Makefile) and the results (dest). + contains the src used to reproduce this, the precise ikiwiki invocation (inside Makefile) and the results (dest). -- [[JonDowland]] -- cgit v1.2.3 From 369f4f86bce31ce82d72d64171dc838c660ca92c Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 1 Dec 2008 15:47:29 +0000 Subject: add note to consider tagbase when trying to match tagged pages --- doc/ikiwiki/directive/tag.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ikiwiki/directive/tag.mdwn b/doc/ikiwiki/directive/tag.mdwn index 267aee660..64736f8cd 100644 --- a/doc/ikiwiki/directive/tag.mdwn +++ b/doc/ikiwiki/directive/tag.mdwn @@ -21,6 +21,10 @@ located under a base directory, such as "tags/". This is a useful way to avoid having to write the full path to tags, if you want to keep them grouped together out of the way. +Bear in mind that specifying a tagbase means you will need to incorporate it +into the `link()` [[ikiwiki/PageSpec]] you use: e.g., if your tagbase is +`tag`, you would match pages tagged "foo" with `link(tag/foo)`. + If you want to override the tagbase for a particular tag, you can use something like this: -- cgit v1.2.3 From 1a0147b6b35ae57db9b0e4f4db49e0af24f77a65 Mon Sep 17 00:00:00 2001 From: Blanko Date: Tue, 2 Dec 2008 08:21:02 -0500 Subject: --- doc/tips/inside_dot_ikiwiki/discussion.mdwn | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/doc/tips/inside_dot_ikiwiki/discussion.mdwn b/doc/tips/inside_dot_ikiwiki/discussion.mdwn index c05e7a3e0..8ff3ad552 100644 --- a/doc/tips/inside_dot_ikiwiki/discussion.mdwn +++ b/doc/tips/inside_dot_ikiwiki/discussion.mdwn @@ -16,3 +16,47 @@ No idea how this happened. I've blown it away and recreated it but, for future >>> --getctime does. --[[Joey]] >> Alas, I seem to have lost the bad index file to periodic /tmp wiping; I'll send it to you if it happens again. --[[sabr]] + + + +## Lost password for an user + +This morning, a person has lost its password. I was able to do something to make another password. This is the way I take : + +### Locate the user database + +As tips show us, the user database is in the source file, for an example : + + src/.ikiwiki/userdb + +### See which user to modify + +Because I don't know the real login of the user, I have to read all the database : + + perl -le 'use Storable; my $index=Storable::retrieve("userdb"); use Data::Dumper; print Dumper $index' + +Then I was able to find this : + + 'Utilisateur' => { + 'email' => 'user@pl.fr', + 'cryptresettoken' => '$2a$10$cfVeOoVbFw9VzMlgEbPMsu34pwHIFP84mWlkrs2RCKknZYPZkPffm', + 'password' => '', + 'resettoken' => '', + 'cryptpassword' => '$2a$10$H8bYq.dlb68wpnfJgVZQhOdsF9JQ06cteRfhPQPB5eHKnD5Y3u7au', + 'regdate' => '1226574052' + }, + +Let's have a look to modify lines. + +### Modify the line + +When you have found the line to modify, take the user name, and change its password to **sc** (for an example) : + + perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); $userinfo->{"Utilisateur"}->{cryptpassword}=q{$2a$10$7viOHCrUkdAVL135Kr6one1mpZQ/FWYC773G1yZ0EtQciI11sSDRS}; Storable::lock_nstore($userinfo, "userdb")' + perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); $userinfo->{"Utilisateur"}->{cryptresettoken}=q{}; Storable::lock_nstore($userinfo, "userdb")' + +Because I don't know how suppress cryptresettoken and resettoken fields, I change their content with *null*. + +After all these modifications, the user *Utilisateur* could connect to its account with the password **sc**, and go to Preferences, then change its password. + + -- cgit v1.2.3 From 4c1848c3a2f1509f6f34fd50c5f5abdfb302b247 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:10 -0500 Subject: rename users/jondowland.mdwn to users/jon.mdwn --- doc/users/jon.mdwn | 13 +++++++++++++ doc/users/jondowland.mdwn | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 doc/users/jon.mdwn delete mode 100644 doc/users/jondowland.mdwn diff --git a/doc/users/jon.mdwn b/doc/users/jon.mdwn new file mode 100644 index 000000000..8bfa3dd76 --- /dev/null +++ b/doc/users/jon.mdwn @@ -0,0 +1,13 @@ +I'm looking at ikiwiki both for my personal site but also as a +team-documentation management system for a small-sized group of UNIX +sysadmins. + +* My [homepage](http://jmtd.net/) is powered by ikiwiki (replacing my [older homepage](http://alcopop.org/), which was a mess of scripts) + +I gave a talk at the [UK UNIX User's Group](http://www.ukuug.org/) annual +[Linux conference](http://www.ukuug.org/events/linux2008/) about organising +system administrator documentation. Roughly a third of this talk was +discussing IkiWiki in some technical detail and suggesting it as a good piece +of software for this task. + + * slides at . diff --git a/doc/users/jondowland.mdwn b/doc/users/jondowland.mdwn deleted file mode 100644 index 8bfa3dd76..000000000 --- a/doc/users/jondowland.mdwn +++ /dev/null @@ -1,13 +0,0 @@ -I'm looking at ikiwiki both for my personal site but also as a -team-documentation management system for a small-sized group of UNIX -sysadmins. - -* My [homepage](http://jmtd.net/) is powered by ikiwiki (replacing my [older homepage](http://alcopop.org/), which was a mess of scripts) - -I gave a talk at the [UK UNIX User's Group](http://www.ukuug.org/) annual -[Linux conference](http://www.ukuug.org/events/linux2008/) about organising -system administrator documentation. Roughly a third of this talk was -discussing IkiWiki in some technical detail and suggesting it as a good piece -of software for this task. - - * slides at . -- cgit v1.2.3 From d3984de8a113a28c7806cdfe82c470a22c20dda4 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:27 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 6e5f1668a..cde761a44 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -11,4 +11,4 @@ there are some variations on the approach that might be useful: Also, some detail on converting mediawiki transclusion to ikiwiki inlines... --- [[JonDowland]] +-- [[users/Jon]] -- cgit v1.2.3 From 157f1842622c0094d1d4625725194feee1b46129 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:28 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/tips/untrusted_git_push/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tips/untrusted_git_push/discussion.mdwn b/doc/tips/untrusted_git_push/discussion.mdwn index e85625a1b..d95c01ecf 100644 --- a/doc/tips/untrusted_git_push/discussion.mdwn +++ b/doc/tips/untrusted_git_push/discussion.mdwn @@ -24,10 +24,10 @@ Note that the user for the commit is 'jon', and the link points at cgi to create users/jon. I was wondering if that is configurable for users pushing via git. It would be nice perhaps to specify it in some way, perhaps via a git-config setting (user.name?). I'm not too familiar with exactly what the -changeset contains. -- [[JonDowland]] +changeset contains. -- [[users/Jon]] > All ikiwiki can do it look at who git has recorded as the author of > the change (and it looks at the username part of the email address). > You can set `user.email` in `.git/config`. --[[Joey]] -> > Ah, excellent. In which case this *should* DTRT... -- [[JonDowland]] +> > Ah, excellent. In which case this *should* DTRT... -- [[users/Jon]] -- cgit v1.2.3 From be3d73335ee3bbb2daf672076006470a505a1cf8 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:29 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/sandbox/castle/discussion/jon_tests_too.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox/castle/discussion/jon_tests_too.mdwn b/doc/sandbox/castle/discussion/jon_tests_too.mdwn index 864f38c0d..bc051b008 100644 --- a/doc/sandbox/castle/discussion/jon_tests_too.mdwn +++ b/doc/sandbox/castle/discussion/jon_tests_too.mdwn @@ -1,3 +1,3 @@ -I recall testing this too, but I'm not sure where the test went. Let's try again. -- [[JonDowland]] +I recall testing this too, but I'm not sure where the test went. Let's try again. -- [[users/Jon]] Context: [[todo/discussion_page_as_blog/discussion/castle]] -- cgit v1.2.3 From 0053777baeba3199bf326768a837ecfae4b91592 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:33 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/bugs/textile_plugin_dies_if_input_has_a_non-utf8_character.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bugs/textile_plugin_dies_if_input_has_a_non-utf8_character.mdwn b/doc/bugs/textile_plugin_dies_if_input_has_a_non-utf8_character.mdwn index 7ec1edc4e..bdd07210e 100644 --- a/doc/bugs/textile_plugin_dies_if_input_has_a_non-utf8_character.mdwn +++ b/doc/bugs/textile_plugin_dies_if_input_has_a_non-utf8_character.mdwn @@ -9,6 +9,6 @@ The first two complaints happen if textile is not loaded, the third fatal one ha 0x92 is "single quote" in the evil windows default codepage. It would be nice to handle this gracefully and not abort ikiwiki at this point, or alternatively, die fatally but mention which input page caused the error. -Interestingly enough, in my case, the input file has several other bad windows characters (0xFC, u-umlaut) which have not caused ikiwiki to abort. ikiwiki version 2.50. -- [[JonDowland]] +Interestingly enough, in my case, the input file has several other bad windows characters (0xFC, u-umlaut) which have not caused ikiwiki to abort. ikiwiki version 2.50. -- [[users/Jon]] > Fixed in git. [[done]] --[[Joey]] -- cgit v1.2.3 From e7594b33eba69099e9143076f5692cc02f9ca782 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:35 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/todo/clear_page_to_delete.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/todo/clear_page_to_delete.mdwn b/doc/todo/clear_page_to_delete.mdwn index 50ae246bb..6bab6ef27 100644 --- a/doc/todo/clear_page_to_delete.mdwn +++ b/doc/todo/clear_page_to_delete.mdwn @@ -4,7 +4,7 @@ cleared to be entirely empty (or only have whitespace)? Discuss. --[[Joey]] I'd say so; yes. A method of deleting pages via the web would be great; I can't think of a use of keeping blank pages around. What about vandalism -- if someone blanks a page and deletes it and someone else wishes to restore -it; or is undoing edits via the web a bigger issue? -- [[JonDowland]] +it; or is undoing edits via the web a bigger issue? -- [[users/Jon]] Of course there's already a way to delete pages (remove plugin). So the question is really: @@ -30,4 +30,4 @@ keyword and if there were no page editions since XX days. Here, I use pages that can be empty everyday and filled all day long. It does not make sense to me to delete these pages :). --[[xma]] -I was not aware of [[plugins/remove]]. I don't think another method is necessary -- [[JonDowland]] +I was not aware of [[plugins/remove]]. I don't think another method is necessary -- [[users/Jon]] -- cgit v1.2.3 From 3cf1e3931d6a486dc25d83496c5d88e7760f86f5 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:36 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/tips/vim_syntax_highlighting/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tips/vim_syntax_highlighting/discussion.mdwn b/doc/tips/vim_syntax_highlighting/discussion.mdwn index 038854b9f..72cb52aab 100644 --- a/doc/tips/vim_syntax_highlighting/discussion.mdwn +++ b/doc/tips/vim_syntax_highlighting/discussion.mdwn @@ -1,4 +1,4 @@ -I'm going to look at merging this with potwiki.vim (a vim-based personal wiki) so that you can follow wiki-links and auto-create pages etc., direct from vim. (I'm writing this incase I don't get around to it) -- [[JonDowland]] +I'm going to look at merging this with potwiki.vim (a vim-based personal wiki) so that you can follow wiki-links and auto-create pages etc., direct from vim. (I'm writing this incase I don't get around to it) -- [[users/Jon]] ---- -- cgit v1.2.3 From 1d55c73d419666b2c936f517ef14ab2262ba8a4f Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:38 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/news/openid/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/news/openid/discussion.mdwn b/doc/news/openid/discussion.mdwn index 3d5e9dc22..aa9f3f0be 100644 --- a/doc/news/openid/discussion.mdwn +++ b/doc/news/openid/discussion.mdwn @@ -42,7 +42,7 @@ only Apache/iptables rules for this? Maybe it's related to > Error: /srv/web/ikiwiki.info/todo/Configurable_minimum_length_of_log_message_for_web_edits/index.html independently created, not overwriting with version from todo/Configurable_minimum_length_of_log_message_for_web_edits -[[jondowland]] +[[users/jon]] ---- -- cgit v1.2.3 From c4634dfc92485833ca5b2d36c667c7ee6f24f036 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:39 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/todo/source_link.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/source_link.mdwn b/doc/todo/source_link.mdwn index 93791c81a..5d6cb89e8 100644 --- a/doc/todo/source_link.mdwn +++ b/doc/todo/source_link.mdwn @@ -1,6 +1,6 @@ How about a direct link from the page header to the source of the latest version, to avoid the need to either use edit or navigate to the current version via the history link? - I'd like this too (and might try to implement it). -- [[jondowland]] + I'd like this too (and might try to implement it). -- [[users/jon]] I just implemented this. There is one [[patch]] to the default page template, and a new plugin. -- [[Will]] -- cgit v1.2.3 From 391952f3a070a96a15eae844cd2a3a50f4a485dd Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:40 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/bugs/inline_sort_order_and_meta_date_value.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index 1a88dd514..e8befe8d5 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -25,4 +25,4 @@ If I instead include them using creation_year in the pagespec, they are ordered contains the src used to reproduce this, the precise ikiwiki invocation (inside Makefile) and the results (dest). --- [[JonDowland]] +-- [[users/Jon]] -- cgit v1.2.3 From be3281256baf90130f3ee06faa8bd91ccd7e896b Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:41 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/bugs/Spaces_in_link_text_for_ikiwiki_links.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bugs/Spaces_in_link_text_for_ikiwiki_links.mdwn b/doc/bugs/Spaces_in_link_text_for_ikiwiki_links.mdwn index f6dbacad7..8aea5cd29 100644 --- a/doc/bugs/Spaces_in_link_text_for_ikiwiki_links.mdwn +++ b/doc/bugs/Spaces_in_link_text_for_ikiwiki_links.mdwn @@ -44,7 +44,7 @@ reported in [[index/discussion#index11h1]]. >> >> If there was ever a future, syntax-breaking major release of ikiwiki >> (similar to python3000) I'd like to see this fixed as part of that. ->> --[[JonDowland]] +>> --[[users/Jon]] >>> You can enable `prefix_directives` and get the disambiguated behavior >>> and spaces in wikilinks today. It will become the default in 3.0. -- cgit v1.2.3 From cd16615a23dc2e1ee22c760210f7065acd7eb1a1 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:42 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/install/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/install/discussion.mdwn b/doc/install/discussion.mdwn index 2b88f6e66..b5757070f 100644 --- a/doc/install/discussion.mdwn +++ b/doc/install/discussion.mdwn @@ -172,9 +172,9 @@ Not sure how to provide proper version information for you.--[[vibrog]] --- -I've tried a couple of times and my cpan has never recognised Bundle::IkiWiki. Is that section of the page still accurate? -- [[JonDowland]] +I've tried a couple of times and my cpan has never recognised Bundle::IkiWiki. Is that section of the page still accurate? -- [[users/Jon]] > Are you running perl with the environemnt settings specified on the page? > Can you show how it fails to find the bundle? --[[Joey]] ->> I was not. Next time I build I will have to try that (I'll need to tweak it as I already override PERL5LIB; also I need to specify http proxies). Thanks for your help! -- [[JonDowland]] +>> I was not. Next time I build I will have to try that (I'll need to tweak it as I already override PERL5LIB; also I need to specify http proxies). Thanks for your help! -- [[users/Jon]] -- cgit v1.2.3 From 1d0f30dab0d8490fa5373b9cd73ee5c48fa0a9e4 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:43 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/forum/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/forum/discussion.mdwn b/doc/forum/discussion.mdwn index 1e55d3f57..93cf4656e 100644 --- a/doc/forum/discussion.mdwn +++ b/doc/forum/discussion.mdwn @@ -1,4 +1,4 @@ -I like the idea of this forum heirarchy -- but I think a map would be clearer than inlining the sub-pages. -- [[JonDowland]] +I like the idea of this forum heirarchy -- but I think a map would be clearer than inlining the sub-pages. -- [[users/Jon]] > The easier way to accomplish this is to set archive=yes in the inline. > Switching to archive view can be useful when there are a lot of long -- cgit v1.2.3 From 570eeb65813ee4424276bcf68906366634183fd9 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:44 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/bugs/markdown_bug:_email_escaping_and_plus_addresses.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bugs/markdown_bug:_email_escaping_and_plus_addresses.mdwn b/doc/bugs/markdown_bug:_email_escaping_and_plus_addresses.mdwn index 5c04dce03..6fccc5c86 100644 --- a/doc/bugs/markdown_bug:_email_escaping_and_plus_addresses.mdwn +++ b/doc/bugs/markdown_bug:_email_escaping_and_plus_addresses.mdwn @@ -8,7 +8,7 @@ compare: It seems putting a '+' in there throws it. Maybe it's a markdown bug, or maybe the obfuscation markdown applies to email-links is being caught by the HTML sanitizer. - -- [[JonDowland]] + -- [[users/Jon]] > It's a markdown bug. For some reason, markdown doesn't recognize the email with a '+' as an email: > -- cgit v1.2.3 From e2244e67236a53a4ed5aba83b33c53e35ebc5efd Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:46 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/ikiwikiusers.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 7d8e41826..263e8583a 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -101,7 +101,7 @@ Personal sites and blogs * [Olivier Berger's professional homepage](http://www-public.it-sudparis.eu/~berger_o/) * [Andrey Tarantsov's homepage](http://www.tarantsov.com/) * [Don Marti's blog](http://zgp.org/~dmarti/) -* [[JonDowland]]'s [homepage](http://jmtd.net/) +* [[users/Jon]]'s [homepage](http://jmtd.net/) * [[xma]] is using ikiwiki () * [[JanWalzer|jwalzer]]'s [homepage](http://wa.lzer.net/) -- Work in Progress * [[Adam_Trickett|ajt]]'s home intranet/sanbox system ([Internet site & blog](http://www.iredale.net/) -- not ikiwiki yet) -- cgit v1.2.3 From b8fb77b093e2496979b94b3e2b5099e7768cc40c Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:47 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- doc/plugins/write/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/write/discussion.mdwn b/doc/plugins/write/discussion.mdwn index 9a36d7b0b..24a556ffe 100644 --- a/doc/plugins/write/discussion.mdwn +++ b/doc/plugins/write/discussion.mdwn @@ -43,4 +43,4 @@ distributed wiki. --- -I would find this page clearer split up into sub-pages. Does anyone agree/disagree? -- [[JonDowland]] +I would find this page clearer split up into sub-pages. Does anyone agree/disagree? -- [[users/Jon]] -- cgit v1.2.3 From fbdbf9eeefffa5fec0bf0a343800bd271409f2e8 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:00:48 -0500 Subject: update for rename of users/jondowland.mdwn to users/jon.mdwn --- ...ugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn b/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn index c835d9f98..21eb61df1 100644 --- a/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn +++ b/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn @@ -1,4 +1,4 @@ -[[plugins/lockedit]] adds the form fields for a [[pagespec]] to preferences. This pagespec should be supplied "raw"; i.e., without quotes around it. Inexperienced users (such as [[myself|jondowland]]) may provide an invalid pagespec, such as one with quotes on it. This will be merrily accepted by the form, but will cause no locking to take place. +[[plugins/lockedit]] adds the form fields for a [[pagespec]] to preferences. This pagespec should be supplied "raw"; i.e., without quotes around it. Inexperienced users (such as [[myself|users/jon]]) may provide an invalid pagespec, such as one with quotes on it. This will be merrily accepted by the form, but will cause no locking to take place. Perhaps some validation should be performed on the pagespec and the form-submission return include "warning: this pagespec is invalid" or "warning: this pagespec does not match any existing pages" or similar. -- cgit v1.2.3 From 6e9ec937fadd1b12d13f2fb4a5c7fea20ab4bb13 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 2 Dec 2008 15:02:24 +0000 Subject: u32.net disappeared --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index cde761a44..0a332f8ba 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -12,3 +12,6 @@ there are some variations on the approach that might be useful: Also, some detail on converting mediawiki transclusion to ikiwiki inlines... -- [[users/Jon]] + +> "Who knows, the remote site might disappear.". Right now, it appears to +> have done just that. -- [[users/Jon]] -- cgit v1.2.3 From 6683a1d76ee95e2686b8ac5f905a823169f5367e Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:07:59 -0500 Subject: rename plugin should expand full path of affected pages --- ...name_should_list_the_full_path_to_affected_pages.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn diff --git a/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn b/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn new file mode 100644 index 000000000..31008cb4c --- /dev/null +++ b/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn @@ -0,0 +1,16 @@ +I've just renamed a page and received the following as a result: + +---- + +

+Successfully renamed users/jondowland.mdwn to users/jon.mdwn. +

+

+ +The following pages have been automatically modified to update their links to users/jon.mdwn: +

... + +---- + +In this situation I think the link to pages should be expanded to show the entire path, since there is quite likely to be a lot of things like "discussion". -- [[users/Jon]] -- cgit v1.2.3 From 0da57d28de59b74ddcd8d0f2e97efc64592d0a61 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 2 Dec 2008 15:08:00 +0000 Subject: mark this bug as done --- ...in_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn b/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn index 21eb61df1..b8023ce87 100644 --- a/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn +++ b/doc/bugs/lockedit_plugin_should_alert_user_about_an_invalid_pagespec_in_preferences.mdwn @@ -15,3 +15,7 @@ Perhaps some validation should be performed on the pagespec and the form-submiss > There are small classes of invalid pagespecs. For example, `(foo or bar` > is invalid due to having unbalanced parens, while `foo or and bar` > has invalid syntax. It's possible to detect these, I guess ... --[[Joey]] + +>> Having moved it to the .setup file makes things more obvious I think. +>> Anyway I consider this [[done]], please de-done this if you disagree. +>> --[[Jon]] -- cgit v1.2.3 From 9e5f5a661e72be74094dac520f4871c2b4e13449 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 2 Dec 2008 15:12:13 +0000 Subject: remove hoz-rule from bug, for clarity --- ...successful_rename_should_list_the_full_path_to_affected_pages.mdwn | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn b/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn index 31008cb4c..2d9677e7f 100644 --- a/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn +++ b/doc/bugs/output_of_successful_rename_should_list_the_full_path_to_affected_pages.mdwn @@ -1,7 +1,5 @@ I've just renamed a page and received the following as a result: ----- -

Successfully renamed users/jondowland.mdwn to users/jon.mdwn.

@@ -11,6 +9,4 @@ The following pages have been automatically modified to update their links to us ... ----- - In this situation I think the link to pages should be expanded to show the entire path, since there is quite likely to be a lot of things like "discussion". -- [[users/Jon]] -- cgit v1.2.3 From 6edf1126d7c104b9eee3ea60e05fba47a53d0f71 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 10:25:44 -0500 Subject: provide for ignoring h1s etc. in toc --- ...gin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn diff --git a/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn new file mode 100644 index 000000000..547c7a80a --- /dev/null +++ b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn @@ -0,0 +1,3 @@ +It would be nice if the [[plugins/toc]] plugin let you specify a header level "ceiling" above which (or above and including which) the headers would not be incorporated into the toc. + +Currently, the levels=X parameter lets you tweak how deep it will go for small headers, but I'd like to chop off the h1's (as I use them for my page title) -- [[Jon]] -- cgit v1.2.3 From 0d27e0e329a607a2a97306efc14d4a3cc6d194e3 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 2 Dec 2008 15:25:44 +0000 Subject: my edits... --- doc/users/jon.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/users/jon.mdwn b/doc/users/jon.mdwn index 8bfa3dd76..1d06940fe 100644 --- a/doc/users/jon.mdwn +++ b/doc/users/jon.mdwn @@ -2,6 +2,8 @@ I'm looking at ikiwiki both for my personal site but also as a team-documentation management system for a small-sized group of UNIX sysadmins. +* my edits should appear either as 'Jon' (if I've used + [[tips/untrusted git push]]) or 'alcopop.org/me/openid/'. * My [homepage](http://jmtd.net/) is powered by ikiwiki (replacing my [older homepage](http://alcopop.org/), which was a mess of scripts) I gave a talk at the [UK UNIX User's Group](http://www.ukuug.org/) annual -- cgit v1.2.3 From fa72896cdc1c638095d25c8526107b0f07498282 Mon Sep 17 00:00:00 2001 From: "http://alcopop.org/me/openid/" Date: Tue, 2 Dec 2008 17:18:43 -0500 Subject: correct wikilink --- doc/users/jon.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/jon.mdwn b/doc/users/jon.mdwn index 1d06940fe..72f04e593 100644 --- a/doc/users/jon.mdwn +++ b/doc/users/jon.mdwn @@ -3,7 +3,7 @@ team-documentation management system for a small-sized group of UNIX sysadmins. * my edits should appear either as 'Jon' (if I've used - [[tips/untrusted git push]]) or 'alcopop.org/me/openid/'. + [[tips/untrusted_git_push]]) or 'alcopop.org/me/openid/'. * My [homepage](http://jmtd.net/) is powered by ikiwiki (replacing my [older homepage](http://alcopop.org/), which was a mess of scripts) I gave a talk at the [UK UNIX User's Group](http://www.ukuug.org/) annual -- cgit v1.2.3 From fa130859dc6d2f6912b68d353f68d330893d014b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 3 Dec 2008 15:37:48 -0500 Subject: response --- doc/tips/inside_dot_ikiwiki/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/tips/inside_dot_ikiwiki/discussion.mdwn b/doc/tips/inside_dot_ikiwiki/discussion.mdwn index 8ff3ad552..34d5b9252 100644 --- a/doc/tips/inside_dot_ikiwiki/discussion.mdwn +++ b/doc/tips/inside_dot_ikiwiki/discussion.mdwn @@ -23,6 +23,9 @@ No idea how this happened. I've blown it away and recreated it but, for future This morning, a person has lost its password. I was able to do something to make another password. This is the way I take : +> You can certianly do that, but do note that ikiwiki will offer to mail a +> user a password reset link if they lost their password. --[[Joey]] + ### Locate the user database As tips show us, the user database is in the source file, for an example : -- cgit v1.2.3 From 0ea00036db93e696c6b4fd58afbfd67d4c020c46 Mon Sep 17 00:00:00 2001 From: o Date: Thu, 4 Dec 2008 15:34:12 -0500 Subject: --- doc/examples/blog/posts/oh.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/examples/blog/posts/oh.mdwn diff --git a/doc/examples/blog/posts/oh.mdwn b/doc/examples/blog/posts/oh.mdwn new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/doc/examples/blog/posts/oh.mdwn @@ -0,0 +1 @@ +test -- cgit v1.2.3 From 1c9881cf89e47e58ec99638aea421ca5e4e5b986 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 Dec 2008 16:23:41 -0500 Subject: remove clutter in example blog --- doc/examples/blog/posts/oh.mdwn | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/examples/blog/posts/oh.mdwn diff --git a/doc/examples/blog/posts/oh.mdwn b/doc/examples/blog/posts/oh.mdwn deleted file mode 100644 index 9daeafb98..000000000 --- a/doc/examples/blog/posts/oh.mdwn +++ /dev/null @@ -1 +0,0 @@ -test -- cgit v1.2.3 From 1506638f15797cc13155abfd8adb6ee34c0697bd Mon Sep 17 00:00:00 2001 From: buo Date: Fri, 5 Dec 2008 14:27:29 -0500 Subject: Add command line to install perl modules in ubuntu 8.10 --- doc/install.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/install.mdwn b/doc/install.mdwn index d745737aa..4d4bd08ec 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -28,6 +28,12 @@ on Fedora 7: perl-XML-Simple perl-TimeDate perl-HTML-Template perl-CGI-FormBuilder \ perl-CGI-Session perl-File-MimeInfo perl-gettext perl-Authen-Passphrase +And in Ubuntu Intrepid: + + apt-get install libtext-markdown-perl libhtml-scrubber-perl libxml-simple-perl \ + libtimedate-perl libhtml-template-perl libcgi-formbuilder-perl libcgi-session-perl \ + libfile-mimeinfo-perl liblocale-gettext-perl libauthen-passphrase-perl + ### Installing dependencies by hand If you want to install by hand from the tarball, you should make sure that -- cgit v1.2.3 From e6e8d906d13313a34320c3de20254077e4f25a97 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 7 Dec 2008 13:45:50 -0500 Subject: remove ubuntu instructions, which don't belong here 1. apt-get is not yum 2. installing ikiwiki by hand is not the correct thing to do on ubuntu, so this page should not mention ubuntu Also remove instructions for installing deps via yum, now that there is a ikiwiki package in fedora. --- doc/install.mdwn | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/doc/install.mdwn b/doc/install.mdwn index 4d4bd08ec..cc3a4c29f 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -19,21 +19,6 @@ they are available. Various [[plugins]] use other perl modules and utilities; see their individual documentation for details. -### Installing dependencies with yum - -Here's an example of how to install ikiwiki's dependencies using yum -on Fedora 7: - - yum install perl-Text-Markdown perl-Mail-Sendmail perl-HTML-Scrubber \ - perl-XML-Simple perl-TimeDate perl-HTML-Template perl-CGI-FormBuilder \ - perl-CGI-Session perl-File-MimeInfo perl-gettext perl-Authen-Passphrase - -And in Ubuntu Intrepid: - - apt-get install libtext-markdown-perl libhtml-scrubber-perl libxml-simple-perl \ - libtimedate-perl libhtml-template-perl libcgi-formbuilder-perl libcgi-session-perl \ - libfile-mimeinfo-perl liblocale-gettext-perl libauthen-passphrase-perl - ### Installing dependencies by hand If you want to install by hand from the tarball, you should make sure that -- cgit v1.2.3 From 28ddf3280f502bedb2da387dc00b2e0de34df166 Mon Sep 17 00:00:00 2001 From: "http://www.iredale.net/b/" Date: Sun, 7 Dec 2008 17:57:49 -0500 Subject: --- doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn index dfeacbabd..3b9f6c0fd 100644 --- a/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn +++ b/doc/todo/replace_HTML::Template_with_Template_Toolkit.mdwn @@ -54,3 +54,5 @@ the templates. I'd prefer not having to touch Perl though... ----- Yes, Template::Toolkit is very powerful. But I think it's somehow overkill for a wiki. HTML::Template can keep things simple, though. --[weakish](http://weakish.int.eu.org/blog/) + +I'd have to agree that Template::Toolkit is overkill and personally I'm not a fan, but it is very popular (there is even a book) and the new version (3) is alleged to be much more nimble than current version. --[[ajt]] -- cgit v1.2.3 From a6b9fadc9a06b669e367dcde5f9d52570efa245e Mon Sep 17 00:00:00 2001 From: "http://john.choffee.co.uk/" Date: Tue, 9 Dec 2008 08:27:59 -0500 Subject: Fixed the pagespec link --- doc/plugins/htmlscrubber.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/htmlscrubber.mdwn b/doc/plugins/htmlscrubber.mdwn index 7db372e1b..b9f7e6d22 100644 --- a/doc/plugins/htmlscrubber.mdwn +++ b/doc/plugins/htmlscrubber.mdwn @@ -32,7 +32,7 @@ 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 [[PageSpec]], such as "!*/Discussion", and pages +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. -- cgit v1.2.3 From 570eedd7f4faa08cdf78597a8825a6ca704f978f Mon Sep 17 00:00:00 2001 From: "http://beza1e1.tuxen.de/" Date: Tue, 9 Dec 2008 16:58:15 -0500 Subject: Arch Linux packaged --- doc/download.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/download.mdwn b/doc/download.mdwn index 86ddb46b2..1099045b5 100644 --- a/doc/download.mdwn +++ b/doc/download.mdwn @@ -40,6 +40,8 @@ Gentoo has an [ebuild](http://bugs.gentoo.org/show_bug.cgi?id=144453) in its bug IkiWiki can be installed [from macports](http://www.macports.org/ports.php?by=name&substr=ikiwiki) by running `sudo port install ikiwiki`. +A [PKGBUILD for Arch Linux](http://aur.archlinux.org/packages.php?ID=12284) is in the AUR. + ## revision control Ikiwiki is developed in a [[git_repository|git]]. -- cgit v1.2.3 From d6b87bd25ec6f466c6d3c486b4e923377ad8ee2a Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 10 Dec 2008 21:44:50 -0500 Subject: Update with today's changes --- doc/plugins/contrib/comments.mdwn | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index ef067f4d0..a7a509ebb 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -34,10 +34,28 @@ There are some global options for the setup file: directives * `comments_commit`: if true (default true), comments will be committed to the version control system +* `comments_allowauthor`: if true (default false), anonymous commenters may specify a + name for themselves, and the \[[!meta author]] and \[[!meta authorurl]] directives + will not be overridden by the comments plugin + +Templates that will display comments (by default that means `comments_display.tmpl`) +can use the following additional ``s: + +* `COMMENTUSER`: the authenticated/verified user name, or undefined if the user was not signed in +* `COMMENTIP`: the remote IP address, or undefined if not known (this is not currently recorded + for users who are signed in, who are assumed to be vaguely accountable) +* `COMMENTAUTHOR`: a "prettier" version of the authenticated/verified user name (e.g. OpenIDs are + formatted the same way as in [[RecentChanges]]), or the result of localizing "Anonymous" if the + user was not signed in +* `COMMENTAUTHORURL`: if the user was signed in with an OpenID, that URL; if the user was signed + in with some other username, a CGI URL that redirects to their user page (if any) + +This plugin also adds a `\[[!comment]]` directive which is used when storing comments. This +directive shouldn't be used on pages that are edited in the usual way. This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the -`postcomment` branch). A demo wiki with the plugin enabled is running at +`comments-rebase1` branch). A demo wiki with the plugin enabled is running at . Known issues: @@ -47,21 +65,19 @@ Known issues: * There is some common code cargo-culted from other plugins (notably inline and editpage) which should probably be shared * Joey doesn't think it should necessarily use internal pages (see [[discussion]]) +* `\[[!comment]]` should perhaps be `\[[!_comment]], or a special filter/htmlize hook rather + than being a directive at all > I haven't done a detailed code review, but I will say I'm pleased you > avoided re-implementing inline! --[[Joey]] -Wishlist: - -* tbm would like anonymous people to be able to enter their name and possibly email - address -* smcv would like an indication of who you're posting as / the ability to log in - as someone else (even if anonymous comments are allowed, it'd be nice to be - able to choose to log in with a username or OpenID, like in Livejournal); - perhaps editpage needs this too - Fixed issues: * Joey didn't think the `\[[!comments]]` directive was appropriate; comments now appear on pages selected with a [[ikiwiki/pagespec]] * Joey thought that raw HTML should always be allowed; it now is +* tbm wanted anonymous people to be able to enter their name and possibly email + address; a name and website can now be supplied +* There is now an indication of who you're signed in as +* Each comment is now one big \[[!comment]] directive invocation, avoiding previous + issues with unambiguous and un-spoofable metadata -- cgit v1.2.3 From 59c29b532e5bb728cd7c6fa62642cdeeef369ad7 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 10 Dec 2008 21:50:15 -0500 Subject: multiple formats now supported --- doc/plugins/contrib/comments/discussion.mdwn | 32 ++++++++++------------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/doc/plugins/contrib/comments/discussion.mdwn b/doc/plugins/contrib/comments/discussion.mdwn index a054dd55d..59740ec37 100644 --- a/doc/plugins/contrib/comments/discussion.mdwn +++ b/doc/plugins/contrib/comments/discussion.mdwn @@ -1,7 +1,7 @@ ## Why internal pages? (unresolved) Comments are saved as internal pages, so they can never be edited through the CGI, -only by direct committers. Currently, comments are always in [[ikiwiki/markdown]]. +only by direct committers. > So, why do it this way, instead of using regular wiki pages in a > namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to @@ -36,25 +36,13 @@ only by direct committers. Currently, comments are always in [[ikiwiki/markdown] >>> (I've now implemented this in my branch. --[[smcv]]) >> The best reason to keep the pages internal seems to me to be that you ->> don't want the overhead of every comment spawning its own wiki page. ->> The worst problem with it though is that you have to assume the pages ->> are mdwn (or `default_pageext`) and not support other formats. --[[Joey]] - ->>> Well, you could always have `comment1._mdwn`, `comment2._creole` etc. and ->>> alter the htmlize logic so that the `mdwn` hook is called for both `mdwn` ->>> and `_mdwn` (assuming this is not already the case). I'm not convinced ->>> that multi-format comments are a killer feature, though - part of the point ->>> of this plugin, in my mind, is that it's less flexible than the full power ->>> of ikiwiki and gives users fewer options. This could be construed ->>> to be a feature, for people who don't care how flexible the technology is ->>> and just want a simple way to leave a comment. The FormattingHelp page ->>> assumes you're writing 100% Markdown in any case... ->>> ->>> Internal pages do too many things, perhaps: they suppress generation of ->>> HTML pages, they disable editing over the web, and they have a different ->>> namespace of htmlize hooks. I think the first two of those are useful ->>> for this plugin, and the last is harmless; you seem to think the first ->>> is useful, and the other two are harmful. --[[smcv]] +>> don't want the overhead of every comment spawning its own wiki page. --[[Joey]] + +## Formats (resolved) + +The plugin now allows multiple comment formats while still using internal +pages; each comment is saved as a page containing one `\[[!comment]]` directive, +which has a superset of the functionality of [[ikiwiki/directives/format]]. ## Access control (unresolved?) @@ -85,7 +73,9 @@ spam problems. So, use `check_canedit` as at least a first-level check? > create the page before we actually know what page name we're going to use - when > posting the comment I just increment a number until I reach an unused one - so > either the code needs restructuring, or the permission check for 'create' would -> always be for 'comment1' and never 'comment123'. +> always be for 'comment1' and never 'comment123'. --[[smcv]] + +>> Now resolved, in fact --[[smcv]] > Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`. > However, this makes the "comments can only be created, not edited" feature completely -- cgit v1.2.3 From 52bd18aafc0410c6da04d2e893d61cce3d9449f4 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Wed, 10 Dec 2008 22:12:11 -0500 Subject: Link to sandbox on my demo of the plugin --- doc/plugins/contrib/comments.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index a7a509ebb..5a7aa7d16 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -56,7 +56,9 @@ directive shouldn't be used on pages that are edited in the usual way. This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]", and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the `comments-rebase1` branch). A demo wiki with the plugin enabled is running at -. +; the +[sandbox page](http://www.pseudorandom.co.uk/2008/ikiwiki/demo/sandbox/#comments) has some +examples of comments. Known issues: -- cgit v1.2.3 From 120e7553e3781b90543c480abc4f73526cba6ec2 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 11 Dec 2008 05:59:24 -0500 Subject: suggest a feature that would improve the comments plugin --- doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn diff --git a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn new file mode 100644 index 000000000..2373181d6 --- /dev/null +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -0,0 +1,9 @@ +If RSS and Atom are enabled by default, the [[plugins/contrib/comments]] plugin generates a feed, perhaps `/sandbox/index.atom` for comments on the sandbox. If a blog is added to the page, the blog will steal the name `/sandbox/index.atom` and the comments plugin's feed will change to `/sandbox/index.atom2`. + +If `\[[!inline]]` gained a parameter `feedname` or something, the comments plugin could use `feedname=comments` to produce `/sandbox/comments.atom` instead (this would just require minor enhancements to rsspage(), atompage() and targetpage()). + +As a side benefit, [my blog](http://smcv.pseudorandom.co.uk/) could go back to its historical Atom feed URL of `.../feed.atom` (which is currently a symlink to `index.atom` :-) ) + +On sites not using `usedirs` the current feed is `/sandbox.atom`, and we could perhaps change it to `/sandbox-comments.atom` or `/sandbox/comments.atom` if `feedname=comments` is given. + +--[[smcv]] -- cgit v1.2.3 From ec0dff43ce3af3011cb86373b7ad87a3931e4784 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 11 Dec 2008 06:02:49 -0500 Subject: suggest another feature for the comments plugin's benefit --- doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn diff --git a/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn new file mode 100644 index 000000000..f998d5654 --- /dev/null +++ b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn @@ -0,0 +1,4 @@ + < joeyh> 03:49:19> also, I think it may be less visually confusing to + drop the rss/atom buttons for comments when there are none yet + +This seems to me like something that applies to the [[plugins/inline]] plugin in general, rather than the [[plugins/contrib/comments]] plugin specifically. --[[smcv]] -- cgit v1.2.3 From 50ae0dcd8c167b20a7b3eab46f60439ad07f0642 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Thu, 11 Dec 2008 06:07:37 -0500 Subject: some issues joeyh reported on IRC --- doc/plugins/contrib/comments.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn index 5a7aa7d16..a832c571a 100644 --- a/doc/plugins/contrib/comments.mdwn +++ b/doc/plugins/contrib/comments.mdwn @@ -67,8 +67,11 @@ Known issues: * There is some common code cargo-culted from other plugins (notably inline and editpage) which should probably be shared * Joey doesn't think it should necessarily use internal pages (see [[discussion]]) -* `\[[!comment]]` should perhaps be `\[[!_comment]], or a special filter/htmlize hook rather +* `\[[!comment]]` should perhaps be `\[[!_comment]]`, or a special filter/htmlize hook rather than being a directive at all +* Previews always say "unknown IP address" +* [[todo/inline_plugin:_ability_to_override_the_feed_name]] +* [[todo/inline_plugin:_hide_feed_buttons_if_empty]] > I haven't done a detailed code review, but I will say I'm pleased you > avoided re-implementing inline! --[[Joey]] -- cgit v1.2.3 From d135bd3f983fce11468037792b696cc32316023a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:27:50 -0500 Subject: add gitremotes script, parsing list of remotes on doc/git.mdwn Any remotes added will automatically be pulled into my working copy. --- doc/git.mdwn | 26 +++++++++++++++++++------- gitremotes | 29 +++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 7 deletions(-) create mode 100755 gitremotes diff --git a/doc/git.mdwn b/doc/git.mdwn index e7f47f5a0..00c108616 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -16,17 +16,29 @@ Or like this if your firewall only passes http traffic (slow): The gitweb is [here](http://git.ikiwiki.info/?p=ikiwiki). -There is also a mirror [on github](http://github.com/joeyh/ikiwiki/tree/master). - Commits to this git repository are fed into [CIA](http://cia.vc), and can be browsed, subscribed to etc on its [project page](http://cia.vc/stats/project/ikiwiki). They're also fed into [twitter](http://twitter.com/ikiwiki). -## branches +## personal git repositories You are of course free to set up your own ikiwiki git repository with your -own [[patches|patch]]. +own [[patches|patch]]. If you list it here, the `gitremotes` script will +automatically add it to git remotes. Your repo will automatically be pulled +into [[Joey]]'s working tree. This is recommended. :-) + +# Machine-parsed format: * wikilink + +* [[github]] + [browse](http://github.com/joeyh/ikiwiki/tree/master) + A mirror of the main repo, automatically updated. +* [[smcv]] +* [[intrigeri]] +* [[gmcmanus]] +* [[jelmer]] + +## branches Some of the branches included in the main repository include: @@ -38,9 +50,9 @@ Some of the branches included in the main repository include: * `wikiwyg` adds [[todo/wikiwyg]] support. It is unmerged pending some changes. * `darcs` is being used to add darcs support. -* `pristine-tar` contains deltas that - [pristine-tar](http://kitenet.net/~joey/code/pristine-tar) - can use to recreate released tarballs of ikiwiki * `debian-stable` is used for updates to the old version included in Debian's stable release, and `debian-testing` is used for updates to Debian's testing release. +* `pristine-tar` contains deltas that + [pristine-tar](http://kitenet.net/~joey/code/pristine-tar) + can use to recreate released tarballs of ikiwiki diff --git a/gitremotes b/gitremotes new file mode 100755 index 000000000..b14490924 --- /dev/null +++ b/gitremotes @@ -0,0 +1,29 @@ +#!/usr/bin/perl +# Parses list of remotes in doc/git.mdwn, configures git to use them +# all, and fetches updates from them. + +my $error=0; + +open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!"; +while () { + if (/^\*\s+\[\[(\w+)\]\]\s+<([^>]+)>/) { + # note that the remote name has to be a simple word (\w) + # for security/sanity reasons + my $remote=$1; + my $url=$2; + + # check configured url to deal with it changing + my $info=`git remote show -n $remote`; + my ($oldurl)=$info=~/URL: (.*)/m; + if ($oldurl ne $url) { + system("git remote rm $remote 2>/dev/null"); + $error |= system("git", "remote", "add", "-f", $remote, $url); + } + else { + $error |= system("git", "fetch", $remote); + } + } +} +close IN; + +exit $error; -- cgit v1.2.3 From 8b7c2f29bf316e78d49408b3ce4758cbaea4a42f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:29:30 -0500 Subject: fix comment --- doc/git.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/git.mdwn b/doc/git.mdwn index 00c108616..511a0a75c 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -28,7 +28,7 @@ own [[patches|patch]]. If you list it here, the `gitremotes` script will automatically add it to git remotes. Your repo will automatically be pulled into [[Joey]]'s working tree. This is recommended. :-) -# Machine-parsed format: * wikilink + * [[github]] [browse](http://github.com/joeyh/ikiwiki/tree/master) -- cgit v1.2.3 From 3305fb9d36de3c32552da036ebc6db2611fe13fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:31:25 -0500 Subject: markdown fixes --- doc/git.mdwn | 10 +++++----- gitremotes | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/git.mdwn b/doc/git.mdwn index 511a0a75c..abb25722a 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -30,13 +30,13 @@ into [[Joey]]'s working tree. This is recommended. :-) -* [[github]] +* github `git://github.com/joeyh/ikiwiki.git` [browse](http://github.com/joeyh/ikiwiki/tree/master) A mirror of the main repo, automatically updated. -* [[smcv]] -* [[intrigeri]] -* [[gmcmanus]] -* [[jelmer]] +* [[smcv]] `git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git` +* [[intrigeri]] `git://gaffer.ptitcanardnoir.org/ikiwiki.git` +* [[gmcmanus]] `git://github.com/gmcmanus/ikiwiki.git` +* [[jelmer]] `git://git.samba.org/jelmer/ikiwiki.git` ## branches diff --git a/gitremotes b/gitremotes index b14490924..7b9484dd1 100755 --- a/gitremotes +++ b/gitremotes @@ -6,7 +6,7 @@ my $error=0; open (IN, "doc/git.mdwn") || die "doc/git.mdwn: $!"; while () { - if (/^\*\s+\[\[(\w+)\]\]\s+<([^>]+)>/) { + if (/^\*\s+\[?\[?(\w+)\]?\]?\s+`([^>]+)`/) { # note that the remote name has to be a simple word (\w) # for security/sanity reasons my $remote=$1; -- cgit v1.2.3 From a6a85fa4446e1bdac6220ab40226ca34c13e5381 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:32:42 -0500 Subject: formatting --- doc/git.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/git.mdwn b/doc/git.mdwn index abb25722a..e9c2e040f 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -31,7 +31,7 @@ into [[Joey]]'s working tree. This is recommended. :-) * github `git://github.com/joeyh/ikiwiki.git` - [browse](http://github.com/joeyh/ikiwiki/tree/master) + ([browse](http://github.com/joeyh/ikiwiki/tree/master)) A mirror of the main repo, automatically updated. * [[smcv]] `git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git` * [[intrigeri]] `git://gaffer.ptitcanardnoir.org/ikiwiki.git` -- cgit v1.2.3 From 38f5e3ba6944ab67bff87fdbb2cc50606b806085 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 13:50:51 -0500 Subject: move feedpages application up I wanted this nearer to the top, but decided to put it after the add_depends. Reasoning: It's possible with a combinaton of feedpages and show options to make @list and @feedlist contain completly differing sets of pages. We want to add_depends all pages in both sets. We could combine the two lists and add_depends that, but it's slightly more efficient to defer reducing @feedlist, and add_depends whichever list is longer. --- IkiWiki/Plugin/inline.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 7fe5a4dcf..0c8f50384 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -232,6 +232,10 @@ sub preprocess_inline (@) { #{{{ # that if they are removed or otherwise changed, the inline will be # sure to be updated. add_depends($params{page}, join(" or ", $#list >= $#feedlist ? @list : @feedlist)); + + if ($feeds && exists $params{feedpages}) { + @feedlist=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @feedlist; + } my $feednum=""; @@ -364,10 +368,6 @@ sub preprocess_inline (@) { #{{{ } if ($feeds) { - if (exists $params{feedpages}) { - @feedlist=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @feedlist; - } - if ($rss) { my $rssp=rsspage($params{destpage}).$feednum; will_render($params{destpage}, $rssp); -- cgit v1.2.3 From 63eb9d834e2f7e08535473934e169cfe7d7debe6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 14:04:38 -0500 Subject: inline: Support emptyfeeds=no option to skip generating empty feeds. --- IkiWiki/Plugin/inline.pm | 10 ++++++++-- debian/changelog | 1 + doc/ikiwiki/directive/inline.mdwn | 4 +++- doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 0c8f50384..5e4df95f4 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -161,6 +161,7 @@ sub preprocess_inline (@) { #{{{ my $atom=(($config{atom} || $config{allowatom}) && exists $params{atom}) ? yesno($params{atom}) : $config{atom}; my $quick=exists $params{quick} ? yesno($params{quick}) : 0; my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick; + my $emptyfeeds=exists $params{emptyfeeds} ? yesno($params{emptyfeeds}) : 1; my $feedonly=yesno($params{feedonly}); if (! exists $params{show} && ! $archive) { $params{show}=10; @@ -289,8 +290,13 @@ sub preprocess_inline (@) { #{{{ gettext("Add a new post titled:")); } $ret.=$formtemplate->output; + + # The post form includes the feed buttons, so + # emptyfeeds cannot be hidden. + $emptyfeeds=1; } - elsif ($feeds && !$params{preview}) { + elsif ($feeds && !$params{preview} && + ! (! $emptyfeeds && ! @feedlist)) { # Add feed buttons. my $linktemplate=template("feedlink.tmpl", blind_cache => 1); $linktemplate->param(rssurl => $rssurl) if $rss; @@ -367,7 +373,7 @@ sub preprocess_inline (@) { #{{{ } } - if ($feeds) { + if ($feeds && ! (! $emptyfeeds && ! @feedlist)) { if ($rss) { my $rssp=rsspage($params{destpage}).$feednum; will_render($params{destpage}, $rssp); diff --git a/debian/changelog b/debian/changelog index 8d2b6661f..7f6844366 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ ikiwiki (2.71) UNRELEASED; urgency=low * Fix handling of wrappergroup option. * Correct --dumpsetup to include the srcdir in the setup file. * German translation update from Kai Wasserbäch. Closes: #507056 + * inline: Support emptyfeeds=no option to skip generating empty feeds. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index 9889cda11..82b532e0c 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -73,6 +73,8 @@ Here are some less often needed parameters: configured to `allowatom`, set to "yes" to enable. * `feeds` - controls generation of all types of feeds. Set to "no" to disable generating any feeds. +* `emptyfeeds` - Set to "no" to disable generation of empty feeds. + Has no effect if `rootpage` or `postform` is set. * `template` - Specifies the template to fill out to display each inlined page. By default the `inlinepage` template is used, while the `archivepage` template is used for archives. Set this parameter to @@ -97,7 +99,7 @@ Here are some less often needed parameters: in the blog. The format string is passed to the strftime(3) function. * `feedpages` - A [[PageSpec]] of inlined pages to include in the rss/atom feeds. The default is the same as the `pages` value above, and only pages - matches by that value are included, but some of those can be excluded by + matched by that value are included, but some of those can be excluded by specifying a tighter [[PageSpec]] here. * `guid` - If a URI is given here (perhaps a UUID prefixed with `urn:uuid:`), the Atom feed will have this as its ``. The default is to use the URL diff --git a/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn index f998d5654..d046c0cd0 100644 --- a/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn +++ b/doc/todo/inline_plugin:_hide_feed_buttons_if_empty.mdwn @@ -2,3 +2,6 @@ drop the rss/atom buttons for comments when there are none yet This seems to me like something that applies to the [[plugins/inline]] plugin in general, rather than the [[plugins/contrib/comments]] plugin specifically. --[[smcv]] + +>> [[done]] as emptyfeeds option, not on by default for inline, but I think +>> it should be for comments --[[Joey]] -- cgit v1.2.3 From e968dbac13a7343c895eb0f8303cbef2c4e3761f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 14:09:34 -0500 Subject: thoughts --- ...line_plugin:_ability_to_override_feed_name.mdwn | 27 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn index 2373181d6..0aab7b9e6 100644 --- a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -1,9 +1,28 @@ -If RSS and Atom are enabled by default, the [[plugins/contrib/comments]] plugin generates a feed, perhaps `/sandbox/index.atom` for comments on the sandbox. If a blog is added to the page, the blog will steal the name `/sandbox/index.atom` and the comments plugin's feed will change to `/sandbox/index.atom2`. +If RSS and Atom are enabled by default, the [[plugins/contrib/comments]] +plugin generates a feed, perhaps `/sandbox/index.atom` for comments on the +sandbox. If a blog is added to the page, the blog will steal the name +`/sandbox/index.atom` and the comments plugin's feed will change to +`/sandbox/index.atom2`. -If `\[[!inline]]` gained a parameter `feedname` or something, the comments plugin could use `feedname=comments` to produce `/sandbox/comments.atom` instead (this would just require minor enhancements to rsspage(), atompage() and targetpage()). +If `\[[!inline]]` gained a parameter `feedname` or something, the comments +plugin could use `feedname=comments` to produce `/sandbox/comments.atom` +instead (this would just require minor enhancements to rsspage(), +atompage() and targetpage()). -As a side benefit, [my blog](http://smcv.pseudorandom.co.uk/) could go back to its historical Atom feed URL of `.../feed.atom` (which is currently a symlink to `index.atom` :-) ) +As a side benefit, [my blog](http://smcv.pseudorandom.co.uk/) could go back +to its historical Atom feed URL of `.../feed.atom` (which is currently a +symlink to `index.atom` :-) ) -On sites not using `usedirs` the current feed is `/sandbox.atom`, and we could perhaps change it to `/sandbox-comments.atom` or `/sandbox/comments.atom` if `feedname=comments` is given. +On sites not using `usedirs` the current feed is `/sandbox.atom`, and we +could perhaps change it to `/sandbox-comments.atom` or +`/sandbox/comments.atom` if `feedname=comments` is given. --[[smcv]] + +> This is slightly hard to do, because you have to worry about +> conflicting pages setting feedname, which would cause ikiwiki to blow up. +> +> Particularly for the non-usedirs case, where a page `sandbox/comments` +> would produce the same feed as sandbox with `feedname=comments` . +> I don't think there's a solution in the non-usedirs case, so maybe this +> option would need to only work for usedirs. --[[Joey]] -- cgit v1.2.3 From 3b3127643b1869ccebcb6d311a9e100e5317d803 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 14:12:03 -0500 Subject: rethink --- doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn index 0aab7b9e6..41bae45fa 100644 --- a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -20,9 +20,11 @@ could perhaps change it to `/sandbox-comments.atom` or --[[smcv]] > This is slightly hard to do, because you have to worry about -> conflicting pages setting feedname, which would cause ikiwiki to blow up. +> conflicting pages setting feedname, which could cause ikiwiki to blow up. > > Particularly for the non-usedirs case, where a page `sandbox/comments` -> would produce the same feed as sandbox with `feedname=comments` . -> I don't think there's a solution in the non-usedirs case, so maybe this -> option would need to only work for usedirs. --[[Joey]] +> would produce the same feed as sandbox with `feedname=comments`. +> +> Hmm, looking some more, since inline tracks `%knownfeeds` and uniquifys +> the names on conflicts, you'd just end up with `sandbox/comments.atom2` +> if there were a conflict -- acceptable. --[[Joey]] -- cgit v1.2.3 From 2cd7eecf896261834bcd66d8ec3a9fd3bb7236d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 14:26:58 -0500 Subject: looking closer, the existing %knownfeeds won't work --- doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn index 41bae45fa..71bc3bdd6 100644 --- a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -24,7 +24,4 @@ could perhaps change it to `/sandbox-comments.atom` or > > Particularly for the non-usedirs case, where a page `sandbox/comments` > would produce the same feed as sandbox with `feedname=comments`. -> -> Hmm, looking some more, since inline tracks `%knownfeeds` and uniquifys -> the names on conflicts, you'd just end up with `sandbox/comments.atom2` -> if there were a conflict -- acceptable. --[[Joey]] +> --[[Joey]] -- cgit v1.2.3 From b67632cdcdd333cf0a88d03c0f7e6e62921f32c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Dec 2008 15:01:26 -0500 Subject: inline: Support feedfile option to change the filename of the feed generated. --- IkiWiki.pm | 8 ++- IkiWiki/Plugin/inline.pm | 63 ++++++++++-------- debian/changelog | 2 + doc/ikiwiki/directive/inline.mdwn | 5 ++ doc/plugins/write.mdwn | 6 +- ...line_plugin:_ability_to_override_feed_name.mdwn | 2 + po/de.po | 74 +++++++++++----------- po/fr.po | 71 +++++++++++---------- po/ikiwiki.pot | 52 +++++++-------- 9 files changed, 156 insertions(+), 127 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 2ad2f792d..1c68c2cb3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -666,11 +666,15 @@ sub newpagefile ($$) { #{{{ } } #}}} -sub targetpage ($$) { #{{{ +sub targetpage ($$;$) { #{{{ my $page=shift; my $ext=shift; + my $filename=shift; - if (! $config{usedirs} || $page eq 'index') { + if (defined $filename) { + return $page."/".$filename.".".$ext; + } + elsif (! $config{usedirs} || $page eq 'index') { return $page.".".$ext; } else { diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 5e4df95f4..17cc46e0e 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -26,8 +26,7 @@ sub import { #{{{ # Hook to change to do pinging since it's called late. # This ensures each page only pings once and prevents slow # pings interrupting page builds. - hook(type => "change", id => "inline", - call => \&IkiWiki::pingurl); + hook(type => "change", id => "inline", call => \&IkiWiki::pingurl); } # }}} sub getopt () { #{{{ @@ -238,28 +237,46 @@ sub preprocess_inline (@) { #{{{ @feedlist=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @feedlist; } - my $feednum=""; - - my $feedid=join("\0", map { $_."\0".$params{$_} } sort keys %params); - if (exists $knownfeeds{$feedid}) { - $feednum=$knownfeeds{$feedid}; - } - else { - if (exists $page_numfeeds{$params{destpage}}) { - if ($feeds) { - $feednum=$knownfeeds{$feedid}=++$page_numfeeds{$params{destpage}}; + my ($feedbase, $feednum); + if ($feeds) { + # Ensure that multiple feeds on a page go to unique files. + + # Feedfile can lead to conflicts if usedirs is not enabled, + # so avoid supporting it in that case. + delete $params{feedfile} if ! $config{usedirs}; + # Tight limits on legal feedfiles, to avoid security issues + # and conflicts. + if (defined $params{feedfile}) { + if ($params{feedfile} =~ /\// || + $params{feedfile} !~ /$config{wiki_file_regexp}/) { + error("illegal feedfile"); } + $params{feedfile}=possibly_foolish_untaint($params{feedfile}); + } + $feedbase=targetpage($params{destpage}, "", $params{feedfile}); + + my $feedid=join("\0", $feedbase, map { $_."\0".$params{$_} } sort keys %params); + if (exists $knownfeeds{$feedid}) { + $feednum=$knownfeeds{$feedid}; } else { - $feednum=$knownfeeds{$feedid}=""; - if ($feeds) { - $page_numfeeds{$params{destpage}}=1; + if (exists $page_numfeeds{$params{destpage}}{$feedbase}) { + if ($feeds) { + $feednum=$knownfeeds{$feedid}=++$page_numfeeds{$params{destpage}}{$feedbase}; + } + } + else { + $feednum=$knownfeeds{$feedid}=""; + if ($feeds) { + $page_numfeeds{$params{destpage}}{$feedbase}=1; + } } } } - my $rssurl=basename(rsspage($params{destpage}).$feednum) if $feeds && $rss; - my $atomurl=basename(atompage($params{destpage}).$feednum) if $feeds && $atom; + my $rssurl=basename($feedbase."rss".$feednum) if $feeds && $rss; + my $atomurl=basename($feedbase."atom".$feednum) if $feeds && $atom; + my $ret=""; if (length $config{cgiurl} && ! $params{preview} && (exists $params{rootpage} || @@ -375,7 +392,7 @@ sub preprocess_inline (@) { #{{{ if ($feeds && ! (! $emptyfeeds && ! @feedlist)) { if ($rss) { - my $rssp=rsspage($params{destpage}).$feednum; + my $rssp=$feedbase."rss".$feednum; will_render($params{destpage}, $rssp); if (! $params{preview}) { writefile($rssp, $config{destdir}, @@ -386,7 +403,7 @@ sub preprocess_inline (@) { #{{{ } } if ($atom) { - my $atomp=atompage($params{destpage}).$feednum; + my $atomp=$feedbase."atom".$feednum; will_render($params{destpage}, $atomp); if (! $params{preview}) { writefile($atomp, $config{destdir}, @@ -475,14 +492,6 @@ sub absolute_urls ($$) { #{{{ return $content; } #}}} -sub rsspage ($) { #{{{ - return targetpage(shift, "rss"); -} #}}} - -sub atompage ($) { #{{{ - return targetpage(shift, "atom"); -} #}}} - sub genfeed ($$$$$@) { #{{{ my $feedtype=shift; my $feedurl=shift; diff --git a/debian/changelog b/debian/changelog index 7f6844366..1ff78d749 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ ikiwiki (2.71) UNRELEASED; urgency=low * Correct --dumpsetup to include the srcdir in the setup file. * German translation update from Kai Wasserbäch. Closes: #507056 * inline: Support emptyfeeds=no option to skip generating empty feeds. + * inline: Support feedfile option to change the filename of the feed + generated. -- Joey Hess Mon, 17 Nov 2008 14:02:10 -0500 diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index 82b532e0c..40670e1e7 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -104,6 +104,11 @@ Here are some less often needed parameters: * `guid` - If a URI is given here (perhaps a UUID prefixed with `urn:uuid:`), the Atom feed will have this as its ``. The default is to use the URL of the page containing the `inline` directive. +* `feedfile` - Can be used to change the name of the file generated for the + feed. This is particularly useful if a page contains multiple feeds. + For example, set "feedfile=feed" to cause it to generate `page/feed.atom` + and/or `page/feed.rss`. This option is not supported if the wiki is + configured not to use `usedirs`. [[!meta robots="noindex, follow"]] diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index abcabbdc3..b6fa96f91 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -696,11 +696,15 @@ This can be called when creating a new page, to determine what filename to save the page to. It's passed a page name, and its type, and returns the name of the file to create, relative to the srcdir. -#### `targetpage($$)` +#### `targetpage($$;$)` Passed a page and an extension, returns the filename that page will be rendered to. +Optionally, a third parameter can be passed, to specify the preferred +filename of the page. For example, `targetpage("foo", "rss", "feed")` +will yield something like `foo/feed.rss`. + ## Miscellaneous ### Internal use pages diff --git a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn index 71bc3bdd6..df5bf9194 100644 --- a/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn +++ b/doc/todo/inline_plugin:_ability_to_override_feed_name.mdwn @@ -25,3 +25,5 @@ could perhaps change it to `/sandbox-comments.atom` or > Particularly for the non-usedirs case, where a page `sandbox/comments` > would produce the same feed as sandbox with `feedname=comments`. > --[[Joey]] + +> [[done]] as feedfile option --[[Joey]] diff --git a/po/de.po b/po/de.po index 55234a909..d49d0c6ca 100644 --- a/po/de.po +++ b/po/de.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 2.70\n" -"Report-Msgid-Bugs-To: ikiwiki@packages.debian.org\n" -"POT-Creation-Date: 2008-10-31 16:37-0400\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-12-11 14:46-0500\n" "PO-Revision-Date: 2008-11-20 19:58+0100\n" "Last-Translator: Kai Wasserbäch \n" "Language-Team: German \n" @@ -47,7 +47,7 @@ msgstr "Einstellungen gespeichert." msgid "You are banned." msgstr "Sie sind ausgeschlossen worden." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1182 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 msgid "Error" msgstr "Fehler" @@ -110,16 +110,16 @@ msgstr "Feed nicht gefunden" msgid "(invalid UTF-8 stripped from feed)" msgstr "(ungültiges UTF-8-Zeichen wurde aus dem Feed entfernt)" -#: ../IkiWiki/Plugin/aggregate.pm:504 +#: ../IkiWiki/Plugin/aggregate.pm:506 #, perl-format msgid "(feed entities escaped)" msgstr "(Feed-Entitäten maskiert)" -#: ../IkiWiki/Plugin/aggregate.pm:510 +#: ../IkiWiki/Plugin/aggregate.pm:514 msgid "feed crashed XML::Feed!" msgstr "Feed führte zum Absturz von XML::Feed!" -#: ../IkiWiki/Plugin/aggregate.pm:590 +#: ../IkiWiki/Plugin/aggregate.pm:595 #, perl-format msgid "creating new page %s" msgstr "erstelle neue Seite %s" @@ -128,7 +128,7 @@ msgstr "erstelle neue Seite %s" msgid "deleting bucket.." msgstr "Lösche Bucket..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:208 msgid "done" msgstr "fertig" @@ -171,7 +171,7 @@ msgid "automatic index generation" msgstr "automatische Index-Erstellung" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:261 -#: ../IkiWiki/Plugin/inline.pm:327 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:344 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -245,11 +245,11 @@ msgstr "»edittemplate« %s registriert für %s" msgid "failed to process" msgstr "Bearbeitung fehlgeschlagen" -#: ../IkiWiki/Plugin/format.pm:22 +#: ../IkiWiki/Plugin/format.pm:20 msgid "must specify format and text" msgstr "Format und Text muss spezifiziert werden" -#: ../IkiWiki/Plugin/format.pm:25 +#: ../IkiWiki/Plugin/format.pm:23 #, perl-format msgid "unsupported page format %s" msgstr "nicht unterstütztes Seitenformat %s" @@ -276,7 +276,8 @@ msgstr "Es ist Ihnen nicht erlaubt, Dateizugriffsrechte zu ändern" #: ../IkiWiki/Plugin/google.pm:27 #, perl-format msgid "Must specify %s when using the google search plugin" -msgstr "%s muss angegeben werden, wenn die Google-Sucherweiterung verwandt wird" +msgstr "" +"%s muss angegeben werden, wenn die Google-Sucherweiterung verwandt wird" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" @@ -320,17 +321,17 @@ msgstr "Größenänderung fehlgeschlagen: %s" msgid "failed to determine size of image %s" msgstr "Größe des Bildes %s konnte nicht festgestellt werden." -#: ../IkiWiki/Plugin/inline.pm:93 +#: ../IkiWiki/Plugin/inline.pm:92 msgid "Must specify url to wiki with --url when using --rss or --atom" msgstr "" "Die URL zum Wiki muss mit --url angegeben werden, wenn --rss oder --atom " "genutzt wird" -#: ../IkiWiki/Plugin/inline.pm:139 +#: ../IkiWiki/Plugin/inline.pm:138 msgid "page editing not allowed" msgstr "Seitenbearbeitungen sind nicht erlaubt" -#: ../IkiWiki/Plugin/inline.pm:156 +#: ../IkiWiki/Plugin/inline.pm:155 msgid "missing pages parameter" msgstr "Fehlender Seitenparameter" @@ -339,20 +340,20 @@ msgstr "Fehlender Seitenparameter" msgid "unknown sort type %s" msgstr "Unbekannter Sortierungstyp %s" -#: ../IkiWiki/Plugin/inline.pm:285 +#: ../IkiWiki/Plugin/inline.pm:297 msgid "Add a new post titled:" msgstr "Füge einen neuen Beitrag hinzu. Titel:" -#: ../IkiWiki/Plugin/inline.pm:301 +#: ../IkiWiki/Plugin/inline.pm:318 #, perl-format msgid "nonexistant template %s" msgstr "nicht-vorhandene Vorlage %s" -#: ../IkiWiki/Plugin/inline.pm:335 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:352 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki/Plugin/inline.pm:572 +#: ../IkiWiki/Plugin/inline.pm:577 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client nicht gefunden, führe Ping nicht aus" @@ -568,20 +569,18 @@ msgstr "Unzulässiger Prozentwert (%s)" #: ../IkiWiki/Plugin/progress.pm:59 msgid "need either `percent` or `totalpages` and `donepages` parameters" -msgstr "" -"Benötige entweder »percent«- oder »totalpages«- und " -"»donepages«-Parameter" +msgstr "Benötige entweder »percent«- oder »totalpages«- und »donepages«-Parameter" -#: ../IkiWiki/Plugin/recentchanges.pm:100 +#: ../IkiWiki/Plugin/recentchanges.pm:101 msgid "missing page" msgstr "fehlende Seite" -#: ../IkiWiki/Plugin/recentchanges.pm:102 +#: ../IkiWiki/Plugin/recentchanges.pm:103 #, perl-format msgid "The page %s does not exist." msgstr "Die Seite %s existiert nicht." -#: ../IkiWiki/Plugin/recentchangesdiff.pm:36 +#: ../IkiWiki/Plugin/recentchangesdiff.pm:37 msgid "(Diff truncated)" msgstr "(Diff beschnitten)" @@ -593,7 +592,8 @@ msgstr "%s existiert nicht" #: ../IkiWiki/Plugin/remove.pm:38 #, perl-format msgid "%s is not in the srcdir, so it cannot be deleted" -msgstr "%s ist nicht im Quellverzeichnis und kann deshalb nicht gelöscht werden" +msgstr "" +"%s ist nicht im Quellverzeichnis und kann deshalb nicht gelöscht werden" #: ../IkiWiki/Plugin/remove.pm:41 ../IkiWiki/Plugin/rename.pm:45 #, perl-format @@ -928,19 +928,19 @@ msgstr "Dateiname des Wrappers nicht angegeben" #. translators: The first parameter is a filename, and the second is #. translators: a (probably not translated) error message. -#: ../IkiWiki/Wrapper.pm:79 +#: ../IkiWiki/Wrapper.pm:97 #, perl-format msgid "failed to write %s: %s" msgstr "Schreiben von %s fehlgeschlagen: %s" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:135 +#: ../IkiWiki/Wrapper.pm:154 #, perl-format msgid "failed to compile %s" msgstr "Erzeugen von %s fehlgeschlagen" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:155 +#: ../IkiWiki/Wrapper.pm:174 #, perl-format msgid "successfully generated %s" msgstr "%s wurde erfolgreich erstellt" @@ -953,43 +953,43 @@ msgstr "Benutzung: ikiwiki [Optionen] Quelle Ziel" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup Konfigurationsdatei " -#: ../ikiwiki.in:90 +#: ../ikiwiki.in:91 msgid "usage: --set var=value" msgstr "Benutzung: --set Variable=Wert" -#: ../ikiwiki.in:138 +#: ../ikiwiki.in:139 msgid "generating wrappers.." msgstr "erzeuge Wrapper..." -#: ../ikiwiki.in:195 +#: ../ikiwiki.in:197 msgid "rebuilding wiki.." msgstr "erzeuge Wiki neu..." -#: ../ikiwiki.in:198 +#: ../ikiwiki.in:200 msgid "refreshing wiki.." msgstr "aktualisiere Wiki..." -#: ../IkiWiki.pm:466 +#: ../IkiWiki.pm:480 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" "Es muss eine URL zum Wiki mit --url angegeben werden, wenn --cgi verwandt " "wird" -#: ../IkiWiki.pm:512 +#: ../IkiWiki.pm:526 msgid "cannot use multiple rcs plugins" msgstr "Kann nicht mehrere Versionskontrollsystem-Erweiterungen verwenden" -#: ../IkiWiki.pm:541 +#: ../IkiWiki.pm:555 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Laden der für %s benötigten externen Erweiterung fehlgeschlagen: %s" -#: ../IkiWiki.pm:1165 +#: ../IkiWiki.pm:1187 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Präprozessorschleife auf %s in Tiefe %i erkannt" -#: ../IkiWiki.pm:1678 +#: ../IkiWiki.pm:1688 msgid "yes" msgstr "ja" diff --git a/po/fr.po b/po/fr.po index b8e84f930..ebc21fd9a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 2.70 \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-10-31 16:37-0400\n" +"POT-Creation-Date: 2008-12-11 14:46-0500\n" "PO-Revision-Date: 2008-11-19 21:53+0100\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" @@ -49,7 +49,7 @@ msgstr "Les préférences ont été enregistrées." msgid "You are banned." msgstr "Vous avez été banni." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1182 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 msgid "Error" msgstr "Erreur" @@ -112,16 +112,16 @@ msgstr "Flux introuvable " msgid "(invalid UTF-8 stripped from feed)" msgstr "(chaîne UTF-8 non valable supprimée du flux)" -#: ../IkiWiki/Plugin/aggregate.pm:504 +#: ../IkiWiki/Plugin/aggregate.pm:506 #, perl-format msgid "(feed entities escaped)" msgstr "(échappement des entités de flux)" -#: ../IkiWiki/Plugin/aggregate.pm:510 +#: ../IkiWiki/Plugin/aggregate.pm:514 msgid "feed crashed XML::Feed!" msgstr "Plantage du flux XML::Feed !" -#: ../IkiWiki/Plugin/aggregate.pm:590 +#: ../IkiWiki/Plugin/aggregate.pm:595 #, perl-format msgid "creating new page %s" msgstr "Création de la nouvelle page %s" @@ -130,7 +130,7 @@ msgstr "Création de la nouvelle page %s" msgid "deleting bucket.." msgstr "suppression du compartiment S3 (« bucket »)..." -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:208 msgid "done" msgstr "Terminé" @@ -173,7 +173,7 @@ msgid "automatic index generation" msgstr "génération de l'index automatique" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:261 -#: ../IkiWiki/Plugin/inline.pm:327 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:344 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -247,11 +247,11 @@ msgstr "edittemplate %s enregistré pour %s" msgid "failed to process" msgstr "Échec du traitement" -#: ../IkiWiki/Plugin/format.pm:22 +#: ../IkiWiki/Plugin/format.pm:20 msgid "must specify format and text" msgstr "le format et le texte doivent être indiqués" -#: ../IkiWiki/Plugin/format.pm:25 +#: ../IkiWiki/Plugin/format.pm:23 #, perl-format msgid "unsupported page format %s" msgstr "format de page non reconnu %s" @@ -321,17 +321,17 @@ msgstr "Échec du redimensionnement : %s" msgid "failed to determine size of image %s" msgstr "Échec de la détermination de la taille de l'image : %s" -#: ../IkiWiki/Plugin/inline.pm:93 +#: ../IkiWiki/Plugin/inline.pm:92 msgid "Must specify url to wiki with --url when using --rss or --atom" msgstr "" "Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --rss " "ou --atom" -#: ../IkiWiki/Plugin/inline.pm:139 +#: ../IkiWiki/Plugin/inline.pm:138 msgid "page editing not allowed" msgstr "Modification de page interdite" -#: ../IkiWiki/Plugin/inline.pm:156 +#: ../IkiWiki/Plugin/inline.pm:155 msgid "missing pages parameter" msgstr "paramètre « pages » manquant" @@ -340,20 +340,20 @@ msgstr "paramètre « pages » manquant" msgid "unknown sort type %s" msgstr "Type de tri %s inconnu" -#: ../IkiWiki/Plugin/inline.pm:285 +#: ../IkiWiki/Plugin/inline.pm:297 msgid "Add a new post titled:" msgstr "Ajouter un nouvel article dont le titre est :" -#: ../IkiWiki/Plugin/inline.pm:301 +#: ../IkiWiki/Plugin/inline.pm:318 #, perl-format msgid "nonexistant template %s" msgstr "Le modèle de page %s n'existe pas" -#: ../IkiWiki/Plugin/inline.pm:335 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:352 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Discussion" -#: ../IkiWiki/Plugin/inline.pm:572 +#: ../IkiWiki/Plugin/inline.pm:577 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client introuvable, pas de réponse au ping" @@ -573,16 +573,16 @@ msgid "need either `percent` or `totalpages` and `donepages` parameters" msgstr "" "L'un des paramètres « percent », « totalpages » ou « donepages » est nécessaire." -#: ../IkiWiki/Plugin/recentchanges.pm:100 +#: ../IkiWiki/Plugin/recentchanges.pm:101 msgid "missing page" msgstr "Page manquante" -#: ../IkiWiki/Plugin/recentchanges.pm:102 +#: ../IkiWiki/Plugin/recentchanges.pm:103 #, perl-format msgid "The page %s does not exist." msgstr "La page %s n'existe pas." -#: ../IkiWiki/Plugin/recentchangesdiff.pm:36 +#: ../IkiWiki/Plugin/recentchangesdiff.pm:37 msgid "(Diff truncated)" msgstr "(fichier de différences tronqué)" @@ -820,12 +820,14 @@ msgstr "" #: ../IkiWiki/Plugin/websetup.pm:433 #, perl-format msgid "

Error: %s exited nonzero (%s)" -msgstr "

Erreur : %s s'est terminé, valeur de sortie nonzero (%s)" +msgstr "" +"

Erreur : %s s'est terminé, valeur de sortie nonzero (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format msgid "cannot determine id of untrusted committer %s" -msgstr "Impossible de déterminer l'identifiant de %s, (enregistrement non fiable)" +msgstr "" +"Impossible de déterminer l'identifiant de %s, (enregistrement non fiable)" #: ../IkiWiki/Receive.pm:85 #, perl-format @@ -929,19 +931,19 @@ msgstr "Le nom du fichier CGI n'a pas été indiqué" #. translators: The first parameter is a filename, and the second is #. translators: a (probably not translated) error message. -#: ../IkiWiki/Wrapper.pm:79 +#: ../IkiWiki/Wrapper.pm:97 #, perl-format msgid "failed to write %s: %s" msgstr "Échec de l'écriture de %s : %s" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:135 +#: ../IkiWiki/Wrapper.pm:154 #, perl-format msgid "failed to compile %s" msgstr "Échec de la compilation de %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:155 +#: ../IkiWiki/Wrapper.pm:174 #, perl-format msgid "successfully generated %s" msgstr "%s a été créé avec succès" @@ -954,41 +956,42 @@ msgstr "Syntaxe : ikiwiki [options] source destination" msgid " ikiwiki --setup configfile" msgstr " ikiwiki --setup fichier de configuration" -#: ../ikiwiki.in:90 +#: ../ikiwiki.in:91 msgid "usage: --set var=value" msgstr "Syntaxe : -- set var=valeur" -#: ../ikiwiki.in:138 +#: ../ikiwiki.in:139 msgid "generating wrappers.." msgstr "Création des fichiers CGI..." -#: ../ikiwiki.in:195 +#: ../ikiwiki.in:197 msgid "rebuilding wiki.." msgstr "Reconstruction du wiki..." -#: ../ikiwiki.in:198 +#: ../ikiwiki.in:200 msgid "refreshing wiki.." msgstr "Rafraîchissement du wiki..." -#: ../IkiWiki.pm:466 +#: ../IkiWiki.pm:480 msgid "Must specify url to wiki with --url when using --cgi" -msgstr "Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi" +msgstr "" +"Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi" -#: ../IkiWiki.pm:512 +#: ../IkiWiki.pm:526 msgid "cannot use multiple rcs plugins" msgstr "impossible d'utiliser plusieurs systèmes de contrôle des versions" -#: ../IkiWiki.pm:541 +#: ../IkiWiki.pm:555 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Impossible de charger le greffon externe nécessaire au greffon %s : %s" -#: ../IkiWiki.pm:1165 +#: ../IkiWiki.pm:1187 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "une boucle de pré traitement a été détectée sur %s à hauteur de %i" -#: ../IkiWiki.pm:1678 +#: ../IkiWiki.pm:1688 msgid "yes" msgstr "oui" diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index feb36c742..11c865363 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-11 20:48-0500\n" +"POT-Creation-Date: 2008-12-11 14:46-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,7 +48,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1189 +#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 msgid "Error" msgstr "" @@ -111,16 +111,16 @@ msgstr "" msgid "(invalid UTF-8 stripped from feed)" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:504 +#: ../IkiWiki/Plugin/aggregate.pm:506 #, perl-format msgid "(feed entities escaped)" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:510 +#: ../IkiWiki/Plugin/aggregate.pm:514 msgid "feed crashed XML::Feed!" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:591 +#: ../IkiWiki/Plugin/aggregate.pm:595 #, perl-format msgid "creating new page %s" msgstr "" @@ -129,7 +129,7 @@ msgstr "" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:208 msgid "done" msgstr "" @@ -172,7 +172,7 @@ msgid "automatic index generation" msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:261 -#: ../IkiWiki/Plugin/inline.pm:327 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:344 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -320,15 +320,15 @@ msgstr "" msgid "failed to determine size of image %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:93 +#: ../IkiWiki/Plugin/inline.pm:92 msgid "Must specify url to wiki with --url when using --rss or --atom" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:139 +#: ../IkiWiki/Plugin/inline.pm:138 msgid "page editing not allowed" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:156 +#: ../IkiWiki/Plugin/inline.pm:155 msgid "missing pages parameter" msgstr "" @@ -337,20 +337,20 @@ msgstr "" msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:285 +#: ../IkiWiki/Plugin/inline.pm:297 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:301 +#: ../IkiWiki/Plugin/inline.pm:318 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:335 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:352 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:572 +#: ../IkiWiki/Plugin/inline.pm:577 msgid "RPC::XML::Client not found, not pinging" msgstr "" @@ -563,16 +563,16 @@ msgstr "" msgid "need either `percent` or `totalpages` and `donepages` parameters" msgstr "" -#: ../IkiWiki/Plugin/recentchanges.pm:100 +#: ../IkiWiki/Plugin/recentchanges.pm:101 msgid "missing page" msgstr "" -#: ../IkiWiki/Plugin/recentchanges.pm:102 +#: ../IkiWiki/Plugin/recentchanges.pm:103 #, perl-format msgid "The page %s does not exist." msgstr "" -#: ../IkiWiki/Plugin/recentchangesdiff.pm:36 +#: ../IkiWiki/Plugin/recentchangesdiff.pm:37 msgid "(Diff truncated)" msgstr "" @@ -935,41 +935,41 @@ msgstr "" msgid " ikiwiki --setup configfile" msgstr "" -#: ../ikiwiki.in:90 +#: ../ikiwiki.in:91 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:138 +#: ../ikiwiki.in:139 msgid "generating wrappers.." msgstr "" -#: ../ikiwiki.in:195 +#: ../ikiwiki.in:197 msgid "rebuilding wiki.." msgstr "" -#: ../ikiwiki.in:198 +#: ../ikiwiki.in:200 msgid "refreshing wiki.." msgstr "" -#: ../IkiWiki.pm:473 +#: ../IkiWiki.pm:480 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" -#: ../IkiWiki.pm:519 +#: ../IkiWiki.pm:526 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:548 +#: ../IkiWiki.pm:555 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1172 +#: ../IkiWiki.pm:1187 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1673 +#: ../IkiWiki.pm:1688 msgid "yes" msgstr "" -- cgit v1.2.3 From f77f7a02a6f235e02c4729f6f56e7c43bd8a33fb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Sep 2008 19:33:45 +0100 Subject: Add initial version of a postcomment plugin (temporarily namespaced as smcvpostcomment) --- IkiWiki/Plugin/smcvpostcomment.pm | 299 +++++++++++++++++++++++++++++++++ templates/smcvpostcomment_comment.tmpl | 10 ++ templates/smcvpostcomment_display.tmpl | 24 +++ templates/smcvpostcomment_embed.tmpl | 11 ++ templates/smcvpostcomment_form.tmpl | 20 +++ 5 files changed, 364 insertions(+) create mode 100644 IkiWiki/Plugin/smcvpostcomment.pm create mode 100644 templates/smcvpostcomment_comment.tmpl create mode 100644 templates/smcvpostcomment_display.tmpl create mode 100644 templates/smcvpostcomment_embed.tmpl create mode 100644 templates/smcvpostcomment_form.tmpl diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm new file mode 100644 index 000000000..cb55ff94f --- /dev/null +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -0,0 +1,299 @@ +#!/usr/bin/perl +# Copyright © 2006-2008 Joey Hess +# Copyright © 2008 Simon McVittie +# Licensed under the GNU GPL, version 2, or any later version published by the +# Free Software Foundation +package IkiWiki::Plugin::smcvpostcomment; + +use warnings; +use strict; +use IkiWiki 2.00; +use IkiWiki::Plugin::mdwn; +use CGI 'escapeHTML'; + +use constant PLUGIN => "smcvpostcomment"; +use constant PREVIEW => "Preview"; +use constant POST_COMMENT => "Post comment"; +use constant CANCEL => "Cancel"; + +sub import { #{{{ + hook(type => "getsetup", id => PLUGIN, call => \&getsetup); + hook(type => "preprocess", id => PLUGIN, call => \&preprocess); + hook(type => "sessioncgi", id => PLUGIN, call => \&sessioncgi); + hook(type => "htmlize", id => "_".PLUGIN, + call => \&IkiWiki::Plugin::mdwn::htmlize); + IkiWiki::loadplugin("inline"); +} # }}} + +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => undef, + }, +} #}}} + +# Somewhat based on IkiWiki::Plugin::inline blog posting support +sub preprocess (@) { #{{{ + my %params=@_; + + unless (length $config{cgiurl}) { + error("this plugin makes no sense if you have no CGI"); + } + + my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", + blind_cache => 1); + $formtemplate->param(cgiurl => $config{cgiurl}); + $formtemplate->param(page => $params{page}); + + if ($params{preview}) { + $formtemplate->param("disabled" => + 'not available during Preview'); + } + + debug("page $params{page} => destpage $params{page}"); + + # I'm reasonably sure that this counts as abuse of [[!inline]] + return $formtemplate->output . "\n" . + IkiWiki::preprocess_inline( + pages => "internal(/$params{page}/comment_*)", + template => PLUGIN . "_display", + show => 0, + reverse => "yes", + page => $params{page}, + destpage => $params{destpage}, + preview => $params{preview}); +} # }}} + +# FIXME: logic taken from editpage, should be common code? +sub getcgiuser ($) { # {{{ + my $session = shift; + my $user = $session->param('name'); + $user = $ENV{REMOTE_ADDR} unless defined $user; + debug("getcgiuser() -> $user"); + return $user; +} # }}} + +# FIXME: logic adapted from recentchanges, should be common code? +sub linkuser ($) { # {{{ + my $user = shift; + my $oiduser = eval { IkiWiki::openiduser($user) }; + + if (defined $oiduser) { + return ($user, $oiduser); + } + else { + my $page = bestlink('', (length $config{userdir} + ? "$config{userdir}/" + : "").$user); + return (urlto($page, undef, 1), $user); + } +} # }}} + +# FIXME: taken from IkiWiki::Plugin::editpage, should be common? +sub checksessionexpiry ($$) { # {{{ + my $session = shift; + my $sid = shift; + + if (defined $session->param("name")) { + if (! defined $sid || $sid ne $session->id) { + error(gettext("Your login session has expired.")); + } + } +} # }}} + +# Mostly cargo-culted from IkiWiki::plugin::editpage +sub sessioncgi ($$) { #{{{ + my $cgi=shift; + my $session=shift; + + my $do = $cgi->param('do'); + return unless $do eq PLUGIN; + + # These are theoretically configurable, but currently hard-coded + my $allow_wikilinks = 0; + my $allow_directives = 0; + my $commit_comments = 1; + + IkiWiki::decode_cgi_utf8($cgi); + + eval q{use CGI::FormBuilder}; + error($@) if $@; + + my @buttons = (POST_COMMENT, PREVIEW, CANCEL); + my $form = CGI::FormBuilder->new( + fields => [qw{do sid page subject body}], + charset => 'utf-8', + method => 'POST', + required => [qw{body}], + javascript => 0, + params => $cgi, + action => $config{cgiurl}, + header => 0, + table => 0, + template => scalar IkiWiki::template_params(PLUGIN . '_form.tmpl'), + # wtf does this do in editpage? + wikiname => $config{wikiname}, + ); + + IkiWiki::decode_form_utf8($form); + IkiWiki::run_hooks(formbuilder_setup => sub { + shift->(title => PLUGIN, form => $form, cgi => $cgi, + session => $session, buttons => \@buttons); + }); + IkiWiki::decode_form_utf8($form); + + $form->field(name => 'do', type => 'hidden'); + $form->field(name => 'sid', type => 'hidden', value => $session->id, + force => 1); + $form->field(name => 'page', type => 'hidden'); + $form->field(name => 'subject', type => 'text', size => 80); + $form->field(name => 'body', type => 'textarea', rows => 5, + cols => 80); + + # The untaint is OK (as in editpage) because we're about to pass + # it to file_pruned anyway + my $page = $form->field('page'); + $page = IkiWiki::possibly_foolish_untaint($page); + if (!defined $page || !length $page || + IkiWiki::file_pruned($page, $config{srcdir})) { + error ("bad page name"); + } + + # FIXME: is this right? Or should we be using the candidate subpage + # (whatever that might mean) as the base URL? + my $baseurl = urlto($page, undef, 1); + + $form->title(sprintf(gettext("commenting on %s"), + IkiWiki::pagetitle($page))); + + $form->tmpl_param('helponformattinglink', + htmllink($page, $page, 'ikiwiki/formatting', + noimageinline => 1, + linktext => 'FormattingHelp')); + + if (not exists $pagesources{$page}) { + error ("page '$page' doesn't exist, so you can't comment"); + } + + if ($form->submitted eq CANCEL) { + # bounce back to the page they wanted to comment on, and exit. + # CANCEL need not be considered in future + IkiWiki::redirect($cgi, urlto($page, undef, 1)); + exit; + } + + my ($authorurl, $author) = linkuser(getcgiuser($session)); + + my $body = $form->field('body'); + $body =~ s/\r\n/\n/g; + $body =~ s/\r/\n/g; + $body .= "\n" if $body !~ /\n$/; + + $body =~ s/\[\[([^!])/[[$1/g unless $allow_wikilinks; + $body =~ s/\[\[!/[[!/g unless $allow_directives; + + # In this template, the [[!meta]] directives should stay at the end, + # so that they will override anything the user specifies. (For + # instance, [[!meta author="I can fake the author"]]...) + my $content_tmpl = template(PLUGIN . '_comment.tmpl'); + $content_tmpl->param(author => $author); + $content_tmpl->param(authorurl => $authorurl); + $content_tmpl->param(subject => $form->field('subject')); + $content_tmpl->param(body => $body); + + my $content = $content_tmpl->output; + + # This is essentially a simplified version of editpage: + # - the user does not control the page that's created, only the parent + # - it's always a create operation, never an edit + # - this means that conflicts should never happen + # - this means that if they do, rocks fall and everyone dies + + if ($form->submitted eq PREVIEW) { + my $fake = "$page/_" . PLUGIN . "hypothetical"; + my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', + IkiWiki::linkify($page, $page, + IkiWiki::preprocess($page, $page, + IkiWiki::filter($fake, $page, + $content), + 0, 1))); + IkiWiki::run_hooks(format => sub { + $preview = shift->(page => $page, + content => $preview); + }); + + my $template = template(PLUGIN . "_display.tmpl"); + $template->param(content => $preview); + $template->param(title => $form->field('subject')); + $template->param(ctime => displaytime(time)); + $template->param(author => $author); + $template->param(authorurl => $authorurl); + + $form->tmpl_param(page_preview => $template->output); + } + else { + $form->tmpl_param(page_preview => ""); + } + + if ($form->submitted eq POST_COMMENT && $form->validate) { + # Let's get posting. We don't check_canedit here because + # that somewhat defeats the point of this plugin. + + checksessionexpiry($session, $cgi->param('sid')); + + # FIXME: check that the wiki is locked right now, because + # if it's not, there are mad race conditions! + + # FIXME: rather a simplistic way to make the comments... + my $i = 0; + my $file; + do { + $i++; + $file = "$page/comment_${i}._" . PLUGIN; + } while (-e "$config{srcdir}/$file"); + + # FIXME: could probably do some sort of graceful retry + # if I could be bothered + writefile($file, $config{srcdir}, $content); + + my $conflict; + + if ($config{rcs} and $commit_comments) { + my $message = "Added a comment"; + if (defined $form->field('subject') && + length $form->field('subject')) { + $message = "Added a comment: " . + $form->field('subject'); + } + + IkiWiki::rcs_add($file); + IkiWiki::disable_commit_hook(); + $conflict = IkiWiki::rcs_commit_staged($message, + $session->param('name'), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + + # Now we need a refresh + require IkiWiki::Render; + IkiWiki::refresh(); + IkiWiki::saveindex(); + + # this should never happen, unless a committer deliberately + # breaks it or something + error($conflict) if defined $conflict; + + # Bounce back to where we were, but defeat broken caches + my $anticache = "?updated=$page/comment_$i"; + IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); + } + else { + IkiWiki::showform ($form, \@buttons, $session, $cgi, + forcebaseurl => $baseurl); + } + + exit; +} #}}} + +1 diff --git a/templates/smcvpostcomment_comment.tmpl b/templates/smcvpostcomment_comment.tmpl new file mode 100644 index 000000000..8c89458f3 --- /dev/null +++ b/templates/smcvpostcomment_comment.tmpl @@ -0,0 +1,10 @@ + + +[[!meta title=""]] + + +[[!meta author=""]] + + +[[!meta authorurl=""]] + diff --git a/templates/smcvpostcomment_display.tmpl b/templates/smcvpostcomment_display.tmpl new file mode 100644 index 000000000..32618d94d --- /dev/null +++ b/templates/smcvpostcomment_display.tmpl @@ -0,0 +1,24 @@ +

+ +
+Posted by + + + + + + + + + + +() +
+ +
+ +
+ +
+ +
diff --git a/templates/smcvpostcomment_embed.tmpl b/templates/smcvpostcomment_embed.tmpl new file mode 100644 index 000000000..2db055d51 --- /dev/null +++ b/templates/smcvpostcomment_embed.tmpl @@ -0,0 +1,11 @@ +
+
+ + +disabled="disabled" /> + + + +
+
diff --git a/templates/smcvpostcomment_form.tmpl b/templates/smcvpostcomment_form.tmpl new file mode 100644 index 000000000..9bce62396 --- /dev/null +++ b/templates/smcvpostcomment_form.tmpl @@ -0,0 +1,20 @@ + + + + + +Subject:
+
+
+ + + + +
+
+Page preview: +
+
+ +
+
-- cgit v1.2.3 From 446740cfbb621200ba8f7262a06959dbe24e2d8f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Sep 2008 19:37:52 +0100 Subject: style.css: reduce the scope of the .author rule to when it's nested in .inlineheader In the initial template for blog-style comments, I don't want the author name to be quite as large and prominent as the author of a blog post - I expect that comments will be rather short, so the author name stands out better for a given font size. --- doc/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/style.css b/doc/style.css index 5787ef65e..9086c5023 100644 --- a/doc/style.css +++ b/doc/style.css @@ -12,7 +12,7 @@ display: block; } -.author { +.inlineheader .author { margin: 0; font-size: 18px; font-weight: bold; -- cgit v1.2.3 From 7bd9f368b6ec23eb364c0ebec08516cfb75b2f18 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Sep 2008 19:42:38 +0100 Subject: Add some basic stylesheet rules for smcvpostcomment --- doc/style.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/style.css b/doc/style.css index 9086c5023..a30c5556f 100644 --- a/doc/style.css +++ b/doc/style.css @@ -372,3 +372,8 @@ legend { span.color { padding: 2px; } + +.smcvpostcomment-page .author { font-weight: bold; } +.smcvpostcomment-page { border: 1px inset #999; margin: 3px; padding: 3px; } +.smcvpostcomment-header { font-style: italic; } +.smcvpostcomment-subject { font-weight: bold; border-bottom: 1px solid #999; } -- cgit v1.2.3 From 7be3a15244d367713903ba2394d95e423fd8e89f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:08:31 +0000 Subject: Use a link rather than a button for "post comments" --- templates/smcvpostcomment_embed.tmpl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/smcvpostcomment_embed.tmpl b/templates/smcvpostcomment_embed.tmpl index 2db055d51..c1826638b 100644 --- a/templates/smcvpostcomment_embed.tmpl +++ b/templates/smcvpostcomment_embed.tmpl @@ -1,11 +1,7 @@ -
-
- - -disabled="disabled" /> +
- +Posting comments disabled: + +Post a comment
- -- cgit v1.2.3 From bd8c4674a89945d4748537fbbb15464d9963c299 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:11:24 +0000 Subject: smcvpostcomment: use gettext where appropriate --- IkiWiki/Plugin/smcvpostcomment.pm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index cb55ff94f..1255cfde1 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -38,7 +38,8 @@ sub preprocess (@) { #{{{ my %params=@_; unless (length $config{cgiurl}) { - error("this plugin makes no sense if you have no CGI"); + error(sprintf (gettext("[[!%s plugin requires CGI enabled]]"), + PLUGIN)); } my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", @@ -48,15 +49,15 @@ sub preprocess (@) { #{{{ if ($params{preview}) { $formtemplate->param("disabled" => - 'not available during Preview'); + gettext('not available during Preview')); } - debug("page $params{page} => destpage $params{page}"); + debug("page $params{page} => destpage $params{destpage}"); # I'm reasonably sure that this counts as abuse of [[!inline]] return $formtemplate->output . "\n" . IkiWiki::preprocess_inline( - pages => "internal(/$params{page}/comment_*)", + pages => "internal($params{page}/_comment_*)", template => PLUGIN . "_display", show => 0, reverse => "yes", @@ -157,7 +158,7 @@ sub sessioncgi ($$) { #{{{ $page = IkiWiki::possibly_foolish_untaint($page); if (!defined $page || !length $page || IkiWiki::file_pruned($page, $config{srcdir})) { - error ("bad page name"); + error(gettext("bad page name")); } # FIXME: is this right? Or should we be using the candidate subpage @@ -173,7 +174,9 @@ sub sessioncgi ($$) { #{{{ linktext => 'FormattingHelp')); if (not exists $pagesources{$page}) { - error ("page '$page' doesn't exist, so you can't comment"); + error(sprintf(gettext( + "page '%s' doesn't exist, so you can't comment"), + $page)); } if ($form->submitted eq CANCEL) { @@ -260,11 +263,10 @@ sub sessioncgi ($$) { #{{{ my $conflict; if ($config{rcs} and $commit_comments) { - my $message = "Added a comment"; + my $message = gettext("Added a comment"); if (defined $form->field('subject') && length $form->field('subject')) { - $message = "Added a comment: " . - $form->field('subject'); + $message .= ": ".$form->field('subject'); } IkiWiki::rcs_add($file); -- cgit v1.2.3 From 49835784d8908e07fabf4200e35adcd98b73a00c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:12:26 +0000 Subject: smcvpostcomment: use better names for special comment files --- IkiWiki/Plugin/smcvpostcomment.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 1255cfde1..3e3c2ca93 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -253,7 +253,7 @@ sub sessioncgi ($$) { #{{{ my $file; do { $i++; - $file = "$page/comment_${i}._" . PLUGIN; + $file = "$page/_comment_${i}._" . PLUGIN; } while (-e "$config{srcdir}/$file"); # FIXME: could probably do some sort of graceful retry @@ -287,7 +287,7 @@ sub sessioncgi ($$) { #{{{ error($conflict) if defined $conflict; # Bounce back to where we were, but defeat broken caches - my $anticache = "?updated=$page/comment_$i"; + my $anticache = "?updated=$page/_comment_$i"; IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); } else { -- cgit v1.2.3 From e65c7b73af6dcb9f8dc0435f17ea3beeab66f175 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:12:42 +0000 Subject: smcvpostcomment: load inline plugin more forcibly --- IkiWiki/Plugin/smcvpostcomment.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 3e3c2ca93..9d3f3e858 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -8,6 +8,7 @@ package IkiWiki::Plugin::smcvpostcomment; use warnings; use strict; use IkiWiki 2.00; +use IkiWiki::Plugin::inline; use IkiWiki::Plugin::mdwn; use CGI 'escapeHTML'; -- cgit v1.2.3 From 42b15f763394279ec5a9b4f51031b30470c4dc92 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:12:57 +0000 Subject: smcvpostcomment: avoid warnings if form field 'body' is undef --- IkiWiki/Plugin/smcvpostcomment.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 9d3f3e858..367f2d9b3 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -189,7 +189,7 @@ sub sessioncgi ($$) { #{{{ my ($authorurl, $author) = linkuser(getcgiuser($session)); - my $body = $form->field('body'); + my $body = $form->field('body') || ''; $body =~ s/\r\n/\n/g; $body =~ s/\r/\n/g; $body .= "\n" if $body !~ /\n$/; -- cgit v1.2.3 From 29862a8cc8fb9818bbc219955c2b0c5e64a640ce Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 15 Nov 2008 14:13:10 +0000 Subject: smcvpostcomment: explain what $fake is for --- IkiWiki/Plugin/smcvpostcomment.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 367f2d9b3..f224944d5 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -215,6 +215,8 @@ sub sessioncgi ($$) { #{{{ # - this means that if they do, rocks fall and everyone dies if ($form->submitted eq PREVIEW) { + # $fake is a location that has the same number of slashes + # as the eventual location of this comment. my $fake = "$page/_" . PLUGIN . "hypothetical"; my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', IkiWiki::linkify($page, $page, -- cgit v1.2.3 From 798dea20330d06690fcff11cf46aa64605b375d1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 16 Nov 2008 18:11:55 +0000 Subject: smcvpostcomment: reduce length of subject field --- IkiWiki/Plugin/smcvpostcomment.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index f224944d5..59f0e8cfc 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -149,7 +149,7 @@ sub sessioncgi ($$) { #{{{ $form->field(name => 'sid', type => 'hidden', value => $session->id, force => 1); $form->field(name => 'page', type => 'hidden'); - $form->field(name => 'subject', type => 'text', size => 80); + $form->field(name => 'subject', type => 'text', size => 72); $form->field(name => 'body', type => 'textarea', rows => 5, cols => 80); -- cgit v1.2.3 From 660a4ef151bd3da5135c9baa5b782ca373546d16 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 16 Nov 2008 18:23:23 +0000 Subject: smcvpostcomment: always allow wikilinks, and do access control wikilinks are harmless, so we might as well allow them. Access control for this plugin is a bit odd, since we specifically don't want to allow comments to be edited - so the check is whether the user is allowed to edit a deliberately invalid page name, page/commented/on[smcvpostcomment]. You can put smcvpostcomment(*) or smcvpostcomment(some/subdir/*) in $config{anonok_pagespec} or the opposite in $config{locked_pages} to allow "editing" (really just posting) comments. --- IkiWiki/Plugin/smcvpostcomment.pm | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 59f0e8cfc..43b1d3e6f 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -113,7 +113,6 @@ sub sessioncgi ($$) { #{{{ return unless $do eq PLUGIN; # These are theoretically configurable, but currently hard-coded - my $allow_wikilinks = 0; my $allow_directives = 0; my $commit_comments = 1; @@ -187,15 +186,24 @@ sub sessioncgi ($$) { #{{{ exit; } + IkiWiki::check_canedit($page . "[" . PLUGIN . "]", $cgi, $session); + my ($authorurl, $author) = linkuser(getcgiuser($session)); my $body = $form->field('body') || ''; $body =~ s/\r\n/\n/g; $body =~ s/\r/\n/g; - $body .= "\n" if $body !~ /\n$/; + $body = "\n" if $body !~ /\n$/; + + unless ($allow_directives) { + # don't allow new-style directives at all + $body =~ s/(^|[^\\])\[\[!/$1\\[[!/g; - $body =~ s/\[\[([^!])/[[$1/g unless $allow_wikilinks; - $body =~ s/\[\[!/[[!/g unless $allow_directives; + # don't allow [[ unless it begins an old-style + # wikilink, if prefix_directives is off + $body =~ s/(^|[^\\])\[\[(?![^\n\s\]+]\]\])/$1\\[[!/g + unless $config{prefix_directives}; + } # In this template, the [[!meta]] directives should stay at the end, # so that they will override anything the user specifies. (For @@ -301,4 +309,16 @@ sub sessioncgi ($$) { #{{{ exit; } #}}} +package IkiWiki::PageSpec; + +sub match_smcvpostcomment ($$;@) { + my $page = shift; + my $glob = shift; + + unless ($page =~ s/\[smcvpostcomment\]$//) { + return IkiWiki::FailReason->new("not posting a comment"); + } + return match_glob($page, $glob); +} + 1 -- cgit v1.2.3 From 1bd1b03766704bbf2271e87cf4a68978827f31fb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 09:10:06 +0000 Subject: smcvpostcomment: remove HTML if not allowed --- IkiWiki/Plugin/smcvpostcomment.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 43b1d3e6f..07f008e5e 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -205,6 +205,12 @@ sub sessioncgi ($$) { #{{{ unless $config{prefix_directives}; } + unless ($allow_html) { + $body =~ s/&(\w|#)/&$1/g; + $body =~ s//>/g; + } + # In this template, the [[!meta]] directives should stay at the end, # so that they will override anything the user specifies. (For # instance, [[!meta author="I can fake the author"]]...) -- cgit v1.2.3 From d18adfb1adedff996dfea9b20a3f1765addbec04 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 09:08:54 +0000 Subject: smcvpostcomment: indicate in form whether HTML and directives are allowed --- IkiWiki/Plugin/smcvpostcomment.pm | 4 +++- templates/smcvpostcomment_form.tmpl | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 07f008e5e..2b9f1e5dc 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -171,7 +171,9 @@ sub sessioncgi ($$) { #{{{ $form->tmpl_param('helponformattinglink', htmllink($page, $page, 'ikiwiki/formatting', noimageinline => 1, - linktext => 'FormattingHelp')); + linktext => 'FormattingHelp'), + allowhtml => $allow_html, + allowdirectives => $allow_directives); if (not exists $pagesources{$page}) { error(sprintf(gettext( diff --git a/templates/smcvpostcomment_form.tmpl b/templates/smcvpostcomment_form.tmpl index 9bce62396..7f138a450 100644 --- a/templates/smcvpostcomment_form.tmpl +++ b/templates/smcvpostcomment_form.tmpl @@ -6,8 +6,10 @@ Subject:


- - +
+HTML is not allowed.
+IkiWiki directives ([[!directive]]) are not allowed.
+
-- cgit v1.2.3 From bb4eb07bdd97ce91a4d28539ebbd1c937241c7a4 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 09:09:52 +0000 Subject: smcvpostcomment: make allowhtml etc. configurable, and don't allow commenting on pages where comments have never been allowed --- IkiWiki/Plugin/smcvpostcomment.pm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 2b9f1e5dc..562dc9ed5 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -43,6 +43,14 @@ sub preprocess (@) { #{{{ PLUGIN)); } + my $page = $params{page}; + $pagestate{$page}{PLUGIN()}{comments} = 1; + $pagestate{$page}{PLUGIN()}{allowhtml} = IkiWiki::yesno($params{allowhtml}); + $pagestate{$page}{PLUGIN()}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); + $pagestate{$page}{PLUGIN()}{commit} = defined $params{commit} + ? IkiWiki::yesno($params{commit}) + : 1; + my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", blind_cache => 1); $formtemplate->param(cgiurl => $config{cgiurl}); @@ -112,10 +120,6 @@ sub sessioncgi ($$) { #{{{ my $do = $cgi->param('do'); return unless $do eq PLUGIN; - # These are theoretically configurable, but currently hard-coded - my $allow_directives = 0; - my $commit_comments = 1; - IkiWiki::decode_cgi_utf8($cgi); eval q{use CGI::FormBuilder}; @@ -161,6 +165,12 @@ sub sessioncgi ($$) { #{{{ error(gettext("bad page name")); } + my $allow_directives = $pagestate{$page}{PLUGIN()}{allowdirectives}; + my $allow_html = $pagestate{$page}{PLUGIN()}{allowdirectives}; + my $commit_comments = defined $pagestate{$page}{PLUGIN()}{commit} + ? $pagestate{$page}{PLUGIN()}{commit} + : 1; + # FIXME: is this right? Or should we be using the candidate subpage # (whatever that might mean) as the base URL? my $baseurl = urlto($page, undef, 1); @@ -180,6 +190,11 @@ sub sessioncgi ($$) { #{{{ "page '%s' doesn't exist, so you can't comment"), $page)); } + if (not $pagestate{$page}{PLUGIN()}{comments}) { + error(sprintf(gettext( + "comments are not enabled on page '%s'"), + $page)); + } if ($form->submitted eq CANCEL) { # bounce back to the page they wanted to comment on, and exit. -- cgit v1.2.3 From 442e4e7e120be14980a0431e98784dc0ad52eee6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 09:10:50 +0000 Subject: smcvpostcomment: allow inlining to be disabled, and pass through atom etc. better --- IkiWiki/Plugin/smcvpostcomment.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 562dc9ed5..6bd3b2970 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -63,16 +63,28 @@ sub preprocess (@) { #{{{ debug("page $params{page} => destpage $params{destpage}"); - # I'm reasonably sure that this counts as abuse of [[!inline]] - return $formtemplate->output . "\n" . - IkiWiki::preprocess_inline( + my $posts = ''; + unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { + my @args = ( pages => "internal($params{page}/_comment_*)", template => PLUGIN . "_display", show => 0, reverse => "yes", + # special stuff passed through page => $params{page}, destpage => $params{destpage}, - preview => $params{preview}); + preview => $params{preview}, + ); + push @args, atom => $params{atom} if defined $params{atom}; + push @args, rss => $params{rss} if defined $params{rss}; + push @args, feeds => $params{feeds} if defined $params{feeds}; + push @args, feedshow => $params{feedshow} if defined $params{feedshow}; + push @args, timeformat => $params{timeformat} if defined $params{timeformat}; + push @args, feedonly => $params{feedonly} if defined $params{feedonly}; + $posts = "\n" . IkiWiki::preprocess_inline(@args); + } + + return $formtemplate->output . $posts; } # }}} # FIXME: logic taken from editpage, should be common code? -- cgit v1.2.3 From 2857b301e76dba92f550ac3f5077dcad068d2686 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 10:40:49 +0000 Subject: smcvpostcomment_*.tmpl: make class names match template names Also put "posting comments disabled" in [], and change "Page preview" to "Comment preview". --- doc/style.css | 4 ++-- templates/smcvpostcomment_display.tmpl | 4 ++-- templates/smcvpostcomment_embed.tmpl | 4 ++-- templates/smcvpostcomment_form.tmpl | 9 ++++++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/style.css b/doc/style.css index a30c5556f..896ac2b01 100644 --- a/doc/style.css +++ b/doc/style.css @@ -373,7 +373,7 @@ span.color { padding: 2px; } -.smcvpostcomment-page .author { font-weight: bold; } -.smcvpostcomment-page { border: 1px inset #999; margin: 3px; padding: 3px; } +.smcvpostcomment-display .author { font-weight: bold; } +.smcvpostcomment-display { border: 1px inset #999; margin: 3px; padding: 3px; } .smcvpostcomment-header { font-style: italic; } .smcvpostcomment-subject { font-weight: bold; border-bottom: 1px solid #999; } diff --git a/templates/smcvpostcomment_display.tmpl b/templates/smcvpostcomment_display.tmpl index 32618d94d..1b67f9094 100644 --- a/templates/smcvpostcomment_display.tmpl +++ b/templates/smcvpostcomment_display.tmpl @@ -1,4 +1,4 @@ -
+
Posted by @@ -21,4 +21,4 @@ Posted by
-
+
diff --git a/templates/smcvpostcomment_embed.tmpl b/templates/smcvpostcomment_embed.tmpl index c1826638b..db35e4da7 100644 --- a/templates/smcvpostcomment_embed.tmpl +++ b/templates/smcvpostcomment_embed.tmpl @@ -1,6 +1,6 @@ -
+
-Posting comments disabled: +[Posting comments disabled: ] Post a comment diff --git a/templates/smcvpostcomment_form.tmpl b/templates/smcvpostcomment_form.tmpl index 7f138a450..43fc9b65a 100644 --- a/templates/smcvpostcomment_form.tmpl +++ b/templates/smcvpostcomment_form.tmpl @@ -1,3 +1,4 @@ +
@@ -14,9 +15,11 @@ IkiWiki directives ([[!directive]]) are not
-Page preview: -
+Comment preview: +
-
+
+ +
-- cgit v1.2.3 From f49603bf8638ab539151114445e0b132fb518941 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 10:41:50 +0000 Subject: smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI --- IkiWiki/Plugin/smcvpostcomment.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 6bd3b2970..40ffe8164 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -8,9 +8,6 @@ package IkiWiki::Plugin::smcvpostcomment; use warnings; use strict; use IkiWiki 2.00; -use IkiWiki::Plugin::inline; -use IkiWiki::Plugin::mdwn; -use CGI 'escapeHTML'; use constant PLUGIN => "smcvpostcomment"; use constant PREVIEW => "Preview"; @@ -24,6 +21,13 @@ sub import { #{{{ hook(type => "htmlize", id => "_".PLUGIN, call => \&IkiWiki::Plugin::mdwn::htmlize); IkiWiki::loadplugin("inline"); + IkiWiki::loadplugin("mdwn"); +} # }}} + +sub htmlize { # {{{ + eval { use IkiWiki::Plugin::mdwn; }; + error($@) if ($@); + return IkiWiki::Plugin::mdwn::htmlize(@_) } # }}} sub getsetup () { #{{{ @@ -65,6 +69,8 @@ sub preprocess (@) { #{{{ my $posts = ''; unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { + eval { use IkiWiki::Plugin::inline; }; + error($@) if ($@); my @args = ( pages => "internal($params{page}/_comment_*)", template => PLUGIN . "_display", -- cgit v1.2.3 From b7db3444a5d8e31bb1df60c3617f1038d93e099e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 10:42:01 +0000 Subject: smcvpostcomment: allow commenting to be closed --- IkiWiki/Plugin/smcvpostcomment.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm index 40ffe8164..22958c84a 100644 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ b/IkiWiki/Plugin/smcvpostcomment.pm @@ -48,7 +48,9 @@ sub preprocess (@) { #{{{ } my $page = $params{page}; - $pagestate{$page}{PLUGIN()}{comments} = 1; + $pagestate{$page}{PLUGIN()}{comments} = defined $params{closed} + ? (not IkiWiki::yesno($params{closed})) + : 1; $pagestate{$page}{PLUGIN()}{allowhtml} = IkiWiki::yesno($params{allowhtml}); $pagestate{$page}{PLUGIN()}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); $pagestate{$page}{PLUGIN()}{commit} = defined $params{commit} @@ -60,7 +62,11 @@ sub preprocess (@) { #{{{ $formtemplate->param(cgiurl => $config{cgiurl}); $formtemplate->param(page => $params{page}); - if ($params{preview}) { + if (not $pagestate{$page}{PLUGIN()}{comments}) { + $formtemplate->param("disabled" => + gettext('comments are closed')); + } + elsif ($params{preview}) { $formtemplate->param("disabled" => gettext('not available during Preview')); } -- cgit v1.2.3 From 3c9ccb406b2260c149be387508a097fe6fdb3c93 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 17 Nov 2008 11:16:31 +0000 Subject: Rename smcvpostcomment plugin to postcomment to propose for inclusion --- IkiWiki/Plugin/postcomment.pm | 371 +++++++++++++++++++++++++++++++++ IkiWiki/Plugin/smcvpostcomment.pm | 371 --------------------------------- doc/style.css | 8 +- templates/postcomment_comment.tmpl | 10 + templates/postcomment_display.tmpl | 24 +++ templates/postcomment_embed.tmpl | 7 + templates/postcomment_form.tmpl | 25 +++ templates/smcvpostcomment_comment.tmpl | 10 - templates/smcvpostcomment_display.tmpl | 24 --- templates/smcvpostcomment_embed.tmpl | 7 - templates/smcvpostcomment_form.tmpl | 25 --- 11 files changed, 441 insertions(+), 441 deletions(-) create mode 100644 IkiWiki/Plugin/postcomment.pm delete mode 100644 IkiWiki/Plugin/smcvpostcomment.pm create mode 100644 templates/postcomment_comment.tmpl create mode 100644 templates/postcomment_display.tmpl create mode 100644 templates/postcomment_embed.tmpl create mode 100644 templates/postcomment_form.tmpl delete mode 100644 templates/smcvpostcomment_comment.tmpl delete mode 100644 templates/smcvpostcomment_display.tmpl delete mode 100644 templates/smcvpostcomment_embed.tmpl delete mode 100644 templates/smcvpostcomment_form.tmpl diff --git a/IkiWiki/Plugin/postcomment.pm b/IkiWiki/Plugin/postcomment.pm new file mode 100644 index 000000000..480ca58a5 --- /dev/null +++ b/IkiWiki/Plugin/postcomment.pm @@ -0,0 +1,371 @@ +#!/usr/bin/perl +# Copyright © 2006-2008 Joey Hess +# Copyright © 2008 Simon McVittie +# Licensed under the GNU GPL, version 2, or any later version published by the +# Free Software Foundation +package IkiWiki::Plugin::postcomment; + +use warnings; +use strict; +use IkiWiki 2.00; + +use constant PLUGIN => "postcomment"; +use constant PREVIEW => "Preview"; +use constant POST_COMMENT => "Post comment"; +use constant CANCEL => "Cancel"; + +sub import { #{{{ + hook(type => "getsetup", id => PLUGIN, call => \&getsetup); + hook(type => "preprocess", id => PLUGIN, call => \&preprocess); + hook(type => "sessioncgi", id => PLUGIN, call => \&sessioncgi); + hook(type => "htmlize", id => "_".PLUGIN, + call => \&IkiWiki::Plugin::mdwn::htmlize); + IkiWiki::loadplugin("inline"); + IkiWiki::loadplugin("mdwn"); +} # }}} + +sub htmlize { # {{{ + eval { use IkiWiki::Plugin::mdwn; }; + error($@) if ($@); + return IkiWiki::Plugin::mdwn::htmlize(@_) +} # }}} + +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => undef, + }, +} #}}} + +# Somewhat based on IkiWiki::Plugin::inline blog posting support +sub preprocess (@) { #{{{ + my %params=@_; + + unless (length $config{cgiurl}) { + error(sprintf (gettext("[[!%s plugin requires CGI enabled]]"), + PLUGIN)); + } + + my $page = $params{page}; + $pagestate{$page}{PLUGIN()}{comments} = defined $params{closed} + ? (not IkiWiki::yesno($params{closed})) + : 1; + $pagestate{$page}{PLUGIN()}{allowhtml} = IkiWiki::yesno($params{allowhtml}); + $pagestate{$page}{PLUGIN()}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); + $pagestate{$page}{PLUGIN()}{commit} = defined $params{commit} + ? IkiWiki::yesno($params{commit}) + : 1; + + my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", + blind_cache => 1); + $formtemplate->param(cgiurl => $config{cgiurl}); + $formtemplate->param(page => $params{page}); + + if (not $pagestate{$page}{PLUGIN()}{comments}) { + $formtemplate->param("disabled" => + gettext('comments are closed')); + } + elsif ($params{preview}) { + $formtemplate->param("disabled" => + gettext('not available during Preview')); + } + + debug("page $params{page} => destpage $params{destpage}"); + + my $posts = ''; + unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { + eval { use IkiWiki::Plugin::inline; }; + error($@) if ($@); + my @args = ( + pages => "internal($params{page}/_comment_*)", + template => PLUGIN . "_display", + show => 0, + reverse => "yes", + # special stuff passed through + page => $params{page}, + destpage => $params{destpage}, + preview => $params{preview}, + ); + push @args, atom => $params{atom} if defined $params{atom}; + push @args, rss => $params{rss} if defined $params{rss}; + push @args, feeds => $params{feeds} if defined $params{feeds}; + push @args, feedshow => $params{feedshow} if defined $params{feedshow}; + push @args, timeformat => $params{timeformat} if defined $params{timeformat}; + push @args, feedonly => $params{feedonly} if defined $params{feedonly}; + $posts = "\n" . IkiWiki::preprocess_inline(@args); + } + + return $formtemplate->output . $posts; +} # }}} + +# FIXME: logic taken from editpage, should be common code? +sub getcgiuser ($) { # {{{ + my $session = shift; + my $user = $session->param('name'); + $user = $ENV{REMOTE_ADDR} unless defined $user; + debug("getcgiuser() -> $user"); + return $user; +} # }}} + +# FIXME: logic adapted from recentchanges, should be common code? +sub linkuser ($) { # {{{ + my $user = shift; + my $oiduser = eval { IkiWiki::openiduser($user) }; + + if (defined $oiduser) { + return ($user, $oiduser); + } + else { + my $page = bestlink('', (length $config{userdir} + ? "$config{userdir}/" + : "").$user); + return (urlto($page, undef, 1), $user); + } +} # }}} + +# FIXME: taken from IkiWiki::Plugin::editpage, should be common? +sub checksessionexpiry ($$) { # {{{ + my $session = shift; + my $sid = shift; + + if (defined $session->param("name")) { + if (! defined $sid || $sid ne $session->id) { + error(gettext("Your login session has expired.")); + } + } +} # }}} + +# Mostly cargo-culted from IkiWiki::plugin::editpage +sub sessioncgi ($$) { #{{{ + my $cgi=shift; + my $session=shift; + + my $do = $cgi->param('do'); + return unless $do eq PLUGIN; + + IkiWiki::decode_cgi_utf8($cgi); + + eval q{use CGI::FormBuilder}; + error($@) if $@; + + my @buttons = (POST_COMMENT, PREVIEW, CANCEL); + my $form = CGI::FormBuilder->new( + fields => [qw{do sid page subject body}], + charset => 'utf-8', + method => 'POST', + required => [qw{body}], + javascript => 0, + params => $cgi, + action => $config{cgiurl}, + header => 0, + table => 0, + template => scalar IkiWiki::template_params(PLUGIN . '_form.tmpl'), + # wtf does this do in editpage? + wikiname => $config{wikiname}, + ); + + IkiWiki::decode_form_utf8($form); + IkiWiki::run_hooks(formbuilder_setup => sub { + shift->(title => PLUGIN, form => $form, cgi => $cgi, + session => $session, buttons => \@buttons); + }); + IkiWiki::decode_form_utf8($form); + + $form->field(name => 'do', type => 'hidden'); + $form->field(name => 'sid', type => 'hidden', value => $session->id, + force => 1); + $form->field(name => 'page', type => 'hidden'); + $form->field(name => 'subject', type => 'text', size => 72); + $form->field(name => 'body', type => 'textarea', rows => 5, + cols => 80); + + # The untaint is OK (as in editpage) because we're about to pass + # it to file_pruned anyway + my $page = $form->field('page'); + $page = IkiWiki::possibly_foolish_untaint($page); + if (!defined $page || !length $page || + IkiWiki::file_pruned($page, $config{srcdir})) { + error(gettext("bad page name")); + } + + my $allow_directives = $pagestate{$page}{PLUGIN()}{allowdirectives}; + my $allow_html = $pagestate{$page}{PLUGIN()}{allowdirectives}; + my $commit_comments = defined $pagestate{$page}{PLUGIN()}{commit} + ? $pagestate{$page}{PLUGIN()}{commit} + : 1; + + # FIXME: is this right? Or should we be using the candidate subpage + # (whatever that might mean) as the base URL? + my $baseurl = urlto($page, undef, 1); + + $form->title(sprintf(gettext("commenting on %s"), + IkiWiki::pagetitle($page))); + + $form->tmpl_param('helponformattinglink', + htmllink($page, $page, 'ikiwiki/formatting', + noimageinline => 1, + linktext => 'FormattingHelp'), + allowhtml => $allow_html, + allowdirectives => $allow_directives); + + if (not exists $pagesources{$page}) { + error(sprintf(gettext( + "page '%s' doesn't exist, so you can't comment"), + $page)); + } + if (not $pagestate{$page}{PLUGIN()}{comments}) { + error(sprintf(gettext( + "comments are not enabled on page '%s'"), + $page)); + } + + if ($form->submitted eq CANCEL) { + # bounce back to the page they wanted to comment on, and exit. + # CANCEL need not be considered in future + IkiWiki::redirect($cgi, urlto($page, undef, 1)); + exit; + } + + IkiWiki::check_canedit($page . "[" . PLUGIN . "]", $cgi, $session); + + my ($authorurl, $author) = linkuser(getcgiuser($session)); + + my $body = $form->field('body') || ''; + $body =~ s/\r\n/\n/g; + $body =~ s/\r/\n/g; + $body = "\n" if $body !~ /\n$/; + + unless ($allow_directives) { + # don't allow new-style directives at all + $body =~ s/(^|[^\\])\[\[!/$1\\[[!/g; + + # don't allow [[ unless it begins an old-style + # wikilink, if prefix_directives is off + $body =~ s/(^|[^\\])\[\[(?![^\n\s\]+]\]\])/$1\\[[!/g + unless $config{prefix_directives}; + } + + unless ($allow_html) { + $body =~ s/&(\w|#)/&$1/g; + $body =~ s//>/g; + } + + # In this template, the [[!meta]] directives should stay at the end, + # so that they will override anything the user specifies. (For + # instance, [[!meta author="I can fake the author"]]...) + my $content_tmpl = template(PLUGIN . '_comment.tmpl'); + $content_tmpl->param(author => $author); + $content_tmpl->param(authorurl => $authorurl); + $content_tmpl->param(subject => $form->field('subject')); + $content_tmpl->param(body => $body); + + my $content = $content_tmpl->output; + + # This is essentially a simplified version of editpage: + # - the user does not control the page that's created, only the parent + # - it's always a create operation, never an edit + # - this means that conflicts should never happen + # - this means that if they do, rocks fall and everyone dies + + if ($form->submitted eq PREVIEW) { + # $fake is a location that has the same number of slashes + # as the eventual location of this comment. + my $fake = "$page/_" . PLUGIN . "hypothetical"; + my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', + IkiWiki::linkify($page, $page, + IkiWiki::preprocess($page, $page, + IkiWiki::filter($fake, $page, + $content), + 0, 1))); + IkiWiki::run_hooks(format => sub { + $preview = shift->(page => $page, + content => $preview); + }); + + my $template = template(PLUGIN . "_display.tmpl"); + $template->param(content => $preview); + $template->param(title => $form->field('subject')); + $template->param(ctime => displaytime(time)); + $template->param(author => $author); + $template->param(authorurl => $authorurl); + + $form->tmpl_param(page_preview => $template->output); + } + else { + $form->tmpl_param(page_preview => ""); + } + + if ($form->submitted eq POST_COMMENT && $form->validate) { + # Let's get posting. We don't check_canedit here because + # that somewhat defeats the point of this plugin. + + checksessionexpiry($session, $cgi->param('sid')); + + # FIXME: check that the wiki is locked right now, because + # if it's not, there are mad race conditions! + + # FIXME: rather a simplistic way to make the comments... + my $i = 0; + my $file; + do { + $i++; + $file = "$page/_comment_${i}._" . PLUGIN; + } while (-e "$config{srcdir}/$file"); + + # FIXME: could probably do some sort of graceful retry + # if I could be bothered + writefile($file, $config{srcdir}, $content); + + my $conflict; + + if ($config{rcs} and $commit_comments) { + my $message = gettext("Added a comment"); + if (defined $form->field('subject') && + length $form->field('subject')) { + $message .= ": ".$form->field('subject'); + } + + IkiWiki::rcs_add($file); + IkiWiki::disable_commit_hook(); + $conflict = IkiWiki::rcs_commit_staged($message, + $session->param('name'), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + + # Now we need a refresh + require IkiWiki::Render; + IkiWiki::refresh(); + IkiWiki::saveindex(); + + # this should never happen, unless a committer deliberately + # breaks it or something + error($conflict) if defined $conflict; + + # Bounce back to where we were, but defeat broken caches + my $anticache = "?updated=$page/_comment_$i"; + IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); + } + else { + IkiWiki::showform ($form, \@buttons, $session, $cgi, + forcebaseurl => $baseurl); + } + + exit; +} #}}} + +package IkiWiki::PageSpec; + +sub match_postcomment ($$;@) { + my $page = shift; + my $glob = shift; + + unless ($page =~ s/\[postcomment\]$//) { + return IkiWiki::FailReason->new("not posting a comment"); + } + return match_glob($page, $glob); +} + +1 diff --git a/IkiWiki/Plugin/smcvpostcomment.pm b/IkiWiki/Plugin/smcvpostcomment.pm deleted file mode 100644 index 22958c84a..000000000 --- a/IkiWiki/Plugin/smcvpostcomment.pm +++ /dev/null @@ -1,371 +0,0 @@ -#!/usr/bin/perl -# Copyright © 2006-2008 Joey Hess -# Copyright © 2008 Simon McVittie -# Licensed under the GNU GPL, version 2, or any later version published by the -# Free Software Foundation -package IkiWiki::Plugin::smcvpostcomment; - -use warnings; -use strict; -use IkiWiki 2.00; - -use constant PLUGIN => "smcvpostcomment"; -use constant PREVIEW => "Preview"; -use constant POST_COMMENT => "Post comment"; -use constant CANCEL => "Cancel"; - -sub import { #{{{ - hook(type => "getsetup", id => PLUGIN, call => \&getsetup); - hook(type => "preprocess", id => PLUGIN, call => \&preprocess); - hook(type => "sessioncgi", id => PLUGIN, call => \&sessioncgi); - hook(type => "htmlize", id => "_".PLUGIN, - call => \&IkiWiki::Plugin::mdwn::htmlize); - IkiWiki::loadplugin("inline"); - IkiWiki::loadplugin("mdwn"); -} # }}} - -sub htmlize { # {{{ - eval { use IkiWiki::Plugin::mdwn; }; - error($@) if ($@); - return IkiWiki::Plugin::mdwn::htmlize(@_) -} # }}} - -sub getsetup () { #{{{ - return - plugin => { - safe => 1, - rebuild => undef, - }, -} #}}} - -# Somewhat based on IkiWiki::Plugin::inline blog posting support -sub preprocess (@) { #{{{ - my %params=@_; - - unless (length $config{cgiurl}) { - error(sprintf (gettext("[[!%s plugin requires CGI enabled]]"), - PLUGIN)); - } - - my $page = $params{page}; - $pagestate{$page}{PLUGIN()}{comments} = defined $params{closed} - ? (not IkiWiki::yesno($params{closed})) - : 1; - $pagestate{$page}{PLUGIN()}{allowhtml} = IkiWiki::yesno($params{allowhtml}); - $pagestate{$page}{PLUGIN()}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); - $pagestate{$page}{PLUGIN()}{commit} = defined $params{commit} - ? IkiWiki::yesno($params{commit}) - : 1; - - my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", - blind_cache => 1); - $formtemplate->param(cgiurl => $config{cgiurl}); - $formtemplate->param(page => $params{page}); - - if (not $pagestate{$page}{PLUGIN()}{comments}) { - $formtemplate->param("disabled" => - gettext('comments are closed')); - } - elsif ($params{preview}) { - $formtemplate->param("disabled" => - gettext('not available during Preview')); - } - - debug("page $params{page} => destpage $params{destpage}"); - - my $posts = ''; - unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { - eval { use IkiWiki::Plugin::inline; }; - error($@) if ($@); - my @args = ( - pages => "internal($params{page}/_comment_*)", - template => PLUGIN . "_display", - show => 0, - reverse => "yes", - # special stuff passed through - page => $params{page}, - destpage => $params{destpage}, - preview => $params{preview}, - ); - push @args, atom => $params{atom} if defined $params{atom}; - push @args, rss => $params{rss} if defined $params{rss}; - push @args, feeds => $params{feeds} if defined $params{feeds}; - push @args, feedshow => $params{feedshow} if defined $params{feedshow}; - push @args, timeformat => $params{timeformat} if defined $params{timeformat}; - push @args, feedonly => $params{feedonly} if defined $params{feedonly}; - $posts = "\n" . IkiWiki::preprocess_inline(@args); - } - - return $formtemplate->output . $posts; -} # }}} - -# FIXME: logic taken from editpage, should be common code? -sub getcgiuser ($) { # {{{ - my $session = shift; - my $user = $session->param('name'); - $user = $ENV{REMOTE_ADDR} unless defined $user; - debug("getcgiuser() -> $user"); - return $user; -} # }}} - -# FIXME: logic adapted from recentchanges, should be common code? -sub linkuser ($) { # {{{ - my $user = shift; - my $oiduser = eval { IkiWiki::openiduser($user) }; - - if (defined $oiduser) { - return ($user, $oiduser); - } - else { - my $page = bestlink('', (length $config{userdir} - ? "$config{userdir}/" - : "").$user); - return (urlto($page, undef, 1), $user); - } -} # }}} - -# FIXME: taken from IkiWiki::Plugin::editpage, should be common? -sub checksessionexpiry ($$) { # {{{ - my $session = shift; - my $sid = shift; - - if (defined $session->param("name")) { - if (! defined $sid || $sid ne $session->id) { - error(gettext("Your login session has expired.")); - } - } -} # }}} - -# Mostly cargo-culted from IkiWiki::plugin::editpage -sub sessioncgi ($$) { #{{{ - my $cgi=shift; - my $session=shift; - - my $do = $cgi->param('do'); - return unless $do eq PLUGIN; - - IkiWiki::decode_cgi_utf8($cgi); - - eval q{use CGI::FormBuilder}; - error($@) if $@; - - my @buttons = (POST_COMMENT, PREVIEW, CANCEL); - my $form = CGI::FormBuilder->new( - fields => [qw{do sid page subject body}], - charset => 'utf-8', - method => 'POST', - required => [qw{body}], - javascript => 0, - params => $cgi, - action => $config{cgiurl}, - header => 0, - table => 0, - template => scalar IkiWiki::template_params(PLUGIN . '_form.tmpl'), - # wtf does this do in editpage? - wikiname => $config{wikiname}, - ); - - IkiWiki::decode_form_utf8($form); - IkiWiki::run_hooks(formbuilder_setup => sub { - shift->(title => PLUGIN, form => $form, cgi => $cgi, - session => $session, buttons => \@buttons); - }); - IkiWiki::decode_form_utf8($form); - - $form->field(name => 'do', type => 'hidden'); - $form->field(name => 'sid', type => 'hidden', value => $session->id, - force => 1); - $form->field(name => 'page', type => 'hidden'); - $form->field(name => 'subject', type => 'text', size => 72); - $form->field(name => 'body', type => 'textarea', rows => 5, - cols => 80); - - # The untaint is OK (as in editpage) because we're about to pass - # it to file_pruned anyway - my $page = $form->field('page'); - $page = IkiWiki::possibly_foolish_untaint($page); - if (!defined $page || !length $page || - IkiWiki::file_pruned($page, $config{srcdir})) { - error(gettext("bad page name")); - } - - my $allow_directives = $pagestate{$page}{PLUGIN()}{allowdirectives}; - my $allow_html = $pagestate{$page}{PLUGIN()}{allowdirectives}; - my $commit_comments = defined $pagestate{$page}{PLUGIN()}{commit} - ? $pagestate{$page}{PLUGIN()}{commit} - : 1; - - # FIXME: is this right? Or should we be using the candidate subpage - # (whatever that might mean) as the base URL? - my $baseurl = urlto($page, undef, 1); - - $form->title(sprintf(gettext("commenting on %s"), - IkiWiki::pagetitle($page))); - - $form->tmpl_param('helponformattinglink', - htmllink($page, $page, 'ikiwiki/formatting', - noimageinline => 1, - linktext => 'FormattingHelp'), - allowhtml => $allow_html, - allowdirectives => $allow_directives); - - if (not exists $pagesources{$page}) { - error(sprintf(gettext( - "page '%s' doesn't exist, so you can't comment"), - $page)); - } - if (not $pagestate{$page}{PLUGIN()}{comments}) { - error(sprintf(gettext( - "comments are not enabled on page '%s'"), - $page)); - } - - if ($form->submitted eq CANCEL) { - # bounce back to the page they wanted to comment on, and exit. - # CANCEL need not be considered in future - IkiWiki::redirect($cgi, urlto($page, undef, 1)); - exit; - } - - IkiWiki::check_canedit($page . "[" . PLUGIN . "]", $cgi, $session); - - my ($authorurl, $author) = linkuser(getcgiuser($session)); - - my $body = $form->field('body') || ''; - $body =~ s/\r\n/\n/g; - $body =~ s/\r/\n/g; - $body = "\n" if $body !~ /\n$/; - - unless ($allow_directives) { - # don't allow new-style directives at all - $body =~ s/(^|[^\\])\[\[!/$1\\[[!/g; - - # don't allow [[ unless it begins an old-style - # wikilink, if prefix_directives is off - $body =~ s/(^|[^\\])\[\[(?![^\n\s\]+]\]\])/$1\\[[!/g - unless $config{prefix_directives}; - } - - unless ($allow_html) { - $body =~ s/&(\w|#)/&$1/g; - $body =~ s//>/g; - } - - # In this template, the [[!meta]] directives should stay at the end, - # so that they will override anything the user specifies. (For - # instance, [[!meta author="I can fake the author"]]...) - my $content_tmpl = template(PLUGIN . '_comment.tmpl'); - $content_tmpl->param(author => $author); - $content_tmpl->param(authorurl => $authorurl); - $content_tmpl->param(subject => $form->field('subject')); - $content_tmpl->param(body => $body); - - my $content = $content_tmpl->output; - - # This is essentially a simplified version of editpage: - # - the user does not control the page that's created, only the parent - # - it's always a create operation, never an edit - # - this means that conflicts should never happen - # - this means that if they do, rocks fall and everyone dies - - if ($form->submitted eq PREVIEW) { - # $fake is a location that has the same number of slashes - # as the eventual location of this comment. - my $fake = "$page/_" . PLUGIN . "hypothetical"; - my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', - IkiWiki::linkify($page, $page, - IkiWiki::preprocess($page, $page, - IkiWiki::filter($fake, $page, - $content), - 0, 1))); - IkiWiki::run_hooks(format => sub { - $preview = shift->(page => $page, - content => $preview); - }); - - my $template = template(PLUGIN . "_display.tmpl"); - $template->param(content => $preview); - $template->param(title => $form->field('subject')); - $template->param(ctime => displaytime(time)); - $template->param(author => $author); - $template->param(authorurl => $authorurl); - - $form->tmpl_param(page_preview => $template->output); - } - else { - $form->tmpl_param(page_preview => ""); - } - - if ($form->submitted eq POST_COMMENT && $form->validate) { - # Let's get posting. We don't check_canedit here because - # that somewhat defeats the point of this plugin. - - checksessionexpiry($session, $cgi->param('sid')); - - # FIXME: check that the wiki is locked right now, because - # if it's not, there are mad race conditions! - - # FIXME: rather a simplistic way to make the comments... - my $i = 0; - my $file; - do { - $i++; - $file = "$page/_comment_${i}._" . PLUGIN; - } while (-e "$config{srcdir}/$file"); - - # FIXME: could probably do some sort of graceful retry - # if I could be bothered - writefile($file, $config{srcdir}, $content); - - my $conflict; - - if ($config{rcs} and $commit_comments) { - my $message = gettext("Added a comment"); - if (defined $form->field('subject') && - length $form->field('subject')) { - $message .= ": ".$form->field('subject'); - } - - IkiWiki::rcs_add($file); - IkiWiki::disable_commit_hook(); - $conflict = IkiWiki::rcs_commit_staged($message, - $session->param('name'), $ENV{REMOTE_ADDR}); - IkiWiki::enable_commit_hook(); - IkiWiki::rcs_update(); - } - - # Now we need a refresh - require IkiWiki::Render; - IkiWiki::refresh(); - IkiWiki::saveindex(); - - # this should never happen, unless a committer deliberately - # breaks it or something - error($conflict) if defined $conflict; - - # Bounce back to where we were, but defeat broken caches - my $anticache = "?updated=$page/_comment_$i"; - IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); - } - else { - IkiWiki::showform ($form, \@buttons, $session, $cgi, - forcebaseurl => $baseurl); - } - - exit; -} #}}} - -package IkiWiki::PageSpec; - -sub match_smcvpostcomment ($$;@) { - my $page = shift; - my $glob = shift; - - unless ($page =~ s/\[smcvpostcomment\]$//) { - return IkiWiki::FailReason->new("not posting a comment"); - } - return match_glob($page, $glob); -} - -1 diff --git a/doc/style.css b/doc/style.css index 896ac2b01..21ea9492c 100644 --- a/doc/style.css +++ b/doc/style.css @@ -373,7 +373,7 @@ span.color { padding: 2px; } -.smcvpostcomment-display .author { font-weight: bold; } -.smcvpostcomment-display { border: 1px inset #999; margin: 3px; padding: 3px; } -.smcvpostcomment-header { font-style: italic; } -.smcvpostcomment-subject { font-weight: bold; border-bottom: 1px solid #999; } +.postcomment-display .author { font-weight: bold; } +.postcomment-display { border: 1px inset #999; margin: 3px; padding: 3px; } +.postcomment-header { font-style: italic; } +.postcomment-subject { font-weight: bold; border-bottom: 1px solid #999; } diff --git a/templates/postcomment_comment.tmpl b/templates/postcomment_comment.tmpl new file mode 100644 index 000000000..8c89458f3 --- /dev/null +++ b/templates/postcomment_comment.tmpl @@ -0,0 +1,10 @@ + + +[[!meta title=""]] + + +[[!meta author=""]] + + +[[!meta authorurl=""]] + diff --git a/templates/postcomment_display.tmpl b/templates/postcomment_display.tmpl new file mode 100644 index 000000000..d3eabb3a1 --- /dev/null +++ b/templates/postcomment_display.tmpl @@ -0,0 +1,24 @@ +
+ +
+Posted by + + + + + + + + + + +() +
+ +
+ +
+ +
+ +
diff --git a/templates/postcomment_embed.tmpl b/templates/postcomment_embed.tmpl new file mode 100644 index 000000000..eae741214 --- /dev/null +++ b/templates/postcomment_embed.tmpl @@ -0,0 +1,7 @@ +
+ +[Posting comments disabled: ] + +Post a comment + +
diff --git a/templates/postcomment_form.tmpl b/templates/postcomment_form.tmpl new file mode 100644 index 000000000..293f0f17e --- /dev/null +++ b/templates/postcomment_form.tmpl @@ -0,0 +1,25 @@ +
+ + + + + +Subject:
+
+
+
+HTML is not allowed.
+IkiWiki directives ([[!directive]]) are not allowed.
+ + + +
+
+Comment preview: +
+
+ +
+
+ +
diff --git a/templates/smcvpostcomment_comment.tmpl b/templates/smcvpostcomment_comment.tmpl deleted file mode 100644 index 8c89458f3..000000000 --- a/templates/smcvpostcomment_comment.tmpl +++ /dev/null @@ -1,10 +0,0 @@ - - -[[!meta title=""]] - - -[[!meta author=""]] - - -[[!meta authorurl=""]] - diff --git a/templates/smcvpostcomment_display.tmpl b/templates/smcvpostcomment_display.tmpl deleted file mode 100644 index 1b67f9094..000000000 --- a/templates/smcvpostcomment_display.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -
- -
-Posted by - - - - - - - - - - -() -
- -
- -
- -
- -
diff --git a/templates/smcvpostcomment_embed.tmpl b/templates/smcvpostcomment_embed.tmpl deleted file mode 100644 index db35e4da7..000000000 --- a/templates/smcvpostcomment_embed.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -
- -[Posting comments disabled: ] - -Post a comment - -
diff --git a/templates/smcvpostcomment_form.tmpl b/templates/smcvpostcomment_form.tmpl deleted file mode 100644 index 43fc9b65a..000000000 --- a/templates/smcvpostcomment_form.tmpl +++ /dev/null @@ -1,25 +0,0 @@ -
- - - - - -Subject:
-
-
-
-HTML is not allowed.
-IkiWiki directives ([[!directive]]) are not allowed.
- - - -
-
-Comment preview: -
-
- -
-
- -
-- cgit v1.2.3 From 3d4aa065d6a689a017c98e7ea8b80da0b65ae361 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:17:18 +0000 Subject: postcomment: Rename plugin to comments, use *._comment files The PageSpec is still called "postcomment" since that's what it means. --- IkiWiki/Plugin/comments.pm | 369 ++++++++++++++++++++++++++++++++++++ IkiWiki/Plugin/postcomment.pm | 371 ------------------------------------- doc/style.css | 8 +- templates/comments_comment.tmpl | 10 + templates/comments_display.tmpl | 24 +++ templates/comments_embed.tmpl | 7 + templates/comments_form.tmpl | 25 +++ templates/postcomment_comment.tmpl | 10 - templates/postcomment_display.tmpl | 24 --- templates/postcomment_embed.tmpl | 7 - templates/postcomment_form.tmpl | 25 --- 11 files changed, 439 insertions(+), 441 deletions(-) create mode 100644 IkiWiki/Plugin/comments.pm delete mode 100644 IkiWiki/Plugin/postcomment.pm create mode 100644 templates/comments_comment.tmpl create mode 100644 templates/comments_display.tmpl create mode 100644 templates/comments_embed.tmpl create mode 100644 templates/comments_form.tmpl delete mode 100644 templates/postcomment_comment.tmpl delete mode 100644 templates/postcomment_display.tmpl delete mode 100644 templates/postcomment_embed.tmpl delete mode 100644 templates/postcomment_form.tmpl diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm new file mode 100644 index 000000000..b57735545 --- /dev/null +++ b/IkiWiki/Plugin/comments.pm @@ -0,0 +1,369 @@ +#!/usr/bin/perl +# Copyright © 2006-2008 Joey Hess +# Copyright © 2008 Simon McVittie +# Licensed under the GNU GPL, version 2, or any later version published by the +# Free Software Foundation +package IkiWiki::Plugin::comments; + +use warnings; +use strict; +use IkiWiki 2.00; + +use constant PREVIEW => "Preview"; +use constant POST_COMMENT => "Post comment"; +use constant CANCEL => "Cancel"; + +sub import { #{{{ + hook(type => "getsetup", id => 'comments', call => \&getsetup); + hook(type => "preprocess", id => 'comments', call => \&preprocess); + hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi); + hook(type => "htmlize", id => "_comment", + call => \&IkiWiki::Plugin::mdwn::htmlize); + IkiWiki::loadplugin("inline"); + IkiWiki::loadplugin("mdwn"); +} # }}} + +sub htmlize { # {{{ + eval { use IkiWiki::Plugin::mdwn; }; + error($@) if ($@); + return IkiWiki::Plugin::mdwn::htmlize(@_) +} # }}} + +sub getsetup () { #{{{ + return + plugin => { + safe => 1, + rebuild => undef, + }, +} #}}} + +# Somewhat based on IkiWiki::Plugin::inline blog posting support +sub preprocess (@) { #{{{ + my %params=@_; + + unless (length $config{cgiurl}) { + error(gettext("[[!comments plugin requires CGI enabled]]")); + } + + my $page = $params{page}; + $pagestate{$page}{comments}{comments} = defined $params{closed} + ? (not IkiWiki::yesno($params{closed})) + : 1; + $pagestate{$page}{comments}{allowhtml} = IkiWiki::yesno($params{allowhtml}); + $pagestate{$page}{comments}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); + $pagestate{$page}{comments}{commit} = defined $params{commit} + ? IkiWiki::yesno($params{commit}) + : 1; + + my $formtemplate = IkiWiki::template("comments_embed.tmpl", + blind_cache => 1); + $formtemplate->param(cgiurl => $config{cgiurl}); + $formtemplate->param(page => $params{page}); + + if (not $pagestate{$page}{comments}{comments}) { + $formtemplate->param("disabled" => + gettext('comments are closed')); + } + elsif ($params{preview}) { + $formtemplate->param("disabled" => + gettext('not available during Preview')); + } + + debug("page $params{page} => destpage $params{destpage}"); + + my $posts = ''; + unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { + eval { use IkiWiki::Plugin::inline; }; + error($@) if ($@); + my @args = ( + pages => "internal($params{page}/_comment_*)", + template => "comments_display", + show => 0, + reverse => "yes", + # special stuff passed through + page => $params{page}, + destpage => $params{destpage}, + preview => $params{preview}, + ); + push @args, atom => $params{atom} if defined $params{atom}; + push @args, rss => $params{rss} if defined $params{rss}; + push @args, feeds => $params{feeds} if defined $params{feeds}; + push @args, feedshow => $params{feedshow} if defined $params{feedshow}; + push @args, timeformat => $params{timeformat} if defined $params{timeformat}; + push @args, feedonly => $params{feedonly} if defined $params{feedonly}; + $posts = "\n" . IkiWiki::preprocess_inline(@args); + } + + return $formtemplate->output . $posts; +} # }}} + +# FIXME: logic taken from editpage, should be common code? +sub getcgiuser ($) { # {{{ + my $session = shift; + my $user = $session->param('name'); + $user = $ENV{REMOTE_ADDR} unless defined $user; + debug("getcgiuser() -> $user"); + return $user; +} # }}} + +# FIXME: logic adapted from recentchanges, should be common code? +sub linkuser ($) { # {{{ + my $user = shift; + my $oiduser = eval { IkiWiki::openiduser($user) }; + + if (defined $oiduser) { + return ($user, $oiduser); + } + else { + my $page = bestlink('', (length $config{userdir} + ? "$config{userdir}/" + : "").$user); + return (urlto($page, undef, 1), $user); + } +} # }}} + +# FIXME: taken from IkiWiki::Plugin::editpage, should be common? +sub checksessionexpiry ($$) { # {{{ + my $session = shift; + my $sid = shift; + + if (defined $session->param("name")) { + if (! defined $sid || $sid ne $session->id) { + error(gettext("Your login session has expired.")); + } + } +} # }}} + +# Mostly cargo-culted from IkiWiki::plugin::editpage +sub sessioncgi ($$) { #{{{ + my $cgi=shift; + my $session=shift; + + my $do = $cgi->param('do'); + return unless $do eq 'comment'; + + IkiWiki::decode_cgi_utf8($cgi); + + eval q{use CGI::FormBuilder}; + error($@) if $@; + + my @buttons = (POST_COMMENT, PREVIEW, CANCEL); + my $form = CGI::FormBuilder->new( + fields => [qw{do sid page subject body}], + charset => 'utf-8', + method => 'POST', + required => [qw{body}], + javascript => 0, + params => $cgi, + action => $config{cgiurl}, + header => 0, + table => 0, + template => scalar IkiWiki::template_params('comments_form.tmpl'), + # wtf does this do in editpage? + wikiname => $config{wikiname}, + ); + + IkiWiki::decode_form_utf8($form); + IkiWiki::run_hooks(formbuilder_setup => sub { + shift->(title => "comment", form => $form, cgi => $cgi, + session => $session, buttons => \@buttons); + }); + IkiWiki::decode_form_utf8($form); + + $form->field(name => 'do', type => 'hidden'); + $form->field(name => 'sid', type => 'hidden', value => $session->id, + force => 1); + $form->field(name => 'page', type => 'hidden'); + $form->field(name => 'subject', type => 'text', size => 72); + $form->field(name => 'body', type => 'textarea', rows => 5, + cols => 80); + + # The untaint is OK (as in editpage) because we're about to pass + # it to file_pruned anyway + my $page = $form->field('page'); + $page = IkiWiki::possibly_foolish_untaint($page); + if (!defined $page || !length $page || + IkiWiki::file_pruned($page, $config{srcdir})) { + error(gettext("bad page name")); + } + + my $allow_directives = $pagestate{$page}{comments}{allowdirectives}; + my $allow_html = $pagestate{$page}{comments}{allowdirectives}; + my $commit_comments = defined $pagestate{$page}{comments}{commit} + ? $pagestate{$page}{comments}{commit} + : 1; + + # FIXME: is this right? Or should we be using the candidate subpage + # (whatever that might mean) as the base URL? + my $baseurl = urlto($page, undef, 1); + + $form->title(sprintf(gettext("commenting on %s"), + IkiWiki::pagetitle($page))); + + $form->tmpl_param('helponformattinglink', + htmllink($page, $page, 'ikiwiki/formatting', + noimageinline => 1, + linktext => 'FormattingHelp'), + allowhtml => $allow_html, + allowdirectives => $allow_directives); + + if (not exists $pagesources{$page}) { + error(sprintf(gettext( + "page '%s' doesn't exist, so you can't comment"), + $page)); + } + if (not $pagestate{$page}{comments}{comments}) { + error(sprintf(gettext( + "comments are not enabled on page '%s'"), + $page)); + } + + if ($form->submitted eq CANCEL) { + # bounce back to the page they wanted to comment on, and exit. + # CANCEL need not be considered in future + IkiWiki::redirect($cgi, urlto($page, undef, 1)); + exit; + } + + IkiWiki::check_canedit($page . "[postcomment]", $cgi, $session); + + my ($authorurl, $author) = linkuser(getcgiuser($session)); + + my $body = $form->field('body') || ''; + $body =~ s/\r\n/\n/g; + $body =~ s/\r/\n/g; + $body = "\n" if $body !~ /\n$/; + + unless ($allow_directives) { + # don't allow new-style directives at all + $body =~ s/(^|[^\\])\[\[!/$1\\[[!/g; + + # don't allow [[ unless it begins an old-style + # wikilink, if prefix_directives is off + $body =~ s/(^|[^\\])\[\[(?![^\n\s\]+]\]\])/$1\\[[!/g + unless $config{prefix_directives}; + } + + unless ($allow_html) { + $body =~ s/&(\w|#)/&$1/g; + $body =~ s//>/g; + } + + # In this template, the [[!meta]] directives should stay at the end, + # so that they will override anything the user specifies. (For + # instance, [[!meta author="I can fake the author"]]...) + my $content_tmpl = template('comments_comment.tmpl'); + $content_tmpl->param(author => $author); + $content_tmpl->param(authorurl => $authorurl); + $content_tmpl->param(subject => $form->field('subject')); + $content_tmpl->param(body => $body); + + my $content = $content_tmpl->output; + + # This is essentially a simplified version of editpage: + # - the user does not control the page that's created, only the parent + # - it's always a create operation, never an edit + # - this means that conflicts should never happen + # - this means that if they do, rocks fall and everyone dies + + if ($form->submitted eq PREVIEW) { + # $fake is a location that has the same number of slashes + # as the eventual location of this comment. + my $fake = "$page/_comments_hypothetical"; + my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', + IkiWiki::linkify($page, $page, + IkiWiki::preprocess($page, $page, + IkiWiki::filter($fake, $page, + $content), + 0, 1))); + IkiWiki::run_hooks(format => sub { + $preview = shift->(page => $page, + content => $preview); + }); + + my $template = template("comments_display.tmpl"); + $template->param(content => $preview); + $template->param(title => $form->field('subject')); + $template->param(ctime => displaytime(time)); + $template->param(author => $author); + $template->param(authorurl => $authorurl); + + $form->tmpl_param(page_preview => $template->output); + } + else { + $form->tmpl_param(page_preview => ""); + } + + if ($form->submitted eq POST_COMMENT && $form->validate) { + # Let's get posting. We don't check_canedit here because + # that somewhat defeats the point of this plugin. + + checksessionexpiry($session, $cgi->param('sid')); + + # FIXME: check that the wiki is locked right now, because + # if it's not, there are mad race conditions! + + # FIXME: rather a simplistic way to make the comments... + my $i = 0; + my $file; + do { + $i++; + $file = "$page/_comment_${i}._comment"; + } while (-e "$config{srcdir}/$file"); + + # FIXME: could probably do some sort of graceful retry + # if I could be bothered + writefile($file, $config{srcdir}, $content); + + my $conflict; + + if ($config{rcs} and $commit_comments) { + my $message = gettext("Added a comment"); + if (defined $form->field('subject') && + length $form->field('subject')) { + $message .= ": ".$form->field('subject'); + } + + IkiWiki::rcs_add($file); + IkiWiki::disable_commit_hook(); + $conflict = IkiWiki::rcs_commit_staged($message, + $session->param('name'), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + + # Now we need a refresh + require IkiWiki::Render; + IkiWiki::refresh(); + IkiWiki::saveindex(); + + # this should never happen, unless a committer deliberately + # breaks it or something + error($conflict) if defined $conflict; + + # Bounce back to where we were, but defeat broken caches + my $anticache = "?updated=$page/_comment_$i"; + IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); + } + else { + IkiWiki::showform ($form, \@buttons, $session, $cgi, + forcebaseurl => $baseurl); + } + + exit; +} #}}} + +package IkiWiki::PageSpec; + +sub match_postcomment ($$;@) { + my $page = shift; + my $glob = shift; + + unless ($page =~ s/\[postcomment\]$//) { + return IkiWiki::FailReason->new("not posting a comment"); + } + return match_glob($page, $glob); +} + +1 diff --git a/IkiWiki/Plugin/postcomment.pm b/IkiWiki/Plugin/postcomment.pm deleted file mode 100644 index 480ca58a5..000000000 --- a/IkiWiki/Plugin/postcomment.pm +++ /dev/null @@ -1,371 +0,0 @@ -#!/usr/bin/perl -# Copyright © 2006-2008 Joey Hess -# Copyright © 2008 Simon McVittie -# Licensed under the GNU GPL, version 2, or any later version published by the -# Free Software Foundation -package IkiWiki::Plugin::postcomment; - -use warnings; -use strict; -use IkiWiki 2.00; - -use constant PLUGIN => "postcomment"; -use constant PREVIEW => "Preview"; -use constant POST_COMMENT => "Post comment"; -use constant CANCEL => "Cancel"; - -sub import { #{{{ - hook(type => "getsetup", id => PLUGIN, call => \&getsetup); - hook(type => "preprocess", id => PLUGIN, call => \&preprocess); - hook(type => "sessioncgi", id => PLUGIN, call => \&sessioncgi); - hook(type => "htmlize", id => "_".PLUGIN, - call => \&IkiWiki::Plugin::mdwn::htmlize); - IkiWiki::loadplugin("inline"); - IkiWiki::loadplugin("mdwn"); -} # }}} - -sub htmlize { # {{{ - eval { use IkiWiki::Plugin::mdwn; }; - error($@) if ($@); - return IkiWiki::Plugin::mdwn::htmlize(@_) -} # }}} - -sub getsetup () { #{{{ - return - plugin => { - safe => 1, - rebuild => undef, - }, -} #}}} - -# Somewhat based on IkiWiki::Plugin::inline blog posting support -sub preprocess (@) { #{{{ - my %params=@_; - - unless (length $config{cgiurl}) { - error(sprintf (gettext("[[!%s plugin requires CGI enabled]]"), - PLUGIN)); - } - - my $page = $params{page}; - $pagestate{$page}{PLUGIN()}{comments} = defined $params{closed} - ? (not IkiWiki::yesno($params{closed})) - : 1; - $pagestate{$page}{PLUGIN()}{allowhtml} = IkiWiki::yesno($params{allowhtml}); - $pagestate{$page}{PLUGIN()}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); - $pagestate{$page}{PLUGIN()}{commit} = defined $params{commit} - ? IkiWiki::yesno($params{commit}) - : 1; - - my $formtemplate = IkiWiki::template(PLUGIN . "_embed.tmpl", - blind_cache => 1); - $formtemplate->param(cgiurl => $config{cgiurl}); - $formtemplate->param(page => $params{page}); - - if (not $pagestate{$page}{PLUGIN()}{comments}) { - $formtemplate->param("disabled" => - gettext('comments are closed')); - } - elsif ($params{preview}) { - $formtemplate->param("disabled" => - gettext('not available during Preview')); - } - - debug("page $params{page} => destpage $params{destpage}"); - - my $posts = ''; - unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { - eval { use IkiWiki::Plugin::inline; }; - error($@) if ($@); - my @args = ( - pages => "internal($params{page}/_comment_*)", - template => PLUGIN . "_display", - show => 0, - reverse => "yes", - # special stuff passed through - page => $params{page}, - destpage => $params{destpage}, - preview => $params{preview}, - ); - push @args, atom => $params{atom} if defined $params{atom}; - push @args, rss => $params{rss} if defined $params{rss}; - push @args, feeds => $params{feeds} if defined $params{feeds}; - push @args, feedshow => $params{feedshow} if defined $params{feedshow}; - push @args, timeformat => $params{timeformat} if defined $params{timeformat}; - push @args, feedonly => $params{feedonly} if defined $params{feedonly}; - $posts = "\n" . IkiWiki::preprocess_inline(@args); - } - - return $formtemplate->output . $posts; -} # }}} - -# FIXME: logic taken from editpage, should be common code? -sub getcgiuser ($) { # {{{ - my $session = shift; - my $user = $session->param('name'); - $user = $ENV{REMOTE_ADDR} unless defined $user; - debug("getcgiuser() -> $user"); - return $user; -} # }}} - -# FIXME: logic adapted from recentchanges, should be common code? -sub linkuser ($) { # {{{ - my $user = shift; - my $oiduser = eval { IkiWiki::openiduser($user) }; - - if (defined $oiduser) { - return ($user, $oiduser); - } - else { - my $page = bestlink('', (length $config{userdir} - ? "$config{userdir}/" - : "").$user); - return (urlto($page, undef, 1), $user); - } -} # }}} - -# FIXME: taken from IkiWiki::Plugin::editpage, should be common? -sub checksessionexpiry ($$) { # {{{ - my $session = shift; - my $sid = shift; - - if (defined $session->param("name")) { - if (! defined $sid || $sid ne $session->id) { - error(gettext("Your login session has expired.")); - } - } -} # }}} - -# Mostly cargo-culted from IkiWiki::plugin::editpage -sub sessioncgi ($$) { #{{{ - my $cgi=shift; - my $session=shift; - - my $do = $cgi->param('do'); - return unless $do eq PLUGIN; - - IkiWiki::decode_cgi_utf8($cgi); - - eval q{use CGI::FormBuilder}; - error($@) if $@; - - my @buttons = (POST_COMMENT, PREVIEW, CANCEL); - my $form = CGI::FormBuilder->new( - fields => [qw{do sid page subject body}], - charset => 'utf-8', - method => 'POST', - required => [qw{body}], - javascript => 0, - params => $cgi, - action => $config{cgiurl}, - header => 0, - table => 0, - template => scalar IkiWiki::template_params(PLUGIN . '_form.tmpl'), - # wtf does this do in editpage? - wikiname => $config{wikiname}, - ); - - IkiWiki::decode_form_utf8($form); - IkiWiki::run_hooks(formbuilder_setup => sub { - shift->(title => PLUGIN, form => $form, cgi => $cgi, - session => $session, buttons => \@buttons); - }); - IkiWiki::decode_form_utf8($form); - - $form->field(name => 'do', type => 'hidden'); - $form->field(name => 'sid', type => 'hidden', value => $session->id, - force => 1); - $form->field(name => 'page', type => 'hidden'); - $form->field(name => 'subject', type => 'text', size => 72); - $form->field(name => 'body', type => 'textarea', rows => 5, - cols => 80); - - # The untaint is OK (as in editpage) because we're about to pass - # it to file_pruned anyway - my $page = $form->field('page'); - $page = IkiWiki::possibly_foolish_untaint($page); - if (!defined $page || !length $page || - IkiWiki::file_pruned($page, $config{srcdir})) { - error(gettext("bad page name")); - } - - my $allow_directives = $pagestate{$page}{PLUGIN()}{allowdirectives}; - my $allow_html = $pagestate{$page}{PLUGIN()}{allowdirectives}; - my $commit_comments = defined $pagestate{$page}{PLUGIN()}{commit} - ? $pagestate{$page}{PLUGIN()}{commit} - : 1; - - # FIXME: is this right? Or should we be using the candidate subpage - # (whatever that might mean) as the base URL? - my $baseurl = urlto($page, undef, 1); - - $form->title(sprintf(gettext("commenting on %s"), - IkiWiki::pagetitle($page))); - - $form->tmpl_param('helponformattinglink', - htmllink($page, $page, 'ikiwiki/formatting', - noimageinline => 1, - linktext => 'FormattingHelp'), - allowhtml => $allow_html, - allowdirectives => $allow_directives); - - if (not exists $pagesources{$page}) { - error(sprintf(gettext( - "page '%s' doesn't exist, so you can't comment"), - $page)); - } - if (not $pagestate{$page}{PLUGIN()}{comments}) { - error(sprintf(gettext( - "comments are not enabled on page '%s'"), - $page)); - } - - if ($form->submitted eq CANCEL) { - # bounce back to the page they wanted to comment on, and exit. - # CANCEL need not be considered in future - IkiWiki::redirect($cgi, urlto($page, undef, 1)); - exit; - } - - IkiWiki::check_canedit($page . "[" . PLUGIN . "]", $cgi, $session); - - my ($authorurl, $author) = linkuser(getcgiuser($session)); - - my $body = $form->field('body') || ''; - $body =~ s/\r\n/\n/g; - $body =~ s/\r/\n/g; - $body = "\n" if $body !~ /\n$/; - - unless ($allow_directives) { - # don't allow new-style directives at all - $body =~ s/(^|[^\\])\[\[!/$1\\[[!/g; - - # don't allow [[ unless it begins an old-style - # wikilink, if prefix_directives is off - $body =~ s/(^|[^\\])\[\[(?![^\n\s\]+]\]\])/$1\\[[!/g - unless $config{prefix_directives}; - } - - unless ($allow_html) { - $body =~ s/&(\w|#)/&$1/g; - $body =~ s//>/g; - } - - # In this template, the [[!meta]] directives should stay at the end, - # so that they will override anything the user specifies. (For - # instance, [[!meta author="I can fake the author"]]...) - my $content_tmpl = template(PLUGIN . '_comment.tmpl'); - $content_tmpl->param(author => $author); - $content_tmpl->param(authorurl => $authorurl); - $content_tmpl->param(subject => $form->field('subject')); - $content_tmpl->param(body => $body); - - my $content = $content_tmpl->output; - - # This is essentially a simplified version of editpage: - # - the user does not control the page that's created, only the parent - # - it's always a create operation, never an edit - # - this means that conflicts should never happen - # - this means that if they do, rocks fall and everyone dies - - if ($form->submitted eq PREVIEW) { - # $fake is a location that has the same number of slashes - # as the eventual location of this comment. - my $fake = "$page/_" . PLUGIN . "hypothetical"; - my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', - IkiWiki::linkify($page, $page, - IkiWiki::preprocess($page, $page, - IkiWiki::filter($fake, $page, - $content), - 0, 1))); - IkiWiki::run_hooks(format => sub { - $preview = shift->(page => $page, - content => $preview); - }); - - my $template = template(PLUGIN . "_display.tmpl"); - $template->param(content => $preview); - $template->param(title => $form->field('subject')); - $template->param(ctime => displaytime(time)); - $template->param(author => $author); - $template->param(authorurl => $authorurl); - - $form->tmpl_param(page_preview => $template->output); - } - else { - $form->tmpl_param(page_preview => ""); - } - - if ($form->submitted eq POST_COMMENT && $form->validate) { - # Let's get posting. We don't check_canedit here because - # that somewhat defeats the point of this plugin. - - checksessionexpiry($session, $cgi->param('sid')); - - # FIXME: check that the wiki is locked right now, because - # if it's not, there are mad race conditions! - - # FIXME: rather a simplistic way to make the comments... - my $i = 0; - my $file; - do { - $i++; - $file = "$page/_comment_${i}._" . PLUGIN; - } while (-e "$config{srcdir}/$file"); - - # FIXME: could probably do some sort of graceful retry - # if I could be bothered - writefile($file, $config{srcdir}, $content); - - my $conflict; - - if ($config{rcs} and $commit_comments) { - my $message = gettext("Added a comment"); - if (defined $form->field('subject') && - length $form->field('subject')) { - $message .= ": ".$form->field('subject'); - } - - IkiWiki::rcs_add($file); - IkiWiki::disable_commit_hook(); - $conflict = IkiWiki::rcs_commit_staged($message, - $session->param('name'), $ENV{REMOTE_ADDR}); - IkiWiki::enable_commit_hook(); - IkiWiki::rcs_update(); - } - - # Now we need a refresh - require IkiWiki::Render; - IkiWiki::refresh(); - IkiWiki::saveindex(); - - # this should never happen, unless a committer deliberately - # breaks it or something - error($conflict) if defined $conflict; - - # Bounce back to where we were, but defeat broken caches - my $anticache = "?updated=$page/_comment_$i"; - IkiWiki::redirect($cgi, urlto($page, undef, 1).$anticache); - } - else { - IkiWiki::showform ($form, \@buttons, $session, $cgi, - forcebaseurl => $baseurl); - } - - exit; -} #}}} - -package IkiWiki::PageSpec; - -sub match_postcomment ($$;@) { - my $page = shift; - my $glob = shift; - - unless ($page =~ s/\[postcomment\]$//) { - return IkiWiki::FailReason->new("not posting a comment"); - } - return match_glob($page, $glob); -} - -1 diff --git a/doc/style.css b/doc/style.css index 21ea9492c..70f31d325 100644 --- a/doc/style.css +++ b/doc/style.css @@ -373,7 +373,7 @@ span.color { padding: 2px; } -.postcomment-display .author { font-weight: bold; } -.postcomment-display { border: 1px inset #999; margin: 3px; padding: 3px; } -.postcomment-header { font-style: italic; } -.postcomment-subject { font-weight: bold; border-bottom: 1px solid #999; } +.comments-display .author { font-weight: bold; } +.comments-display { border: 1px inset #999; margin: 3px; padding: 3px; } +.comments-header { font-style: italic; } +.comments-subject { font-weight: bold; border-bottom: 1px solid #999; } diff --git a/templates/comments_comment.tmpl b/templates/comments_comment.tmpl new file mode 100644 index 000000000..8c89458f3 --- /dev/null +++ b/templates/comments_comment.tmpl @@ -0,0 +1,10 @@ + + +[[!meta title=""]] + + +[[!meta author=""]] + + +[[!meta authorurl=""]] + diff --git a/templates/comments_display.tmpl b/templates/comments_display.tmpl new file mode 100644 index 000000000..04e0613e0 --- /dev/null +++ b/templates/comments_display.tmpl @@ -0,0 +1,24 @@ +
+ +
+Posted by + + + + + + + + + + +() +
+ +
+ +
+ +
+ +
diff --git a/templates/comments_embed.tmpl b/templates/comments_embed.tmpl new file mode 100644 index 000000000..cbb9247f2 --- /dev/null +++ b/templates/comments_embed.tmpl @@ -0,0 +1,7 @@ +
+ +[Posting comments disabled: ] + +Post a comment + +
diff --git a/templates/comments_form.tmpl b/templates/comments_form.tmpl new file mode 100644 index 000000000..fbf49be34 --- /dev/null +++ b/templates/comments_form.tmpl @@ -0,0 +1,25 @@ +
+ + + + + +Subject:
+
+
+
+HTML is not allowed.
+IkiWiki directives ([[!directive]]) are not allowed.
+ + + +
+
+Comment preview: +
+
+ +
+
+ +
diff --git a/templates/postcomment_comment.tmpl b/templates/postcomment_comment.tmpl deleted file mode 100644 index 8c89458f3..000000000 --- a/templates/postcomment_comment.tmpl +++ /dev/null @@ -1,10 +0,0 @@ - - -[[!meta title=""]] - - -[[!meta author=""]] - - -[[!meta authorurl=""]] - diff --git a/templates/postcomment_display.tmpl b/templates/postcomment_display.tmpl deleted file mode 100644 index d3eabb3a1..000000000 --- a/templates/postcomment_display.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -
- -
-Posted by - - - - - - - - - - -() -
- -
- -
- -
- -
diff --git a/templates/postcomment_embed.tmpl b/templates/postcomment_embed.tmpl deleted file mode 100644 index eae741214..000000000 --- a/templates/postcomment_embed.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -
- -[Posting comments disabled: ] - -Post a comment - -
diff --git a/templates/postcomment_form.tmpl b/templates/postcomment_form.tmpl deleted file mode 100644 index 293f0f17e..000000000 --- a/templates/postcomment_form.tmpl +++ /dev/null @@ -1,25 +0,0 @@ -
- - - - - -Subject:
-
-
-
-HTML is not allowed.
-IkiWiki directives ([[!directive]]) are not allowed.
- - - -
-
-Comment preview: -
-
- -
-
- -
-- cgit v1.2.3 From 57e40b9ce5345530f31f4d1b25a49ed18228a8dd Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:25:10 +0000 Subject: Fix typo that led to comments being blanked --- IkiWiki/Plugin/comments.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index b57735545..9359e9487 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -232,7 +232,7 @@ sub sessioncgi ($$) { #{{{ my $body = $form->field('body') || ''; $body =~ s/\r\n/\n/g; $body =~ s/\r/\n/g; - $body = "\n" if $body !~ /\n$/; + $body .= "\n" if $body !~ /\n$/; unless ($allow_directives) { # don't allow new-style directives at all -- cgit v1.2.3 From ebe140201ed53ee4f8cf5998c69e20d5fef2ad16 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:29:16 +0000 Subject: comments: sanitize the body of each comment before posting it This should ensure that users can't "break out" from the enclosing
, making it impossible to forge comments (assuming htmlscrubber is enabled, and so is either htmlbalance or htmltidy). --- IkiWiki/Plugin/comments.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 9359e9487..c545a1335 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -250,6 +250,17 @@ sub sessioncgi ($$) { #{{{ $body =~ s/>/>/g; } + IkiWiki::run_hooks(sanitize => sub { + # $fake is a possible location for this comment. We don't + # know yet what the comment number *actually* is. + my $fake = "$page/_comment_1"; + $body=shift->( + page => $fake, + destpage => $fake, + content => $body, + ); + }); + # In this template, the [[!meta]] directives should stay at the end, # so that they will override anything the user specifies. (For # instance, [[!meta author="I can fake the author"]]...) @@ -268,9 +279,9 @@ sub sessioncgi ($$) { #{{{ # - this means that if they do, rocks fall and everyone dies if ($form->submitted eq PREVIEW) { - # $fake is a location that has the same number of slashes - # as the eventual location of this comment. - my $fake = "$page/_comments_hypothetical"; + # $fake is a possible location for this comment. We don't + # know yet what the comment number *actually* is. + my $fake = "$page/_comment_1"; my $preview = IkiWiki::htmlize($fake, $page, 'mdwn', IkiWiki::linkify($page, $page, IkiWiki::preprocess($page, $page, -- cgit v1.2.3 From 9d92fd5eb060678650e6ca5ce8af0a50600c6d2e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:43:11 +0000 Subject: comments: don't rely on mdwn getting loaded first --- IkiWiki/Plugin/comments.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index c545a1335..29dc06f32 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -17,8 +17,7 @@ sub import { #{{{ hook(type => "getsetup", id => 'comments', call => \&getsetup); hook(type => "preprocess", id => 'comments', call => \&preprocess); hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi); - hook(type => "htmlize", id => "_comment", - call => \&IkiWiki::Plugin::mdwn::htmlize); + hook(type => "htmlize", id => "_comment", call => \&htmlize); IkiWiki::loadplugin("inline"); IkiWiki::loadplugin("mdwn"); } # }}} -- cgit v1.2.3 From 4663f364bbc220bbdbf03582765b6d82f0bddc46 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:43:39 +0000 Subject: comments: load inline and mdwn lazily --- IkiWiki/Plugin/comments.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 29dc06f32..8122f9d51 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -23,7 +23,7 @@ sub import { #{{{ } # }}} sub htmlize { # {{{ - eval { use IkiWiki::Plugin::mdwn; }; + eval q{use IkiWiki::Plugin::mdwn}; error($@) if ($@); return IkiWiki::Plugin::mdwn::htmlize(@_) } # }}} @@ -72,7 +72,7 @@ sub preprocess (@) { #{{{ my $posts = ''; unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) { - eval { use IkiWiki::Plugin::inline; }; + eval q{use IkiWiki::Plugin::inline}; error($@) if ($@); my @args = ( pages => "internal($params{page}/_comment_*)", -- cgit v1.2.3 From 249ea2ed7557e34614ef9f1f863cee9489798510 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 10:44:34 +0000 Subject: comments: remove allowhtml option, just switch it on all the time Now that posts are individually sanitized, that should be safe. --- IkiWiki/Plugin/comments.pm | 9 --------- templates/comments_form.tmpl | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 8122f9d51..f10400db1 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -48,7 +48,6 @@ sub preprocess (@) { #{{{ $pagestate{$page}{comments}{comments} = defined $params{closed} ? (not IkiWiki::yesno($params{closed})) : 1; - $pagestate{$page}{comments}{allowhtml} = IkiWiki::yesno($params{allowhtml}); $pagestate{$page}{comments}{allowdirectives} = IkiWiki::yesno($params{allowdirectives}); $pagestate{$page}{comments}{commit} = defined $params{commit} ? IkiWiki::yesno($params{commit}) @@ -187,7 +186,6 @@ sub sessioncgi ($$) { #{{{ } my $allow_directives = $pagestate{$page}{comments}{allowdirectives}; - my $allow_html = $pagestate{$page}{comments}{allowdirectives}; my $commit_comments = defined $pagestate{$page}{comments}{commit} ? $pagestate{$page}{comments}{commit} : 1; @@ -203,7 +201,6 @@ sub sessioncgi ($$) { #{{{ htmllink($page, $page, 'ikiwiki/formatting', noimageinline => 1, linktext => 'FormattingHelp'), - allowhtml => $allow_html, allowdirectives => $allow_directives); if (not exists $pagesources{$page}) { @@ -243,12 +240,6 @@ sub sessioncgi ($$) { #{{{ unless $config{prefix_directives}; } - unless ($allow_html) { - $body =~ s/&(\w|#)/&$1/g; - $body =~ s//>/g; - } - IkiWiki::run_hooks(sanitize => sub { # $fake is a possible location for this comment. We don't # know yet what the comment number *actually* is. diff --git a/templates/comments_form.tmpl b/templates/comments_form.tmpl index fbf49be34..59c03b4f0 100644 --- a/templates/comments_form.tmpl +++ b/templates/comments_form.tmpl @@ -8,7 +8,7 @@ Subject:



-HTML is not allowed.
+Formatting with Markdown and HTML are allowed.
IkiWiki directives ([[!directive]]) are not allowed.
-- cgit v1.2.3 From cb5aaa3cee8b35d6fc6e88a7449a9477a6587c7a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2008 11:25:13 +0000 Subject: htmlbalance: don't compact whitespace, and set misc other options Not compacting whitespace is the most important one: now that we run sanitize hooks on individual posted comments in the comments plugin, whitespace that is significant to Markdown (but not HTML) is lost. --- IkiWiki/Plugin/htmlbalance.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/htmlbalance.pm b/IkiWiki/Plugin/htmlbalance.pm index 3a2d62d15..dcd92055f 100644 --- a/IkiWiki/Plugin/htmlbalance.pm +++ b/IkiWiki/Plugin/htmlbalance.pm @@ -30,7 +30,15 @@ sub sanitize (@) { #{{{ my %params=@_; my $ret = ''; - my $tree = HTML::TreeBuilder->new_from_content($params{content}); + my $tree = HTML::TreeBuilder->new(); + $tree->ignore_unknown(0); + $tree->ignore_ignorable_whitespace(0); + $tree->no_space_compacting(1); + $tree->p_strict(1); + $tree->store_comments(0); + $tree->store_declarations(0); + $tree->store_pis(0); + $tree->parse_content($params{content}); my @nodes = $tree->disembowel(); foreach my $node (@nodes) { if (ref $node) { -- cgit v1.2.3 From 0df983c5a7a4292224e7f7c279fc7dbe9a79fba6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 22 Nov 2008 19:01:28 +0000 Subject: Add comments to page.tmpl --- templates/page.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/page.tmpl b/templates/page.tmpl index 8c2ca668f..94412078a 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -67,6 +67,12 @@
+ +
+ +
+
+