aboutsummaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
authorJon Dowland <jmtd@debian.org>2012-09-20 13:59:43 +0100
committerJon Dowland <jmtd@debian.org>2012-09-20 13:59:43 +0100
commit2f00530f28da081207f0c9d5d6fbbcbd66da5166 (patch)
treedbc7fb79abb993a1a0830d2d101007b0fea94d37 /doc/todo
parent060d21a1eab8fadefe674da319518b12d998ff4f (diff)
downloadikiwiki-2f00530f28da081207f0c9d5d6fbbcbd66da5166.tar
ikiwiki-2f00530f28da081207f0c9d5d6fbbcbd66da5166.tar.gz
thanks for response; follow-up; I've got something working…
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/publishing_in_the_future.mdwn35
1 files changed, 33 insertions, 2 deletions
diff --git a/doc/todo/publishing_in_the_future.mdwn b/doc/todo/publishing_in_the_future.mdwn
index 2b7a43da7..55fe3aa1f 100644
--- a/doc/todo/publishing_in_the_future.mdwn
+++ b/doc/todo/publishing_in_the_future.mdwn
@@ -24,9 +24,9 @@ unpublished pages as 'dirty' so they were always scanned on refresh until their
publish date has occurred. That could perhaps be implemented via a small plugin
which defined a pagespec which ensured the page was 'dirty':
- \[[!if test="current_date_before(<TMPL_VAR date>)"
+ \[[!meta date="<TMPL_VAR date>"]]
+ \[[!if test="!current_date_before(<TMPL_VAR date>)"
then="""[[!tag draft]][[!dirty]]"""
- else="""[[!meta date="<TMPL_VAR date>"]]"""
]]
The following is an attempt at the dirty part:
@@ -94,3 +94,34 @@ Thoughts on the whole idea? — [[Jon]]
> I feel my idea there about making a pagespec that is limited to
> items in the present/past, combined with setting the meta data, is a good
> way.. --[[Joey]]
+
+>> Thanks for your response Joey. Should I merge these two TODOs, then?
+>> So if I understand you correctly, you would prefer some new pagespecs
+>> to match future/past dates, and a plugin which kept track of pages with
+>> a future date and kept them 'dirty' (similar to the above), which means
+>> avoiding the need for a `dirty` pagespec in the page itself. Is that
+>> about right?
+>>
+>> I came up with the following, but I haven't adapted `dirty.pm` inline
+>> with my understanding above, yet.
+
+ sub match_infuture ($$;@) {
+ my $page = shift;
+ return IkiWiki::SuccessReason->new("page time is in the future")
+ if $IkiWiki::pagectime{$page} > time;
+ return IkiWiki::FailReason->new("page time is not in the future");
+ }
+
+>> I've managed to get my original suggestion working. The problem was
+>> I was using quotes when invoking the pagespec, which stopped `str2time`
+>> working.
+>>
+>> Let me know if I've understood your POV correctly and I'll see about
+>> tidying this up and putting it in a branch.
+>>
+>> Finally, a way of scheduling future runs of ikiwiki *within ikiwiki
+>> itself* might be useful for other things too, and would avoid the
+>> need for a cron job in this case. (I'm thinking of a plugin that
+>> implemented itself in terms of cron, or at, or both, or possibly
+>> other things depending on what people want to support). But that would
+>> be substantially more work, more than I can afford atm at least. — [[Jon]]