--- a/src/pyams_utils/fanstatic.py Mon Jun 19 15:45:39 2017 +0200
+++ b/src/pyams_utils/fanstatic.py Mon Jun 19 15:54:58 2017 +0200
@@ -9,7 +9,6 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
-from pyramid.path import DottedNameResolver
__docformat__ = 'restructuredtext'
@@ -23,6 +22,7 @@
from fanstatic import Resource
from fanstatic.core import set_resource_file_existence_checking, render_css, NeededResources
from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
+from pyramid.path import DottedNameResolver
from zope.interface import Interface
@@ -62,7 +62,17 @@
@adapter_config(name='resource_path', context=(Interface, Interface, Interface), provides=ITALESExtension)
class FanstaticTalesExtension(ContextRequestViewAdapter):
- """extension:fanstatic() TALES extension"""
+ """extension:resource_path() TALES extension
+
+ This TALES extension generates an URL matching a given Fanstatic resource.
+ Resource is given as a string made of package name (in dotted form) followed by a colon and by the resource name.
+
+ For example::
+
+ .. code-block:: html
+
+ <div tal:attributes="data-ams-plugin-pyams_content-src extension:resource_path('pyams_content.skin:pyams_content')" />
+ """
def render(self, resource):
library, resource_name = resource.split(':')