Improve formatting for hook template docs.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Thu, 31 Jan 2013 19:57:03 +0000 (20:57 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Thu, 31 Jan 2013 19:58:19 +0000 (20:58 +0100)
docs/source/pluginwriter/api.rst
mediagoblin/tools/pluginapi.py

index f700e16152effc297b5dc769ce2f874941d018b6..42dc3a3d32247bb86659ee2de87ad26366ffa8a1 100644 (file)
@@ -20,4 +20,5 @@ Plugin API
 -----------------------
 
 .. automodule:: mediagoblin.tools.pluginapi
-   :members: get_config, register_routes, register_template_path, register_template_hooks, get_hook_templates
+   :members: get_config, register_routes, register_template_path,
+             register_template_hooks, get_hook_templates
index 8321d73d3fbcb345bcc998d946df0e937b2f28db..784bede948a59c8a35ab84165d848de399caccc6 100644 (file)
@@ -233,6 +233,9 @@ def register_template_hooks(template_hooks):
     of paths.)
 
     Example:
+
+    .. code-block:: python
+
       {"media_sidebar": "/plugin/sidemess/mess_up_the_side.html",
        "media_descriptionbox": ["/plugin/sidemess/even_more_mess.html",
                                 "/plugin/sidemess/so_much_mess.html"]}
@@ -247,6 +250,8 @@ def get_hook_templates(hook_name):
     Note: for the most part, you access this via a template tag, not
     this method directly, like so:
 
+    .. code-block:: html+jinja
+
       {% template_hook "media_sidebar" %}
 
     ... which will include all templates for you, partly using this
@@ -255,9 +260,11 @@ def get_hook_templates(hook_name):
     However, this method is exposed to templates, and if you wish, you
     can iterate over templates in a template hook manually like so:
 
+    .. code-block:: html+jinja
+
       {% for template_path in get_hook_templates("media_sidebar") %}
         <div class="extra_structure">
-          {% include template_path %"
+          {% include template_path %}
         </div>
       {% endfor %}