Jekyll Rouge Highlighter

Configuring Rouge Highlighter

Jekyll Rouge Highlighter

by John Vincent


Posted on November 8, 2017


Jekyll Highlighting using Rouge

This article describes how to configure Rouge to handle formatting of Highlights.

General

Jekyll Configuration

Kramdown Options

Kramdown parser

Kramdown Rouge

tab-size

Install

Ensure rouge is installed. Need 1.5 or later.

Check Gemfile.lock, it should already be there.

Use Rouge

_config.yml

markdown: kramdown
highlighter: rouge

kramdown:
  syntax_highlighter: rouge

Line Numbers

markdown: kramdown
highlighter: rouge

kramdown:
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    block:
      line_numbers: true
      start_line: 1

Set Tab Size

The default tab size for a browser is 8 spaces. This will not do.

To change this to 2 spaces, add to css

pre {
	tab-size: 2;
	-moz-tab-size: 2;
}

I am using Sass and so I add to all.scss