comment: Make comment directives no longer use the internal "_comment" form, and...
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 2 Jun 2009 21:06:46 +0000 (17:06 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Tue, 2 Jun 2009 21:06:46 +0000 (17:06 -0400)
Rationalle: Comments need to be user-editable so that they can be posted
via git commit etc.

The _comment directive is still supported, for back-compat.

IkiWiki/Plugin/comments.pm
debian/changelog
doc/ikiwiki/directive/comment.mdwn [new file with mode: 0644]
doc/plugins/comments.mdwn
templates/editcomment.tmpl

index 0aa4759d807c3060eed580d58f862c6d22ab9d70..517e16f9ff8afd0ca3de21df8ace8558a03173bb 100644 (file)
@@ -21,6 +21,8 @@ my %commentstate;
 sub import {
        hook(type => "checkconfig", id => 'comments',  call => \&checkconfig);
        hook(type => "getsetup", id => 'comments',  call => \&getsetup);
+       hook(type => "preprocess", id => 'comment', call => \&preprocess);
+       # here for backwards compatability with old comments
        hook(type => "preprocess", id => '_comment', call => \&preprocess);
        hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
        hook(type => "htmlize", id => "_comment", call => \&htmlize);
@@ -377,7 +379,7 @@ sub editcomment ($$) {
 
        my $location=unique_comment_location($page, $config{srcdir});
 
-       my $content = "[[!_comment format=$type\n";
+       my $content = "[[!comment format=$type\n";
 
        # FIXME: handling of double quotes probably wrong?
        if (defined $session->param('name')) {
index 4a1844e068eba4c70002eddab9871a7bcdde320e..cee073b3ad3c43b4c967d3cf404ce831e9c21459 100644 (file)
@@ -1,3 +1,10 @@
+ikiwiki (3.15) UNRELEASED; urgency=low
+
+  * comment: Make comment directives no longer use the internal "_comment"
+    form, and document the comment directive syntax.
+
+ -- Joey Hess <joeyh@debian.org>  Tue, 02 Jun 2009 17:03:41 -0400
+
 ikiwiki (3.14) unstable; urgency=low
 
   * highlight: New plugin supporting syntax highlighting of pretty much
diff --git a/doc/ikiwiki/directive/comment.mdwn b/doc/ikiwiki/directive/comment.mdwn
new file mode 100644 (file)
index 0000000..f03664d
--- /dev/null
@@ -0,0 +1,38 @@
+The `comment` directive is supplied by the
+[[!iki plugins/comment desc=comment]] plugin, and is used to add a comment
+to a page. Typically, the directive is the only thing on a comment page,
+and is filled out by the comment plugin when a user posts a comment.
+
+Example:
+
+       \[[!comment format=mdwn
+       username="foo"
+       subject="Bar"
+       date="2009-06-02T19:05:01Z"
+       content="""
+       Blah blah.
+       """
+       ]]
+
+## usage
+
+The only required parameter is `content`, the others just add or override
+metadata of the comment.
+
+* `content` - Text to display for the comment.
+  Note that [[directives|ikiwiki/directive]]
+  may not be allowed, depending on the configuration
+  of the comment plugin.
+* `format` - Specifies the markup used for the content.
+* `subject` - Subject for the comment.
+* `date` - Date the comment was posted. Can be entered in
+  nearly any format, since it's parsed by [[!cpan TimeDate]]
+* `username` - Used to record the username (or OpenID)
+  of a logged in commenter.
+* `ip` - Can be used to record the IP address of a commenter,
+  if they posted anonymously.
+* `claimedauthor` - Records the name that the user entered,
+  if anonmous commenters are allowed to enter their (unverified)
+  name.
+
+[[!meta robots="noindex, follow"]]
index c13a6daa6a1ddb88e0d3f1b8973a3c029c56a815..7e22324111d0e3a14ae6b28ad8d76e04c04534ab 100644 (file)
@@ -19,7 +19,7 @@ users can only post comments.
 
 Individual comments are stored as internal-use pages named something like
 `page/comment_1`, `page/comment_2`, etc. These pages internally use a
-`\[[!_comment]]` [[ikiwiki/directive]].
+[[comment_directive|ikiwiki/directive/comment]].
 
 There are some global options for the setup file:
 
index 27d9457d406a55c56e2dc5abe426791f20c95751..545edb596206e073df72ea4ef29c92cc08154779 100644 (file)
@@ -16,7 +16,6 @@ Website: <TMPL_VAR NAME=FIELD-URL> (optional)<br />
 Subject: <TMPL_VAR FIELD-SUBJECT><br />
 <TMPL_VAR FIELD-EDITCONTENT><br />
 <TMPL_VAR FORM-SUBMIT> <TMPL_VAR FIELD-TYPE> <TMPL_VAR HELPONFORMATTINGLINK><br />
-IkiWiki directives ([[!directive]]) are <TMPL_UNLESS NAME="ALLOWDIRECTIVES">not </TMPL_UNLESS>allowed in comments on this wiki.<br />
 <TMPL_VAR NAME="FORM-END">
 <TMPL_VAR WMD_PREVIEW>