Highlight with Jekyll and pygments doesn't work

denisjacquemin picture denisjacquemin · Jul 20, 2011 · Viewed 9.7k times · Source

I want to use pygments with jekyll

I have the following code:

{% highlight java %}
NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap
{% endhighlight %}

When I generate my site with jekyll --pygments, the html result is:

<div>
  <pre><code class="java">NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap</code>
  </pre>
</div>

In this html output there aren't the expected <span class="n"> or <span class="s2"> tags, and the code is not highlighted.

Am I doing something wrong?

Answer

wnascimento picture wnascimento · Mar 20, 2012

You need to have the css generated to highlight.

$ pygmentize -S default -f html > css/pygments/default.css