Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Google Code Prettify v0.3 (syntax highlighting for comments)

ithcyithcy New
edited March 2011 in Vanilla 2.0 - 2.8
This is a simple plugin that adds google-code-prettify (http://code.google.com/p/google-code-prettify/) to discussion pages. This will enable syntax highlighting inside <code class="prettyprint"> blocks in comments.

Simple usage:
<code class="prettyprint">var x = 1;
doSomething();</code>

That will produce:
image

With line numbers:
<code class="prettyprint linenums">var x = 1;
doSomething();</code>

That will produce:
image

See http://google-code-prettify.googlecode.com/svn/trunk/README.html for full usage details.

Please ask any questions in this thread.
Tagged:

Comments

  • Just uploaded v0.2 which fixes a HEREDOC problem manifesting on some servers
  • I click the download link for v0.2 and it gives me v0.1. Just forget to change the version in default.php or is it really the wrong one?
  • AdrianAdrian Wandering Spirit Montreal MVP
    edited March 2012

    is there a way to enable '"prettyprint linenums" to be done by default when <'code'> selected?

Sign In or Register to comment.