run-jekyll-on-windows
run-jekyll-on-windows copied to clipboard
highlighter: rouge is possibly incorrect/deprecated
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
GitHub pages do not support Rouge.
https://pages.github.com/versions/
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.
No, that does not hint anything.
Anyway, the correct syntax is highlighter
and if you have any issue with that you should ask upstream.
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.
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.
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 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.
@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 Very good suggestion, I just ran into the same situation. I really expected rouge to be supported.
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.