Posted on: 05/10/11 02:42pm
By: HighKing Scott
Is there a plugin for Geeklog that will highlight VB code in Stories?
Re: VB Code highlighter
Posted on: 05/10/11 05:42pm
By: ::Ben
Hi,
The
jquery plugin[*1] bring syntax highlighter from alex gorbatchev and a brushe for Visual Basic (vb, vbnet) is available.
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
Ben
Re: VB Code highlighter
Posted on: 05/11/11 07:55am
By: HighKing Scott
Quote by: %3A%3ABenHi,
The jquery plugin[*1] bring syntax highlighter from alex gorbatchev and a brushe for Visual Basic (vb, vbnet) is available.
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
Ben
I'm sure this works, but I'm not comfortable re-writing PHP code which is why I asked if there was a plugin for geeklog.
Re: VB Code highlighter
Posted on: 05/11/11 11:16am
By: ::Ben
Yes jQuery plugin is a plugin for geeklog and to highlight VB code you will need to edit 1 line in private/plugins/jquery/functions.inc file ( near line 148 ) :
change from
Text Formatted Code
$str .= ' brushes: [\'Xml\', \'JScript\', \'CSharp\', \'Plain\', \'Php\'],' . LB;
to
Text Formatted Code
$str .= ' brushes: [\'Xml\', \'JScript\', \'CSharp\', \'Plain\', \'Php\', \'Vb\'],' . LB;
Ben
Re: VB Code highlighter
Posted on: 05/11/11 11:56am
By: HighKing Scott
Quote by: %3A%3ABenYes jQuery plugin is a plugin for geeklog and to highlight VB code you will need to edit 1 line in private/plugins/jquery/functions.inc file ( near line 148 ) :
change from
Text Formatted Code
$str .= ' brushes: ['Xml', 'JScript', 'CSharp', 'Plain', 'Php'],' . LB;
to
Text Formatted Code
$str .= ' brushes: ['Xml', 'JScript', 'CSharp', 'Plain', 'Php', 'Vb'],' . LB;
Ben
I made the change as you suggested above and when I put the code in between the (code | /code) tags I get the following result
http://screencast.com/t/cUQwBA9pc
Is there a special function that I need to put with the "Code" tags?
Re: VB Code highlighter
Posted on: 05/11/11 06:11pm
By: ::Ben
You just need to set the class for the code tag.
Text Formatted Code
<pre><code class="vb">
' Your VB code here
</pre><code>
Ben
Re: VB Code highlighter
Posted on: 05/11/11 07:05pm
By: HighKing Scott
Geeklog strips the "Class" from the tag, so I tried to add it into the config filter, but that did'nt work either...
Is there any detailed documentation on this or do you just through it out there?
Re: VB Code highlighter
Posted on: 05/11/11 07:08pm
By: HighKing Scott
Don't worry about it, I just deleted the plugin. I'll use screenshots instead.
Re: VB Code highlighter
Posted on: 05/12/11 02:52am
By: ::Ben
In the config you can set Skip HTML Filter for Root to true to allow all html tag in your posts and pages.
Text Formatted Code
Config >> Miscellaneous >> HTML filtering
::Ben