Syntax highlighting markdown code blocks in Jekyll (without using liquid tags)

Fenced blocks were introduced with Redcarpet 2. Jekyll now supports Redcarpet 2.

As an aside I am using Redcarpet with Rouge until Kramdown support is available.

In addition some people prefer Nanoc to Jekyll.


Alternate solution

Markdown allows HTML, so if you don't mind adding a bit of JS, you could do this:

## A section

Here is some Ruby code.

<pre>
  <code class="ruby">
    puts "hello"
  </code>
</pre>

Then you could use Highlight.js (documentation here) to add highlighting based on that class.

It's not an ideal solution, but it should work with any Markdown parser.