From 29fd100e9f4e71fb85505d932184ffd5e3f26242 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jun 2010 20:53:58 -0400 Subject: Use comment template on comments page of example blog. --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 15ae21a55..0697efffd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low (Make it relative like everything else.) * hnb: Fixed broken use of mkstemp that had caused dangling temp files, and prevented actually rendering hnb files. + * Use comment template on comments page of example blog. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 -- cgit v1.2.3 From 28cdf2c341fa633efbb3461acd2e1109f38b8da7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jun 2010 21:07:31 -0400 Subject: comment.tmpl: Fix up display when inline uses it to display a non-comment page. (Such as a discussion page.) --- debian/changelog | 2 ++ templates/comment.tmpl | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 0697efffd..4ce720ab6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * hnb: Fixed broken use of mkstemp that had caused dangling temp files, and prevented actually rendering hnb files. * Use comment template on comments page of example blog. + * comment.tmpl: Fix up display when inline uses it to display a non-comment + page. (Such as a discussion page.) -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/templates/comment.tmpl b/templates/comment.tmpl index fa90e6d26..c2ee5a371 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -14,8 +14,8 @@
-Comment by +Comment by @@ -30,6 +30,8 @@ Comment by + +Comment by @@ -40,6 +42,7 @@ Comment by + -- cgit v1.2.3 From 0eabe6f79498e3339205aeff2c79ae1e85498ab4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 1 Jul 2010 16:20:03 -0400 Subject: git: Added git_wrapper_background_command option. Can be used to eg, make the git wrapper push to github in the background after ikiwiki runs. --- IkiWiki.pm | 7 +++++++ IkiWiki/Plugin/git.pm | 8 ++++++++ IkiWiki/Wrapper.pm | 52 ++++++++++++++++++++++++++++++++++++++++++++------- debian/changelog | 3 +++ 4 files changed, 63 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/IkiWiki.pm b/IkiWiki.pm index 35b38df46..701f7137d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -441,6 +441,13 @@ sub getsetup () { safe => 0, rebuild => 0, }, + wrapper_background_command => { + type => "internal", + default => '', + description => "background shell command to run", + safe => 0, + rebuild => 0, + }, gettime => { type => "internal", description => "running in gettime mode", diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 992c6226b..0f92476c9 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -41,6 +41,7 @@ sub checkconfig () { push @{$config{wrappers}}, { wrapper => $config{git_wrapper}, wrappermode => (defined $config{git_wrappermode} ? $config{git_wrappermode} : "06755"), + wrapper_background_command => $config{git_wrapper_background_command}, }; } @@ -78,6 +79,13 @@ sub getsetup () { safe => 0, # file rebuild => 0, }, + git_wrapper_background_command => { + type => "string", + example => "git push github", + description => "shell command for git_wrapper to run, in the background", + safe => 0, # command + rebuild => 0, + }, git_wrappermode => { type => "string", example => '06755', diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 73f0896e8..bd134c9a3 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -73,17 +73,23 @@ EOF # otherwise. The fd of the lock is stored in # IKIWIKI_CGILOCK_FD so unlockwiki can close it. $pre_exec=<<"EOF"; - { - int fd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR, 0666); - if (fd != -1 && flock(fd, LOCK_EX) == 0) { - char *fd_s=malloc(8); - sprintf(fd_s, "%i", fd); - setenv("IKIWIKI_CGILOCK_FD", fd_s, 1); - } + lockfd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR, 0666); + if (lockfd != -1 && flock(lockfd, LOCK_EX) == 0) { + char *fd_s=malloc(8); + sprintf(fd_s, "%i", lockfd); + setenv("IKIWIKI_CGILOCK_FD", fd_s, 1); } EOF } + my $set_background_command=''; + if (defined $config{wrapper_background_command} && + length $config{wrapper_background_command}) { + my $background_command=delete $config{wrapper_background_command}; + $set_background_command=~s/"/\\"/g; + $set_background_command='#define BACKGROUND_COMMAND "'.$background_command.'"'; + } + $Data::Dumper::Indent=0; # no newlines my $configstring=Data::Dumper->Dump([\%config], ['*config']); $configstring=~s/\\/\\\\/g; @@ -114,6 +120,7 @@ void addenv(char *var, char *val) { } int main (int argc, char **argv) { + int lockfd=-1; char *s; $check_commit_hook @@ -147,9 +154,40 @@ $envsave } $pre_exec + +$set_background_command +#ifdef BACKGROUND_COMMAND + if (lockfd != -1) { + close(lockfd); + } + + pid_t pid=fork(); + if (pid == -1) { + perror("fork"); + exit(1); + } + else if (pid == 0) { + execl("$this", "$this", NULL); + perror("exec $this"); + exit(1); + } + else { + waitpid(pid, NULL, 0); + + if (daemon(1, 0) == 0) { + system(BACKGROUND_COMMAND); + exit(0); + } + else { + perror("daemon"); + exit(1); + } + } +#else execl("$this", "$this", NULL); perror("exec $this"); exit(1); +#endif } EOF diff --git a/debian/changelog b/debian/changelog index 4ce720ab6..7d857d9c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,9 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * Use comment template on comments page of example blog. * comment.tmpl: Fix up display when inline uses it to display a non-comment page. (Such as a discussion page.) + * git: Added git_wrapper_background_command option. Can be used to eg, + make the git wrapper push to github in the background after ikiwiki + runs. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 -- cgit v1.2.3 From 8a8914151cee44592dfdc3df3bb2c45b19b8c29c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 14:22:19 -0400 Subject: review of needstranslation() pagespec Minor wording fix; changelog; etc. --- IkiWiki/Plugin/po.pm | 2 +- debian/changelog | 1 + doc/todo/po_needstranslation_pagespec.mdwn | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f12c69d5f..0b2251668 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -1225,7 +1225,7 @@ sub match_needstranslation ($$;@) { my $percenttranslated=IkiWiki::Plugin::po::percenttranslated($page); if ($percenttranslated eq 'N/A') { - return IkiWiki::FailReason->new("file is not a translation page"); + return IkiWiki::FailReason->new("file is not a translatable page"); } elsif ($percenttranslated < 100) { return IkiWiki::SuccessReason->new("file has $percenttranslated translated"); diff --git a/debian/changelog b/debian/changelog index 7d857d9c0..bdcf52884 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,7 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * git: Added git_wrapper_background_command option. Can be used to eg, make the git wrapper push to github in the background after ikiwiki runs. + * po: Added needstranslation() pagespec. (intrigeri) -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 diff --git a/doc/todo/po_needstranslation_pagespec.mdwn b/doc/todo/po_needstranslation_pagespec.mdwn index acc5641a4..77449dc2b 100644 --- a/doc/todo/po_needstranslation_pagespec.mdwn +++ b/doc/todo/po_needstranslation_pagespec.mdwn @@ -2,4 +2,8 @@ Commit b225fdc44d4b3d in my po branch adds a `needstranslation()` PageSpec. It makes it easy to list pages that need translation work. Please review. --[[intrigeri]] -[[!tag patch]] +> Looks good, cherry-picked. The only improvment I can +> think of is that `needstranslation(50)` could match +> only pages less than 50% translated. --[[Joey]] + +[[!tag patch done]] -- cgit v1.2.3 From 35fd6f81f110a187135fd2bafe1341666ff5d5ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 15:27:37 -0400 Subject: changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index bdcf52884..1450e502e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low make the git wrapper push to github in the background after ikiwiki runs. * po: Added needstranslation() pagespec. (intrigeri) + * po: Added support for .html source pages. (intrigeri) -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 -- cgit v1.2.3 From e72ef3b070b18f4cb0a667be915266b27d7d3071 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 16:19:22 -0400 Subject: comment: Fix problem moderating comments of certian pages with utf-8 in their name. --- IkiWiki/Plugin/comments.pm | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'debian') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index d34951570..30ade5634 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -569,6 +569,7 @@ sub commentmoderation ($$) { my $added=0; foreach my $id (keys %vars) { if ($id =~ /(.*)\._comment(?:_pending)?$/) { + $id=decode_utf8($id); my $action=$cgi->param($id); next if $action eq 'Defer' && ! $rejectalldefer; diff --git a/debian/changelog b/debian/changelog index 1450e502e..baf7a6a35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low runs. * po: Added needstranslation() pagespec. (intrigeri) * po: Added support for .html source pages. (intrigeri) + * comment: Fix problem moderating comments of certian pages with utf-8 + in their name. -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 -- cgit v1.2.3 From 40c697e12de44aa9a6296d31f6706b79df306c59 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 17:11:16 -0400 Subject: releasing version 3.20100704 --- debian/changelog | 4 ++-- ikiwiki.spec | 2 +- po/ikiwiki.pot | 60 ++++++++++++++++++++++++++++---------------------------- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index baf7a6a35..9f1a33f2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100624) UNRELEASED; urgency=low +ikiwiki (3.20100704) unstable; urgency=low * Changes to avoid display of ugly google openids, by displaying a username taken from openid. @@ -25,7 +25,7 @@ ikiwiki (3.20100624) UNRELEASED; urgency=low * comment: Fix problem moderating comments of certian pages with utf-8 in their name. - -- Joey Hess Wed, 23 Jun 2010 15:30:04 -0400 + -- Joey Hess Sun, 04 Jul 2010 16:19:43 -0400 ikiwiki (3.20100623) unstable; urgency=low diff --git a/ikiwiki.spec b/ikiwiki.spec index 9644fd396..7c2c94376 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20100624 +Version: 3.20100704 Release: 1%{?dist} Summary: A wiki compiler diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index e50fa0f68..bb0d6e526 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: 2010-06-23 17:10-0400\n" +"POT-Creation-Date: 2010-07-04 16:46-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1317 +#: ../IkiWiki/CGI.pm:426 ../IkiWiki/CGI.pm:427 ../IkiWiki.pm:1324 msgid "Error" msgstr "" @@ -231,36 +231,36 @@ msgstr "" msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:491 +#: ../IkiWiki/Plugin/comments.pm:495 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:493 +#: ../IkiWiki/Plugin/comments.pm:497 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:506 +#: ../IkiWiki/Plugin/comments.pm:510 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:510 +#: ../IkiWiki/Plugin/comments.pm:514 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:554 ../IkiWiki/Plugin/websetup.pm:268 +#: ../IkiWiki/Plugin/comments.pm:558 ../IkiWiki/Plugin/websetup.pm:268 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:605 +#: ../IkiWiki/Plugin/comments.pm:610 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:645 +#: ../IkiWiki/Plugin/comments.pm:650 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:802 +#: ../IkiWiki/Plugin/comments.pm:807 #, perl-format msgid "%i comment" msgid_plural "%i comments" @@ -270,7 +270,7 @@ msgstr[1] "" #. translators: Here "Comment" is a verb; #. translators: the user clicks on it to #. translators: post a comment. -#: ../IkiWiki/Plugin/comments.pm:812 +#: ../IkiWiki/Plugin/comments.pm:817 msgid "Comment" msgstr "" @@ -356,18 +356,18 @@ msgstr "" msgid "%s is an attachment, not a page." msgstr "" -#: ../IkiWiki/Plugin/git.pm:724 ../IkiWiki/Plugin/git.pm:742 +#: ../IkiWiki/Plugin/git.pm:740 ../IkiWiki/Plugin/git.pm:758 #: ../IkiWiki/Receive.pm:129 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:764 +#: ../IkiWiki/Plugin/git.pm:780 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:768 +#: ../IkiWiki/Plugin/git.pm:784 msgid "you are not allowed to change file modes" msgstr "" @@ -655,26 +655,26 @@ msgstr "" msgid "N/A" msgstr "" -#: ../IkiWiki/Plugin/po.pm:953 +#: ../IkiWiki/Plugin/po.pm:951 #, perl-format msgid "failed to translate %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1037 +#: ../IkiWiki/Plugin/po.pm:1035 msgid "removed obsolete PO files" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1094 ../IkiWiki/Plugin/po.pm:1108 -#: ../IkiWiki/Plugin/po.pm:1147 +#: ../IkiWiki/Plugin/po.pm:1092 ../IkiWiki/Plugin/po.pm:1104 +#: ../IkiWiki/Plugin/po.pm:1143 #, perl-format msgid "failed to write %s" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1106 +#: ../IkiWiki/Plugin/po.pm:1102 msgid "failed to translate" msgstr "" -#: ../IkiWiki/Plugin/po.pm:1159 +#: ../IkiWiki/Plugin/po.pm:1155 msgid "invalid gettext data, go back to previous page to continue edit" msgstr "" @@ -1128,13 +1128,13 @@ msgid "wrapper filename not specified" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:160 +#: ../IkiWiki/Wrapper.pm:198 #, perl-format msgid "failed to compile %s" msgstr "" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:180 +#: ../IkiWiki/Wrapper.pm:218 #, perl-format msgid "successfully generated %s" msgstr "" @@ -1171,39 +1171,39 @@ msgstr "" msgid "Discussion" msgstr "" -#: ../IkiWiki.pm:531 +#: ../IkiWiki.pm:538 msgid "Must specify url to wiki with --url when using --cgi" msgstr "" -#: ../IkiWiki.pm:577 +#: ../IkiWiki.pm:584 msgid "cannot use multiple rcs plugins" msgstr "" -#: ../IkiWiki.pm:607 +#: ../IkiWiki.pm:614 #, perl-format msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1299 +#: ../IkiWiki.pm:1306 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1994 +#: ../IkiWiki.pm:2001 msgid "yes" msgstr "" -#: ../IkiWiki.pm:2071 +#: ../IkiWiki.pm:2078 #, perl-format msgid "invalid sort type %s" msgstr "" -#: ../IkiWiki.pm:2092 +#: ../IkiWiki.pm:2099 #, perl-format msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki.pm:2228 +#: ../IkiWiki.pm:2235 #, perl-format msgid "cannot match pages: %s" msgstr "" -- cgit v1.2.3 From f6db10df21f04df83e109924647b07672050dbf3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Jul 2010 14:04:49 -0400 Subject: img: Add a margin around images displayed by this directive. Particularly important for floating images, which could before be placed uncomfortably close to text. --- IkiWiki/Plugin/img.pm | 7 +++++++ debian/changelog | 6 ++++++ doc/style.css | 4 ++++ 3 files changed, 17 insertions(+) (limited to 'debian') diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index eb1b68124..2375ead89 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -156,6 +156,13 @@ sub preprocess (@) { $imgurl="$config{url}/$imglink"; } + if (exists $params{class}) { + $params{class}.=" img"; + } + else { + $params{class}="img"; + } + my $attrs=''; foreach my $attr (qw{alt title class id hspace vspace}) { if (exists $params{$attr}) { diff --git a/debian/changelog b/debian/changelog index 9f1a33f2f..d426be019 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100705) UNRELEASED; urgency=low + + * img: Add a margin around images displayed by this directive. + + -- Joey Hess Mon, 05 Jul 2010 13:59:42 -0400 + ikiwiki (3.20100704) unstable; urgency=low * Changes to avoid display of ugly google openids, by displaying diff --git a/doc/style.css b/doc/style.css index bf000dae1..8dd3b1c15 100644 --- a/doc/style.css +++ b/doc/style.css @@ -91,6 +91,10 @@ nav { text-align: center; } +img.img { + margin: 0.5ex; +} + .align-left { float:left; } -- cgit v1.2.3 From 7e3fb8b8a230a725df7814c15745c6fee9ddd5b1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Jul 2010 20:19:31 -0400 Subject: comments: Added commentmoderation directive for easy linking to the comment moderation queue. --- IkiWiki/Plugin/comments.pm | 17 +++++++++++++++++ debian/changelog | 2 ++ doc/examples/blog/comments.mdwn | 2 +- doc/ikiwiki/directive/commentmoderation.mdwn | 9 +++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 doc/ikiwiki/directive/commentmoderation.mdwn (limited to 'debian') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 30ade5634..f0eec9ace 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -22,6 +22,7 @@ sub import { hook(type => "checkconfig", id => 'comments', call => \&checkconfig); hook(type => "getsetup", id => 'comments', call => \&getsetup); hook(type => "preprocess", id => 'comment', call => \&preprocess); + hook(type => "preprocess", id => 'commentmoderation', call => \&preprocess_moderation); # here for backwards compatability with old comments hook(type => "preprocess", id => '_comment', call => \&preprocess); hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi); @@ -251,6 +252,22 @@ sub preprocess { return $content; } +sub preprocess_moderation { + my %params = @_; + + $params{desc}=gettext("Comment Moderation") + unless defined $params{desc}; + + if (length $config{cgiurl}) { + return ''.$params{desc}.''; + } + else { + return $params{desc}; + } +} + sub sessioncgi ($$) { my $cgi=shift; my $session=shift; diff --git a/debian/changelog b/debian/changelog index d426be019..18db7c0c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (3.20100705) UNRELEASED; urgency=low * img: Add a margin around images displayed by this directive. + * comments: Added commentmoderation directive for easy linking to the + comment moderation queue. -- Joey Hess Mon, 05 Jul 2010 13:59:42 -0400 diff --git a/doc/examples/blog/comments.mdwn b/doc/examples/blog/comments.mdwn index 52c7d3132..e22b50a34 100644 --- a/doc/examples/blog/comments.mdwn +++ b/doc/examples/blog/comments.mdwn @@ -1,7 +1,7 @@ [[!sidebar content=""" [[!inline pages="comment_pending(./posts/*)" feedfile=pendingmoderation description="comments pending moderation" show=-1]] -Comments in the moderation queue: +Comments in the [[!commentmoderation desc="moderation queue"]]: [[!pagecount pages="comment_pending(./posts/*)"]] """]] diff --git a/doc/ikiwiki/directive/commentmoderation.mdwn b/doc/ikiwiki/directive/commentmoderation.mdwn new file mode 100644 index 000000000..8553b5b17 --- /dev/null +++ b/doc/ikiwiki/directive/commentmoderation.mdwn @@ -0,0 +1,9 @@ +The `commentmoderation` directive is supplied by the +[[!iki plugins/comments desc=comments]] plugin, and is used to link +to the comment moderation queue. + +Example: + + \[[!commentmoderation desc="here is the comment moderation queue"]] + +[[!meta robots="noindex, follow"]] -- cgit v1.2.3 From 2dd0c177a6b33488dfcfff9041a3749b44484f34 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Jul 2010 13:57:17 -0400 Subject: aggregate: Write timestamp next aggregation can happen to .ikiwiki/aggregatetime, to allow for more sophisticated cron jobs. --- IkiWiki/Plugin/aggregate.pm | 18 ++++++++++++++++-- debian/changelog | 2 ++ doc/plugins/aggregate.mdwn | 15 ++++++++++++--- 3 files changed, 30 insertions(+), 5 deletions(-) (limited to 'debian') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 5a9eb433d..7789c4c2a 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -298,7 +298,7 @@ sub loadstate () { return if $state_loaded; $state_loaded=1; if (-e "$config{wikistatedir}/aggregate") { - open(IN, "$config{wikistatedir}/aggregate") || + open(IN, "<", "$config{wikistatedir}/aggregate") || die "$config{wikistatedir}/aggregate: $!"; while () { $_=IkiWiki::possibly_foolish_untaint($_); @@ -335,7 +335,7 @@ sub savestate () { garbage_collect(); my $newfile="$config{wikistatedir}/aggregate.new"; my $cleanup = sub { unlink($newfile) }; - open (OUT, ">$newfile") || error("open $newfile: $!", $cleanup); + open (OUT, ">", $newfile) || error("open $newfile: $!", $cleanup); foreach my $data (values %feeds, values %guids) { my @line; foreach my $field (keys %$data) { @@ -356,6 +356,20 @@ sub savestate () { close OUT || error("save $newfile: $!", $cleanup); rename($newfile, "$config{wikistatedir}/aggregate") || error("rename $newfile: $!", $cleanup); + + my $timestamp=undef; + foreach my $feed (keys %feeds) { + my $t=$feeds{$feed}->{lastupdate}+$feeds{$feed}->{updateinterval}; + if (! defined $timestamp || $timestamp > $t) { + $timestamp=$t; + } + } + $newfile=~s/\.new$/time/; + open (OUT, ">", $newfile) || error("open $newfile: $!", $cleanup); + if (defined $timestamp) { + print OUT $timestamp."\n"; + } + close OUT || error("save $newfile: $!", $cleanup); } sub garbage_collect () { diff --git a/debian/changelog b/debian/changelog index 18db7c0c2..9d88b5c9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ikiwiki (3.20100705) UNRELEASED; urgency=low * img: Add a margin around images displayed by this directive. * comments: Added commentmoderation directive for easy linking to the comment moderation queue. + * aggregate: Write timestamp next aggregation can happen to + .ikiwiki/aggregatetime, to allow for more sophisticated cron jobs. -- Joey Hess Mon, 05 Jul 2010 13:59:42 -0400 diff --git a/doc/plugins/aggregate.mdwn b/doc/plugins/aggregate.mdwn index bb828b05c..2925b6fba 100644 --- a/doc/plugins/aggregate.mdwn +++ b/doc/plugins/aggregate.mdwn @@ -5,9 +5,13 @@ This plugin allows content from other feeds to be aggregated into the wiki. To specify feeds to aggregate, use the [[ikiwiki/directive/aggregate]] [[ikiwiki/directive]]. -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. +## requirements + +The [[meta]] and [[tag]] plugins are also recommended to be used with this +one. Either the [[htmltidy]] or [[htmlbalance]] plugin is suggested, since +feeds can easily contain html problems, some of which these plugins can fix. + +## triggering aggregation 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 @@ -15,6 +19,11 @@ crontab entry: */15 * * * * ikiwiki --setup my.wiki --aggregate --refresh +The plugin updates a file `.ikiwiki/aggregatetime` with the unix time stamp +when the next aggregation run could occur. (The file may be empty, if no +aggregation is required.) This can be integrated into more complex cron +jobs or systems to trigger aggregation only when needed. + Alternatively, you can allow `ikiwiki.cgi` to trigger the aggregation. You should only need this if for some reason you cannot use cron, and instead want to use a service such as [WebCron](http://webcron.org). To enable -- cgit v1.2.3 From 7dbad39bbe93ebcc05f278965906fd1c77d2bc34 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Jul 2010 14:01:52 -0400 Subject: Add --changesetup mode that allows easily changing options in a setup file. --- debian/changelog | 2 ++ doc/setup.mdwn | 6 ++++++ doc/usage.mdwn | 14 +++++++++++--- ikiwiki.in | 38 ++++++++++++++++++++++++++------------ 4 files changed, 45 insertions(+), 15 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 9d88b5c9c..c340f8901 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (3.20100705) UNRELEASED; urgency=low comment moderation queue. * aggregate: Write timestamp next aggregation can happen to .ikiwiki/aggregatetime, to allow for more sophisticated cron jobs. + * Add --changesetup mode that allows easily changing options in a + setup file. -- Joey Hess Mon, 05 Jul 2010 13:59:42 -0400 diff --git a/doc/setup.mdwn b/doc/setup.mdwn index 03fed3aa9..266222cc3 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -102,6 +102,12 @@ After making changes to this file, you need to tell ikiwiki to use it: % ikiwiki -setup foo.setup +Alternatively, you can ask ikiwiki to change settings in the file for you: + + % ikiwiki -changesetup foo.setup -plugin goodstuff + +See [[usage]] for more options. + ## Customizing file locations As a wiki compiler, ikiwiki builds a wiki from files in a source directory, diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 2f87d60d5..840d105d2 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -32,14 +32,22 @@ These options control the mode that ikiwiki operates in. * --setup setupfile - In setup mode, ikiwiki reads the config file, which is really a perl - program that can call ikiwiki internal functions. - The default action when --setup is specified is to automatically generate wrappers for a wiki based on data in a setup file, and rebuild the wiki. If you only want to build any changed pages, you can use --refresh with --setup. +* --changesetup setupfile + + Reads the setup file, adds any configuration changes specified by other + options, and writes the new configuration back to the setup file. Also + updates any configured wrappers. In this mode, the wiki is not fully + rebuilt, unless you also add --rebuild. + + Example, to enable some plugins: + + ikiwiki --changesetup ~/ikiwiki.setup --plugin goodstuff --plugin calendar + * --dumpsetup setupfile Causes ikiwiki to write to the specified setup file, dumping out diff --git a/ikiwiki.in b/ikiwiki.in index ac43044df..aa3337938 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -14,24 +14,32 @@ sub usage () { gettext(" ikiwiki --setup configfile"), "\n"; } +sub setup (@) { + require IkiWiki::Setup; + my $verbose=$config{verbose}; + my $syslog=$config{syslog}; + IkiWiki::Setup::load($_[1]); + $config{setupverbose}=$config{verbose}; + $config{setupsyslog}=$config{syslog}; + $config{verbose}=$verbose || $config{setupverbose}; + $config{syslog}=$syslog; + $config{setup}=1; +} + sub getconfig () { if (! exists $ENV{WRAPPED_OPTIONS}) { %config=defaultconfig(); eval q{use Getopt::Long}; Getopt::Long::Configure('pass_through'); GetOptions( - "setup|s=s" => sub { - require IkiWiki::Setup; - my $verbose=$config{verbose}; - my $syslog=$config{syslog}; - IkiWiki::Setup::load($_[1]); - $config{setupverbose}=$config{verbose}; - $config{setupsyslog}=$config{syslog}; - $config{verbose}=$verbose || $config{setupverbose}; - $config{syslog}=$syslog; - $config{setup}=1; - }, + "setup|s=s" => \&setup, "dumpsetup|s=s" => \$config{dumpsetup}, + "changesetup|s=s" => sub { + $config{changesetup}=$_[1]; + $config{genwrappers}=1; + $config{refresh}=1; + setup(@_); + }, "wikiname=s" => \$config{wikiname}, "verbose|v!" => \$config{verbose}, "syslog!" => \$config{syslog}, @@ -85,7 +93,8 @@ sub getconfig () { $config{wrappermode}=possibly_foolish_untaint($_[1]) }, "plugin=s@" => sub { - push @{$config{add_plugins}}, $_[1]; + push @{$config{add_plugins}}, $_[1] + unless grep { $_ eq $_[1] } @{$config{add_plugins}}; }, "disable-plugin=s@" => sub { push @{$config{disable_plugins}}, $_[1]; @@ -181,6 +190,11 @@ sub main () { } } + if ($config{changesetup}) { + require IkiWiki::Setup; + IkiWiki::Setup::dump($config{changesetup}); + } + if ($config{dumpsetup}) { $config{srcdir}="" if ! defined $config{srcdir}; $config{destdir}="" if ! defined $config{destdir}; -- cgit v1.2.3