Usman Ismail
Usman Ismail

Reputation: 18679

Why is using the highlight tag for syntax highlighting mking code disappear?

I am using Jekyll with pigments to highlight some code in my blog and any code in the highlights tag seems to disappear, i.e. no Html generated.

Here is an example of some such code

{% highlight java %}
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().
setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
{% endhighlight %}

Some other details;

While googling someone suggested running this command to check pygments

echo 'puts "Hello World"' | pygmentize -l ruby -f html -O encoding=utf-8 

For me it returns this error:

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

Upvotes: 0

Views: 662

Answers (2)

Jorge Garc&#237;a
Jorge Garc&#237;a

Reputation: 5113

If you use easy_install Pygments, you should specify which version of Python install.

Maybe this help you!

easy_install-2.7 Pygments

Upvotes: 3

Pradeep Nayak
Pradeep Nayak

Reputation: 675

I think your easy_install eggs were being put in: ~/Library/Python/2.7/site-packages/ while they are needed to be in: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

Just copy the files (eggs and easy_install.path's contents) over and it should solve your problem.

Upvotes: 0

Related Questions