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

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

This discussion is related to the GoogleCodePrettify addon.
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 Vanilla Staff
    edited March 2012

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

    atodatjaredNZ
Sign In or Register to comment.