Enable line numbers globally


#1

I’m trying to enable line numbers in code blocks globally, but so far I haven’t found a setting in _config.yml that works. According to this GitHub issue, I’ve tried:

highlighter: rouge

linenos: true

highlight:
  linenos: true

highlight_options:
  linenos: true

kramdown:
  input:          GFM
  # https://github.com/jekyll/jekyll/pull/4090
  syntax_highlighter: rouge

  syntax_highlighter_opts:
    css_class: 'highlight'
    span:
      line_numbers: false
    block:
      line_numbers: true
      start_line: 1

But none of these options has the desired effect. Any ideas what could be the issue here?


#2

Have you tried using Javascript?


#3

I’m not sure I understand what you mean. Do you mean code blocks with JavaScript highlighting? I only tried Python blocks so far, and when I use liquid tags it works (but not with triple-backticked blocks).