Add docs for plugins and plugin framework

@redhog please elaborate on / improve 'doc/api/pluginfw.md'!
This commit is contained in:
Marcel Klehr 2012-10-25 15:45:06 +02:00
parent 7f158f697b
commit 63e4aafae8
5 changed files with 123 additions and 17 deletions

14
doc/api/pluginfw.md Normal file
View file

@ -0,0 +1,14 @@
# Plugin Framework
`require("ep_etherpad-lite/static/js/plugingfw/plugins")`
## plugins.update
`require("ep_etherpad-lite/static/js/plugingfw/plugins").update()` will use npm to list all installed modules and read their ep.json files, registering the contained hooks.
A hook registration is a pairs of a hook name and a function reference (filename for require() plus function name)
## hooks.callAll
`require("ep_etherpad-lite/static/js/plugingfw/hooks").callAll("hook_name", {argname:value})` will call all hook functions registered for `hook_name` with `{argname:value}`.
## hooks.aCallAll
?
## ...