conjugateprior

Wordpress syntax highlighting for R is a pain

Here's some steps that work for me on Wordpress (v3.5)

  1. install the WP SyntaxHighlighter plugin via the Dashboard
  2. 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.

  3. 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
    

Archived article and comments

From the Internet Archive

License

Creative Commons License