Syntax Highlights
Until today I had no idea how to make code pretty in my blog posts which go to github after being first rendered locally so I can get the categories and tags.
Because github disables any plugins when it processes your blog I took Charlie Park’s advice. http://charliepark.org/jekyll-with-plugins/
This blog post solved it for me http://tuxette.nathalievilla.org/?p=1574
The trick is to write highlighter: pygments
into the _config.yml
and then:
% highlight r % # with curly braces
data("iris")
plot(iris$Sepal.Length ~ iris$Sepal.Width)
dat <- rnorm(1000,1,2)
% endhighlight % # with curly braces
Will render as:
But I also pushed this to another site that I do use gh-pages to build and it sent me an email complaining:
You are attempting to use the 'pygments' highlighter,
which is currently unsupported on GitHub Pages.
Your site will use 'rouge' for highlighting instead.
To suppress this warning, change the 'highlighter' value to
'rouge' in your '_config.yml'.
So there.