From a5d3acd37cd52a5cf0045ae4d300a2ef13a07a6e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Sep 2008 16:45:27 -0400 Subject: Add %wikistate, which is like %pagestate except not specific to a given page, and is preserved across rebuilds. --- doc/plugins/write.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 0e4f2fd6f..4e27d361d 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -467,6 +467,15 @@ When pages are deleted, ikiwiki automatically deletes their pagestate too. Note that page state does not persist across wiki rebuilds, only across wiki updates. +### %wikistate + +The `%wikistate` hash can be used by a plugin to store persistant state +that is not bound to any one page. To set a value, use +`$wikistate{$id}{$key}=$value, where `$value` is anything Storable can +serialize, `$key` is any string you like, and `$id` must be the same as the +"id" parameter passed to `hook()` when registering the plugin, so that the +state can be dropped if the plugin is no longer used. + ### Other variables If your plugin needs to access data about other pages in the wiki. It can -- cgit v1.2.3