我正在使用带有颜色的Jekyll来突出显示我博客中的一些代码,并且高亮标记中的任何代码似乎都消失了,即没有生成Html。
以下是一些此类代码的示例
{% highlight java %}
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().
setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
{% endhighlight %}
其他一些细节;
在谷歌搜索某人时建议运行此命令来检查pygments
echo 'puts "Hello World"' | pygmentize -l ruby -f html -O encoding=utf-8
对我来说,它会返回此错误:
Traceback (most recent call last):
File "/usr/local/bin/pygmentize", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: Pygments==1.5
答案 0 :(得分:3)
如果您使用easy_install Pygments,则应指定安装哪个版本的Python。
也许这可以帮到你!
easy_install-2.7 Pygments
答案 1 :(得分:0)
我认为你的easy_install鸡蛋被放入:~/Library/Python/2.7/site-packages/
他们需要进入:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
只需复制文件(eggs和easy_install.path的内容)即可解决问题。