擅长:python、mysql、java
<p>您可以使用<a href="http://pygments.org/docs/cmdline/" rel="nofollow noreferrer">pygments</a>命令行脚本来获得语法高亮的HTML输出。在</p>
<p>安装:</p>
<pre><code>$ easy_install Pygments
</code></pre>
<p>示例:</p>
^{pr2}$
<p>或更短:</p>
<pre><code>$ git diff | pygmentize -f html -O full,style=emacs -l diff
</code></pre>
<p>注意:要查看所有可用样式,请尝试:</p>
<pre><code>$ pygmentize -L styles
</code></pre>
<p>p.p.S.要使管道完整,可以使用<a href="https://gist.github.com/defunkt/318247" rel="nofollow noreferrer">trick</a>:</p>
<pre><code>$ git diff | pygmentize -f html -O full,style=emacs -l diff | browser
</code></pre>