changeset 305:e94b38f4ba6b

macro.Image: description added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 27 Nov 2008 00:08:52 +0100
parents 13f0e4e3f976
children 2f1b790d9746
files data/plugin/macro/Image.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/Image.py	Wed Nov 26 23:50:27 2008 +0100
+++ b/data/plugin/macro/Image.py	Thu Nov 27 00:08:52 2008 +0100
@@ -234,7 +234,7 @@
         return cache.url(request, key)
 
 
-def macro_Image(macro, itemname=wikiutil.required_arg(unicode), width=9999, height=9999, alt=u''):
+def macro_Image(macro, itemname=wikiutil.required_arg(unicode), width=9999, height=9999, alt=u'', description=u''):
     """ Embed an Image into a wiki page.
 
         We use a very high default value for width and height, because PIL will calculate the
@@ -247,7 +247,10 @@
     if '/' not in itemname:
         itemname = macro.formatter.page.page_name + '/' + itemname
     img = Image(macro.request, itemname, caption=alt)
-    return "%s%s%s" % ('<div class="thumbnail">', 
-                        macro.formatter.image(src=img.url((width, height)), alt=img.caption),
-                        '</div>')
+    return "%s%s%s%s%s%s" % ('<div class="thumbnail">', 
+                             macro.formatter.image(src=img.url((width, height)), alt=img.caption),
+                             '<div class="html-show-alias">',
+                             macro.formatter.text(description),
+                             '</div>',
+                             '</div>')