Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the default tab size in highlighted code in Jekyll 3.0?

If I did:

{% highlight C %}
    .... code
{% endhighlight %}

For any tab I use between the highlighted C, I'd like the tab size to be 2 rather than 4. Doing {% highlight C tabsize=2 %} doesn't seem to work in Jekyll 3.

The answers I have seen on SO seem to work for older versions, but not recent versions.

like image 954
AlwaysQuestioning Avatar asked Apr 22 '17 23:04

AlwaysQuestioning


1 Answers

I don't believe it's possible from Jekyll itself, but you can accomplish this with CSS using the tab-size attribute:

pre {
    tab-size: 2;
}
like image 109
Shadowfacts Avatar answered Oct 22 '22 16:10

Shadowfacts