【发布时间】:2014-05-07 07:01:42
【问题描述】:
我在博客上使用 pygments 版本 1.6 来做一些语法高亮(通过 CodeHilite 扩展用于降价)
python 的语法高亮非常棒。但是,如果我尝试使用 pytb 词法分析器来突出显示 python 回溯,那么它会非常令人印象深刻
我可以检查它是否可用:
for lexer in pygments.lexers.get_all_lexers():
print lexer
........
('Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',))
.......
但它看起来不像演示: http://pygments.org/demo/61075/?style=native
相反,它以基本的白色字体突出显示。
编辑
我的代码:
<div class="codehilite">
<pre>
<span class="go">TypeError: Error when calling the metaclass bases</span>
<span class="go"> class _AsyncDeviceInquiry does not correctly implement protocol IOBluetoothDeviceInquiryDelegate: the signature for method deviceInquiryComplete:error:aborted: is v@:@iB instead of v@:@iZ</span>
</pre>
</div>
演示中的代码
<div class="syntax">
<pre>
:
<span class="nc">ImportError</span>
:
<span class="n-Identifier">('No module named TMPD54~1.049d4d1330606d5fa968586a2810c4fc', '[DimShuffle{x}(TensorConstant{2.0})]')</span>
</pre>
</div>
【问题讨论】: