From 5cdee82ef6c8f9fa888b35ef81f2bcc35dd8ce4a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 2 Jun 2009 17:06:46 -0400 Subject: comment: Make comment directives no longer use the internal "_comment" form, and document the comment directive syntax. 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 | 4 +++- debian/changelog | 7 +++++++ doc/ikiwiki/directive/comment.mdwn | 38 ++++++++++++++++++++++++++++++++++++++ doc/plugins/comments.mdwn | 2 +- templates/editcomment.tmpl | 1 - 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 doc/ikiwiki/directive/comment.mdwn 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 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: (optional)
Subject:


-IkiWiki directives ([[!directive]]) are not allowed in comments on this wiki.
-- cgit v1.2.3