Wordpress syntax highlighting for R is a pain
Here's some steps that work for me on Wordpress (v3.5)
- install the WP SyntaxHighlighter plugin via the Dashboard
-
install the Lang Pack for WP SyntaxHighlighter. I did this by simply moving the contents of
wp-content/plugins/wp-syntaxhighlighter/sample/
into the main plugin directory (from the command line actually) and then activating the Lang Pack that appeared in the plugins part of the dashboard. That gets us R code highlighting.
-
Inelegantly remove the weird little green acknowledgements box that seems to clash with everybody's theme colours by adding the lines
SyntaxHighlighter.defaults['toolbar'] = false;
directly before the two calls to
SyntaxHighlighter.all();
in the file
wp-syntaxhighlighter.php