run-jekyll-on-windows icon indicating copy to clipboard operation
run-jekyll-on-windows copied to clipboard

highlighter: rouge is possibly incorrect/deprecated

Open jacobdeichert opened this issue 10 years ago • 10 comments

Code blocks on my website aren't highlighted when I use

kramdown:
    input: GFM
highlighter: rouge

However, they are highlighted when I use

kramdown:
    input: GFM
    syntax_highlighter: rouge
#highlighter: rouge # This doesn't work?

Maybe something changed since this syntax page was last updated?

I'm running on Kramdown v1.5.0, Jekyll v2.5.3, and Rouge v1.8.0

jacobdeichert avatar Feb 25 '15 16:02 jacobdeichert

GitHub pages do not support Rouge.

https://pages.github.com/versions/

XhmikosR avatar Mar 10 '15 14:03 XhmikosR

I should have specified, I'm not using github pages. I'm running on a digital ocean droplet. Read my issue again please, I said Rouge does work when I specify syntax_highligher: rouge so therefore that should hint that I'm not using github pages.

jacobdeichert avatar Mar 10 '15 16:03 jacobdeichert

No, that does not hint anything.

Anyway, the correct syntax is highlighter and if you have any issue with that you should ask upstream.

XhmikosR avatar Mar 10 '15 17:03 XhmikosR

For future reference, it's best not to assume and rather ask if I was using github pages or not.

I found some more info supporting my claim.

Kramdown's website explicitly says to use syntax_highligher: rouge.

A Jan 2015 blog post also says to use syntax_highligher: rouge.

Apparently this issue says that highlighter: rouge only applies to code wrapped in {% highlight %} and not fenced code blocks (~~~). Fenced code blocks require syntax_highlighter: rouge to be specified.

As it turns out, I use fenced (~~~) code blocks and therefore that's why I needed to specify syntax_highlighter: rouge to get it to work.

http://jekyll-windows.juthilo.com/3-syntax-highlighting/ is definitely confusing since it doesn't explain the difference between the 2 ways to use rouge as a highlighter. I recommend going into more detail on the site to explain the differences I have mentioned here as future viewers may also get confused.

jacobdeichert avatar Mar 11 '15 03:03 jacobdeichert

I'll close this since it's not a bug. Just a recommendation to improve the site. I may submit a pull request when I have time to define the differences on that syntax highlighting page.

jacobdeichert avatar Mar 11 '15 03:03 jacobdeichert

This is somewhat unrelated to the initial issue, but I think it's worth mentioning in the guide that when choosing between Pygments and Rouge that GitHub pages doesn't support Rouge.

I first got here through GitHub pages setup instructions (that brought me to Jekyll's quick start then to this guide) and had no idea why Jekyll wasn't working with my GitHub page. There's no real error message when you use Rouge, the site just doesn't build.

khopsickle avatar Jul 14 '15 06:07 khopsickle

@khopsickle here's a good list of the dependencies that GitHub Pages has https://pages.github.com/versions/

No other plugins can be used/installed at this point in time.

jacobdeichert avatar Jul 14 '15 12:07 jacobdeichert

@jakedeichert Yeah that's definitely a good resource, but I thought including short note about it in the guide would be helpful. Mainly because I had no idea where the problem might be, it was mostly by accident/idle frustration that I came across this issue and figured it out.

khopsickle avatar Jul 14 '15 18:07 khopsickle

@khopsickle Very good suggestion, I just ran into the same situation. I really expected rouge to be supported.

sunib avatar Sep 08 '15 19:09 sunib

Looks like kramdown:syntax_highlighter takes the value of highlighter now starting in Jekyll 3.2.1 (in this commit: https://github.com/jekyll/jekyll/commit/9d1641f163e6b20507436872336414cf6df931c7).

Also https://pages.github.com/versions/ lists rouge 1.11.1.

clintstotesbery avatar Sep 27 '16 21:09 clintstotesbery