diff options
author | http://cgray.myopenid.com/ <cgray@web> | 2012-02-09 22:38:20 -0400 |
---|---|---|
committer | admin <admin@branchable.com> | 2012-02-09 22:38:20 -0400 |
commit | 1a163a568ca755749cfba74f3b17a6ef1b8ba504 (patch) | |
tree | 40ec5bf05248ec84b3ae19d7d217a54183015f2e /doc | |
parent | ddea0488e98232c251a9624bdcb2e46a8e9d2d93 (diff) | |
download | ikiwiki-1a163a568ca755749cfba74f3b17a6ef1b8ba504.tar ikiwiki-1a163a568ca755749cfba74f3b17a6ef1b8ba504.tar.gz |
Diffstat (limited to 'doc')
-rw-r--r-- | doc/todo/be_more_selective_about_running_hooks.mdwn | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/todo/be_more_selective_about_running_hooks.mdwn b/doc/todo/be_more_selective_about_running_hooks.mdwn new file mode 100644 index 000000000..0c8e0b090 --- /dev/null +++ b/doc/todo/be_more_selective_about_running_hooks.mdwn @@ -0,0 +1,20 @@ +[[!template id=gitbranch branch=chrismgray/exclusive-hooks author="[[chrismgray]]"]] + +Sometimes plugins register a function with `hook`, but they only want +the function called with the content that they know how to deal with. +Normally, this means that they call `pagetype` first thing in the +function, determine if they know how to deal with the content, and +only do anything if they do. + +This is a bit wasteful in itself, but for external plugins, it's +really bad. For functions like `scan` and `linkify`, where the entire +page is sent back and forth over `stdout` and `stdin`, it really slows +things down. + +Thus, I propose that there be a new optional parameter to `hook` that +tells it that the function should only be called for files whose type +is the same as the id of the plugin calling `hook`. I have called +this parameter `exclusive` in my branch, but this might not be the +best name. + +[[!tag patch]] |