If you use Jekyll with the Pygments syntax-highlighting package, it’s possible to write
{% highlight clojure %}
(def something :foobar)
{% endhighlight %}
which produces a <div>
containing that line, syntax-highlighted according to Clojure syntax. But is there a way to get the syntax highlighting in the middle of a paragraph? I’d like to be able to write
In Clojure, keywords like {% highlight clojure %}:foobar{% endhighlight %}
are prepended by colons.
The desired behavior here is that the Clojure keyword would be highlighted using the same style as was used for the keyword in the first example. When I try to do this, though, it just produces a <div>
like before. (And maybe this is specific to the Kramdown markdown engine I’m using, but the div tag itself is HTML-escaped so that you can see “<div>” right there in the generated text.)
Is there a way to get Jekyll/Pygments to do “inline” syntax highlighting like this?