Author: jvloothuis
Date: Sat May 26 15:14:44 2007
New Revision: 43677

Modified:
   kukit/kss.pylons/trunk/kss/pylons/   (props changed)
   kukit/kss.pylons/trunk/kss/pylons/helpers.py
   kukit/kss.pylons/trunk/kss/pylons/helpers.txt
Log:
Added helper for generating kss attributes


Modified: kukit/kss.pylons/trunk/kss/pylons/helpers.py
==============================================================================
--- kukit/kss.pylons/trunk/kss/pylons/helpers.py        (original)
+++ kukit/kss.pylons/trunk/kss/pylons/helpers.py        Sat May 26 15:14:44 2007
@@ -54,3 +54,6 @@
     url += quote(environ.get('SCRIPT_NAME',''))
 
     return '<base href="%s"/>' % url
+
+def kss_class_attributes(**kwargs):
+    return ' '.join(['kssattr-%s-%s' % item for item in kwargs.items()])

Modified: kukit/kss.pylons/trunk/kss/pylons/helpers.txt
==============================================================================
--- kukit/kss.pylons/trunk/kss/pylons/helpers.txt       (original)
+++ kukit/kss.pylons/trunk/kss/pylons/helpers.txt       Sat May 26 15:14:44 2007
@@ -2,10 +2,38 @@
 Helpers
 =======
 
-The KSS helpers for Pylons generate can be used to easily generate templates.
+The KSS helpers for Pylons generate can be used to easily generate
+templates.
 
-One of the most important helpers is the KSS Javascript include generater.
+
+Javascript inclusion
+--------------------
+
+One of the most important helpers is the KSS Javascript include
+generater.
 
   >>> from kss.pylons.helpers import kss_javascripts
   >>> kss_javascripts()
   '<script type="text/javascript"...</script>'
+
+
+KSS attributes
+--------------
+
+To generate KSS attributes you can use the provided helper. It will
+automatically format all keyword arguments.
+
+  >>> from kss.pylons.helpers import kss_class_attributes
+
+If you put in nothing you will get nothing.
+
+  >>> kss_class_attributes()
+  ''
+
+To output something usefull pass in one or more keyword arguments.
+
+  >>> kss_class_attributes(title='testing', name='another_test')
+  '...kssattr-title-testing...'
+
+  >>> kss_class_attributes(title='testing', name='another_test')
+  '...kssattr-name-another_test...'
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to