]> oss.titaniummirror.com Git - oss-web.git/blobdiff - plugins/rightimg.py
Add new plugin rightimg
[oss-web.git] / plugins / rightimg.py
diff --git a/plugins/rightimg.py b/plugins/rightimg.py
new file mode 100644 (file)
index 0000000..45b600e
--- /dev/null
@@ -0,0 +1,16 @@
+# -*- coding: iso-8859-1 -*-
+from webber import *
+
+@set_macro("rightimg")
+def rightimg_macro(params):
+       if cfg.test_verbose:
+               print "in macro skeleton.pull_rightimg_macro, params:", params
+        html = "<div class=\"rightimg\"><img src=\"%s\"" % params['src']
+        for key in params.keys():
+            if key != 'caption' and key != 'src':
+                html += " %s=\"%s\"" % (key, params[key])
+        if 'caption' in params:
+            html += "><p>%s</div>" % params['caption']
+        else:
+            html += "></div>"
+        return html