From 95b44ef8bff2d6c73713ca0aef0abf33848ee168 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 18 Jun 2011 18:59:44 +0200 Subject: [PATCH] Add Pygments support to the default sourcecode directive. It is now possible to have highlited sourcecode using the ``::`` syntax. --- pelican/rstdirectives.py | 1 + samples/content/super_article.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index 4849c9c2..3d7c2fe7 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -35,3 +35,4 @@ class Pygments(Directive): return [nodes.raw('', parsed, format='html')] directives.register_directive('code-block', Pygments) +directives.register_directive('sourcecode', Pygments) diff --git a/samples/content/super_article.rst b/samples/content/super_article.rst index 03273fad..1dfd8e34 100644 --- a/samples/content/super_article.rst +++ b/samples/content/super_article.rst @@ -26,7 +26,7 @@ And here comes the cool stuff_. :width: 600 px :alt: alternate text -.. code-block:: python +:: >>> from ipdb import set_trace >>> set_trace()