Top-rated recipes tagged "pygments"http://code.activestate.com/recipes/tags/pygments/top/2011-02-01T14:21:59-08:00ActiveState Code RecipesGenerate HTML syntax-highlighted listings for any file using pygments (Python) 2011-02-01T14:21:59-08:00ccpizzahttp://code.activestate.com/recipes/users/4170754/http://code.activestate.com/recipes/576812-generate-html-syntax-highlighted-listings-for-any-/ <p style="color: grey"> Python recipe 576812 by <a href="/recipes/users/4170754/">ccpizza</a> (<a href="/recipes/tags/pretty_printer/">pretty_printer</a>, <a href="/recipes/tags/pygments/">pygments</a>, <a href="/recipes/tags/syntax_highlighter/">syntax_highlighter</a>). Revision 6. </p> <p>Generates HTML highlighted code listings for source code files in any language known to pygments. For a list of supported formats see <a href="http://pygments.org/languages" rel="nofollow">http://pygments.org/languages</a></p> <p>Make sure you have <a href="http://pygments.org">pygments</a> is installed. Try <code>easy_install pygments</code>.</p> <p>Example usage:</p> <p><em>output to stdout:</em></p> <pre class="prettyprint"><code>python highlight.py my_source_file.java </code></pre> <p><em>output to file:</em></p> <pre class="prettyprint"><code>python highlight.py my_source_file.java &gt; my_source_file.html </code></pre>