diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-31 20:57:03 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-01-31 20:58:19 +0100 |
commit | cf41e7d7444fb9d19a777a4720d9b00684e6fe7b (patch) | |
tree | 92b027ff5fe93492ad3351117a368a4770333c4d /mediagoblin/tools/pluginapi.py | |
parent | 8a4d0dbc07c2243c5b5ce123ac1ffafb6bfb19cb (diff) | |
download | mediagoblin-cf41e7d7444fb9d19a777a4720d9b00684e6fe7b.tar.lz mediagoblin-cf41e7d7444fb9d19a777a4720d9b00684e6fe7b.tar.xz mediagoblin-cf41e7d7444fb9d19a777a4720d9b00684e6fe7b.zip |
Improve formatting for hook template docs.
Diffstat (limited to 'mediagoblin/tools/pluginapi.py')
-rw-r--r-- | mediagoblin/tools/pluginapi.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mediagoblin/tools/pluginapi.py b/mediagoblin/tools/pluginapi.py index 8321d73d..784bede9 100644 --- a/mediagoblin/tools/pluginapi.py +++ b/mediagoblin/tools/pluginapi.py @@ -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 %} |