X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3eea683d71f95fcda8e555002567fe081fee9937..8125cfa45b38b653266d03e6106a918f64a7d225:/doc/todo/plugin_data_storage.mdwn?ds=sidebyside diff --git a/doc/todo/plugin_data_storage.mdwn b/doc/todo/plugin_data_storage.mdwn index 79e750707..21e925b5b 100644 --- a/doc/todo/plugin_data_storage.mdwn +++ b/doc/todo/plugin_data_storage.mdwn @@ -44,7 +44,10 @@ data all the time when using it would quite suck, so no, let's not do that. Note that for the aggregate plugin to use this, it will need some changes: * guid data will need to be stored as part of the data for the page - that was aggregated from that guid + that was aggregated from that guid. Except, expired pages don't exit, but + still have guid data to store. Hmm. I suppose the guid data could be + considered to be associated with the page that contains the aggregate + directive then. * All feeds will need to be marked as removable in loadstate, and only unmarked if seen in preprocess. Then savestate will need to not only remove any feeds still marked as such, but do the unlinking of pages @@ -55,3 +58,37 @@ If I do this, I might as well also: * Change the link= link= stuff to just links=link+link etc. * Change the delimiter from space to comma; commas are rare in index files, so less ugly escaped delimiters to deal with. + +--- + +The [[plugins/calendar]] plugin could use plugin data storage to record +which pages have a calendar for the current time. Then ensure they are +rebuilt at least once a day. Currently, it needs a cron job to rebuild +the *whole* wiki every day; with this enhancement, the cron job would only +rebuild the few pages that really need it. + + +--- + +New design: + +`%Ikiwiki::state` is an exported hash that stores per-page state. +Set with `$state{$page}{id}{key}=$value`. The `id` is the same `id` passed +to `hook()`. + +This is stored in the index like: + +src=foo.mdwn dest=bar.mdwn id_key=value [...] + +The underscore ensures that there's no conflict with ikiwiki's own +state variables. (Note that `id` and `key` need to be encoded here.) + +Plugins are reponsible for deleting old state info, though ikiwiki will +handle deleting it if a page is removed. + +Ikiwiki needs to know when it can drop state for plugins that are no longer +enabled. This is done via `hook()` -- if a plugin registers a hook +ikiwiki knows it's still active, and preserves the state for the hook id. +If not, that state will be dropped. + +[[done]]!! Now to use it..