From 33e967277642266ec93192a0902eba8963f1d6d0 Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Fri, 22 Feb 2013 14:46:31 +0100 Subject: [PATCH] Improve the ITemplateHelpers docstrings Just make the docstrings a bit clearer and more explicit, and reference the new example_itemplatehelpers extension. --- ckan/plugins/interfaces.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/ckan/plugins/interfaces.py b/ckan/plugins/interfaces.py index 91e8c71a889..545ad07897a 100644 --- a/ckan/plugins/interfaces.py +++ b/ckan/plugins/interfaces.py @@ -511,14 +511,22 @@ def get_auth_functions(self): class ITemplateHelpers(Interface): - """ - Allow adding extra template functions available via h variable - """ + '''Add custom template helper functions. + + By implementing this plugin interface plugins can provide their own + template helper functions, which custom templates can then access via the + ``h`` variable. + + See ``ckanext/example_itemplatehelpers`` for an example plugin. + + ''' def get_helpers(self): - """ - Should return a dict, the keys being the name of the helper - function and the values being the functions themselves. - """ + '''Return a dict mapping names to helper_functions. + + The keys of the dict should be the names of the helper functions, and + the values should be the functions themselves. + + ''' class IDatasetForm(Interface):