This filter converts a reStructuredText string to HTML. It has a special directive sourcecode which highlights a code-block if the Pygments library is installed. Example:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut
.. sourcecode:: python
def foo(bar):
return bar
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut
The directive sourcecode follows a keyword (a lexer) which language should been used to highlight the code block. Here python is used. A list of all available lexers is available under Pygments Lexer.
See a quick reference about reStructuredText.