HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Syntax highlighting on this forum
JasonBarnabe
✭✭
Is the syntax highlighting on this forum available as a plugin, or is it a paid-only feature?
function example() { var foo = "bar"; }
0
Best Answer
-
Bleistivt Moderator
The source code says it's using a plugin called GooglePrettify which I have not seen in any of the open source repos yet.
Hovever, like the Prettyprint plugin, it just implements Google prettify, which is pretty much a 4-step process:
http://google-code-prettify.googlecode.com/svn/trunk/README.htmlthe class can bee added with javascript, like the PrettyPrint plugin does it, or you could try this: (untested)
public function Base_AfterCommentFormat_Handler($Sender, &$Args) { $Args['Object']->FormatBody = str_replace('<pre>', '<pre class="prettyprint">', $Args['Object']->FormatBody); }
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
1
Answers
This forum uses a plugin for syntaxhighlighting and is called: PrettyPrint (available for everybody). The highlighting is fully based on javascript.
http://vanillaforums.org/addon/prettyprint-plugin
The source code says it's using a plugin called GooglePrettify which I have not seen in any of the open source repos yet.
Hovever, like the Prettyprint plugin, it just implements Google prettify, which is pretty much a 4-step process:
http://google-code-prettify.googlecode.com/svn/trunk/README.html
the class can bee added with javascript, like the PrettyPrint plugin does it, or you could try this: (untested)
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Yeah, I figured it wasn't much work to do but I would prefer no work over a little.
Vanilla dudes, any chance we can get that open sourced?
A pretty good one.
Well that's encouraging but ambiguous...
I'm not the final word on this. I put it on my tentative list for the upcoming shuffle, tho.
It's now available at https://github.com/vanilla/vanilla/tree/master/plugins/GooglePrettify . Thanks!