From 895945e3cc1b25a00708227307bdeee5e0ed20f9 Mon Sep 17 00:00:00 2001 From: Kura Date: Mon, 19 Aug 2013 11:45:59 +0100 Subject: [PATCH] Removed YouTube directive as it's been moved to a Plugin --- pelican/rstdirectives.py | 57 ---------------------------------------- 1 file changed, 57 deletions(-) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index fb4a6c93..07c40f5e 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -41,63 +41,6 @@ directives.register_directive('code-block', Pygments) directives.register_directive('sourcecode', Pygments) -class YouTube(Directive): - """ Embed YouTube video in posts. - - Courtesy of Brian Hsu: https://gist.github.com/1422773 - - VIDEO_ID is required, with / height are optional integer, - and align could be left / center / right. - - Usage: - .. youtube:: VIDEO_ID - :width: 640 - :height: 480 - :align: center - """ - - def align(argument): - """Conversion function for the "align" option.""" - return directives.choice(argument, ('left', 'center', 'right')) - - required_arguments = 1 - optional_arguments = 2 - option_spec = { - 'width': directives.positive_int, - 'height': directives.positive_int, - 'align': align - } - - final_argument_whitespace = False - has_content = False - - def run(self): - videoID = self.arguments[0].strip() - width = 420 - height = 315 - align = 'left' - - if 'width' in self.options: - width = self.options['width'] - - if 'height' in self.options: - height = self.options['height'] - - if 'align' in self.options: - align = self.options['align'] - - url = 'http://www.youtube.com/embed/%s' % videoID - div_block = '
' % align - embed_block = '' % (width, height, url) - - return [ - nodes.raw('', div_block, format='html'), - nodes.raw('', embed_block, format='html'), - nodes.raw('', '
', format='html')] - -directives.register_directive('youtube', YouTube) - _abbr_re = re.compile('\((.*)\)$')