aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/pluginwriter
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-07-12 11:57:16 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-07-12 14:35:43 -0700
commit91bee92e8ef188e4a5aa191b6c047a57a668f5fa (patch)
treebe506f604b7949b0bc0c1abf19b827678ac6f2f3 /docs/source/pluginwriter
parent5305fee13b9f0a2b8f5ebe61f12c09c9cada3cca (diff)
downloadmediagoblin-91bee92e8ef188e4a5aa191b6c047a57a668f5fa.tar.lz
mediagoblin-91bee92e8ef188e4a5aa191b6c047a57a668f5fa.tar.xz
mediagoblin-91bee92e8ef188e4a5aa191b6c047a57a668f5fa.zip
documenting the new media_type plugins and available hooks
Diffstat (limited to 'docs/source/pluginwriter')
-rw-r--r--docs/source/pluginwriter/media_type_hooks.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/source/pluginwriter/media_type_hooks.rst b/docs/source/pluginwriter/media_type_hooks.rst
new file mode 100644
index 00000000..0dfbbafd
--- /dev/null
+++ b/docs/source/pluginwriter/media_type_hooks.rst
@@ -0,0 +1,27 @@
+==================
+ Media Type hooks
+==================
+
+This documents the hooks that are currently available for ``media_type`` plugins.
+
+What hooks are available?
+=========================
+
+'sniff_handler'
+---------------
+
+This hook is used by ``sniff_media`` in ``mediagoblin.media_types.__init__``.
+Your media type should return its ``sniff_media`` method when this hook is
+called.
+
+.. Note::
+ Your ``sniff_media`` method should return either the ``media_type`` or
+ ``None``.
+
+'get_media_type_and_manager'
+----------------------------
+
+This hook is used by ``get_media_type_and_manager`` in
+``mediagoblin.media_types.__init__``. When this hook is called, your media type
+plugin should check if it can handle the given extension. If so, your media
+type plugin should return the media type and media manager.