6

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.

AlwaysQuestioning
  • 1,464
  • 4
  • 24
  • 48
  • By "older" you appear to mean the [pygments code formatter](http://pygments.org/docs/filters/) and it's option, that is not around in the now default [„rouge“ highlighter](https://github.com/jneen/rouge#full-options). – Frank N Apr 11 '18 at 03:52

1 Answers1

9

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;
}
Shadowfacts
  • 1,038
  • 10
  • 22