diff MoinMoin/formatter/text_html.py @ 2713:ddb2d19684d7

add transclusion / transclusion_param formatter methods (for html: <object> / <param>)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 23 Aug 2007 10:29:42 +0200
parents d2d4e74978bd
children 907b9e60c232
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Wed Aug 22 12:38:14 2007 +0200
+++ b/MoinMoin/formatter/text_html.py	Thu Aug 23 10:29:42 2007 +0200
@@ -1042,6 +1042,8 @@
             return self._open('hr', newline=1, attr={'class': 'hr%d' % size}, **kw)
         return self._open('hr', newline=1, **kw)
 
+    # Images / Transclusion ##############################################
+
     def icon(self, type):
         return self.request.theme.make_icon(type)
 
@@ -1056,6 +1058,24 @@
             kw['src'] = src
         return self._open('img', **kw)
 
+    def transclusion(self, on, **kw):
+        """Transcludes (includes/embeds) another object."""
+        if on:
+            return self._open('object',
+                              allowed_attrs=['archive', 'classid', 'codebase',
+                                             'codetype', 'data', 'declare',
+                                             'height', 'name', 'standby',
+                                             'type', 'width', ],
+                              **kw)
+        else:
+            return self._close('object')
+
+    def transclusion_param(self, **kw):
+        """Give a parameter to a transcluded object."""
+        return self._open('param',
+                          allowed_attrs=['name', 'type', 'value', 'valuetype', ],
+                          **kw)
+
     # Lists ##############################################################
 
     def number_list(self, on, type=None, start=None, **kw):