Antonvh
Antonvh

Reputation: 387

Shouldn't kramdown rouge generate syntax highlight classes with jekyll?

I expected kramdown with rouge to add spans for colorful highlighting, but it just generates a code block.

<pre>
<code class="language-py">
def say_hello():
    print "Hello world"

say_hello()
</code></pre>

Should I use highlight js to add pretty colors? Shouldn't rouge add the right spans?

My config.yml says:

markdown: kramdown
kramdown:
     input: GFM
     syntax_highlighter: rouge

Jekyll runs fine, grunt runs fine, I tried: gem install kramdown rouge just to be sure. I use backticks for code and run jekyll locally.

```py
def say_hello():
    print "Hello world"

say_hello()
```

Upvotes: 2

Views: 826

Answers (1)

Raphael
Raphael

Reputation: 10579

With kramdown, use

~~~language
... code ...
~~~

do get hightlighting (cf the documentation).

Upvotes: 1

Related Questions