diff options
author | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2009-07-18 13:08:13 +0100 |
---|---|---|
committer | Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/> | 2009-07-18 13:08:13 +0100 |
commit | 900d428e5f28f6b7f98afd36f3e261b3b89b8033 (patch) | |
tree | 11536974d89fc81e5a9281b6fcbad5728b696f66 /doc/todo/tmplvars_plugin.mdwn | |
parent | d2b1264546fa412db8c1591bc8bb14aba04b960d (diff) | |
download | ikiwiki-900d428e5f28f6b7f98afd36f3e261b3b89b8033.tar ikiwiki-900d428e5f28f6b7f98afd36f3e261b3b89b8033.tar.gz |
Some more attempts to review patches
Diffstat (limited to 'doc/todo/tmplvars_plugin.mdwn')
-rw-r--r-- | doc/todo/tmplvars_plugin.mdwn | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/todo/tmplvars_plugin.mdwn b/doc/todo/tmplvars_plugin.mdwn index 644cf23aa..2fe819682 100644 --- a/doc/todo/tmplvars_plugin.mdwn +++ b/doc/todo/tmplvars_plugin.mdwn @@ -2,6 +2,29 @@ A simple plugin to allow per-page customization of a template by passing paramat [[!tag patch]] +> The implementation looks fine to me (assuming it works with current ikiwiki), +> apart from the "XXX" already noted in the patch. The design could reasonably +> be considered premature generalization, though - how often do you actually +> need to define new tmplvars? +> +> As for the page/destpage/preview thing, it would be good if the preprocess +> hook could distinguish between software-supplied and user-supplied +> parameters (the [[plugins/tag]] plugin could benefit from this too). Perhaps +> the IkiWiki core could be modified so that +> `hook(type => "preprocess", splitparams => 1, ...)` would invoke preprocess +> with { page => "foo", destpage => "bar", ... } as a special first argument, +> and the user-supplied parameters as subsequent arguments? Then plugins like +> tag could use: +> +> my $ikiparams = shift; +> my %params = @_; +> +> add_tags($ikiparams->{page}, keys %params); +> +> --[[smcv]] + +---- + #!/usr/bin/perl package IkiWiki::Plugin::tmplvars; |