From d6d2c771bdc111cd26186b1bc42b44f2b3197e05 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 16 May 2013 10:38:45 -0500 Subject: Start of ability to have plugins provide static resources! Note I have not tested any of this yet ;) But we're already on our way: - We've got docs - The hook is there Lots to do still though. But, progress! :) This commit sponsored by Laura Arjona Reina. Thanks larjona! --- docs/source/pluginwriter/api.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/source/pluginwriter/api.rst') diff --git a/docs/source/pluginwriter/api.rst b/docs/source/pluginwriter/api.rst index 5e0568fd..cd06cbc5 100644 --- a/docs/source/pluginwriter/api.rst +++ b/docs/source/pluginwriter/api.rst @@ -125,3 +125,22 @@ context... it is added to the actual context of each individual template render right before it is run! Because of this you also can do some powerful and crazy things, such as checking the request object or other parts of the context before passing them on. + + +Adding static resources +----------------------- + +It's possible to add static resources for your plugin. Say your +plugin needs some special javascript and images... how to provide +them? Then how to access them? MediaGoblin has a way! + + +Attaching to the hook ++++++++++++++++++++++ + +First, you need to register your plugin's resources with the hook. +This is pretty easy actually: you just need to provide a function that +passes back a PluginStatic object. + +.. automodule:: mediagoblin.tools.staticdirect + :members: PluginStatic -- cgit v1.2.3