# -*- coding: iso-8859-1 -*- u''' MoinMoin - YouTubeVideo macro Version 0.1 Displays an embedded video <> If an video_id is not given, no element will be shown Examples: * <> * <> Repository for the macro: https://git.cpi.imtek.uni-freiburg.de/holgi/YouTubeVideoMacro @copyright: 2018 by Holger Frey @license: Beerware license ''' from MoinMoin import wikiutil def macro_YouTubeVideo(macro, video_id=None, width=None, height=None): request = macro.request _ = request.getText if video_id is None: # no video id given return macro.formatter.rawHTML(u'') width = '' if width is None else 'width="%s"' % str(width) height = '' if height is None else 'height="%s"' % str(height) tmp = (u'' ) html = tmp % (video_id, width, height) return macro.formatter.rawHTML(html)