1

I set up a Jekyll blog and I have the following config for syntax highlighting.

markdown: redcarpet
highlighter: pygments

This allows me to add syntax highlighting like this:

```javascript
function blah(){

}
```

Is there any way to keep this format but add line numbers?

GGhe
  • 663
  • 5
  • 17

1 Answers1

1

Out of the box Jekyll code highlight :

{% highlight ruby linenos %}
def foo
  puts 'foo'
end
{% endhighlight %}

And no need to highlight with javascript. Just add pygments css.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147