aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/comments.pm4
-rw-r--r--debian/changelog7
-rw-r--r--doc/ikiwiki/directive/comment.mdwn38
-rw-r--r--doc/plugins/comments.mdwn2
-rw-r--r--templates/editcomment.tmpl1
5 files changed, 49 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 0aa4759d8..517e16f9f 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -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')) {
diff --git a/debian/changelog b/debian/changelog
index 4a1844e06..cee073b3a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
index 000000000..f03664d13
--- /dev/null
+++ b/doc/ikiwiki/directive/comment.mdwn
@@ -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"]]
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index c13a6daa6..7e2232411 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -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:
diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl
index 27d9457d4..545edb596 100644
--- a/templates/editcomment.tmpl
+++ b/templates/editcomment.tmpl
@@ -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>