righimg floats an image to the right, with caption if the caption key is
provided in the parameters. All other parameters are rendered into the
image tag, which means at least 'src' must be provided.
font-size: 1.5em;\r
font-weight: bold;\r
}\r
+\r
+/* =============================================\r
+ Floating right image with caption\r
+================================================ */\r
+\r
+div.rightimg {\r
+ float: right;\r
+ display: table;\r
+ margin: 0 0 0.5em 0.5em;\r
+ padding: 0.5em;\r
+}\r
+div.rightimg p {\r
+ display: table-caption;\r
+ caption-side: bottom;\r
+ text-align: center;\r
+ font-style: italic;\r
+ font-size: smaller;\r
+ text-indent: 0;\r
+}\r
"read_html",
"read_copyonly",
"read_markdown",
+ "rightimg",
"template_mako",
"google_sitemap",
]
--- /dev/null
+# -*- 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