Welcome to Geeklog Monday, May 20 2013 @ 07:31 AM EDT
|
||||||||
![]() |
Forum Index > Support > General Geeklog Support |
New Topic
|
Post Reply
|
jquery syntax highlightiing css brush |
|||
| dwl |
|
||||||
![]() ![]() ![]() ![]() ![]() Junior Status: offline ![]() Registered: 01/05/11 Posts: 25 |
I've followed the documentation and steps for implementing the jQuery plugin but can not implement the brush for css. I can successfully implement classes for php and js syntax.
According to the documentation I should be able to activate it with PHP Formatted Code <code class="css">On the alex gorbatchev site there is mention of requisite file names for different syntax highlighters but I can not find their location using sh*.js as a filefind parameter. |
||||||
|
|||||||
| dwl |
|
||||||
![]() ![]() ![]() ![]() ![]() Junior Status: offline ![]() Registered: 01/05/11 Posts: 25 |
Nudge.
Does anyone have an answer? If not, I guess I'll have to change blog packages |
||||||
|
|||||||
| ::Ben |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member ![]() Status: offline ![]() Registered: 01/14/05 Posts: 1359 |
Hi,
Load the css brush by editing plugins/jquery/functions.php file PHP Formatted Code // Code highlighterif($_JQ_CONF['use_codehighlighter'] == true){ $strext = '/jquery/codehighlighter/jquery.beautyOfCode.js'; $_SCRIPTS->setJavaScriptFile('jquery_beautyofcode', $strext); $str1 = ' jQuery(document).ready(function() {' . LB; $str1 .= ' jQuery.beautyOfCode.init({' . LB; $str1 .= ' brushes: ['Xml', 'JScript', 'Css', 'Plain', 'Php'],' . LB; $str1 .= ' ready: function() {' . LB; $str1 .= ' jQuery.beautyOfCode.beautifyAll();' . LB; $str1 .= ' }' . LB; $str1 .= ' });' . LB; $str1 .= ' });' . LB; $_SCRIPTS->setJavaScript($str1, true); } Then use this syntax PHP Formatted Code <pre><code class="css"> /* SEMANTICS ******************************************************************/ a { background:transparent; } </code></pre> Ben We speak french on http://geeklog.fr |
||||||
|
|||||||
| dwl |
|
||||||
![]() ![]() ![]() ![]() ![]() Junior Status: offline ![]() Registered: 01/05/11 Posts: 25 |
Thanks for the effort Ben but it still will not work. I am no longer receiving the error of the brush as unavailable but the styling is not working. The syntax is still coming out as black and white even though I am using:
HTML4STRICT Formatted Code <pre><code class="css"> /* SEMANTICS ******************************************************************/ a { background:transparent; } </code></pre> I did a line by line comparison of your block of code and the one already in plugins/jquery/functions.inc (there is no plugins/jquery/functions.php). There were discrepancies. The error I was receiving for css brush not being available is because it was not defined as the syntax below indicates: PHP Formatted Code //from existing code in function $str1 .= ' brushes: [\'Xml\', \'JScript\', \'CSharp\', \'Plain\', \'Php\'],' . LB; Unfortunately, with your code none of the brush values was escaped. PHP Formatted Code //from Ben's solution for function $str1 .= ' brushes: ['Xml', 'JScript', 'Css', 'Plain', 'Php'],' . LB; If it was intended, then I don't know what the solution is. Loading your code as written, my site would not load. All I had was a blank browser. Doing some debugging of tailing the PHP error log Escaping them or writing the code as PHP Formatted Code $str1 .= " brushes: ['Xml', 'JScript', 'css', 'Plain', 'Php']," . LB; did not work either. The site would load but the css syntax in the article I am writing has no highlighting. |
||||||
|
|||||||
| ::Ben |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member ![]() Status: offline ![]() Registered: 01/14/05 Posts: 1359 |
Hi,
Sorry the file name is functions.inc where I replaced the CSharp by the Css brush but I don't know why none of the brush values was escaped because I pasted the code from the plugin file where they are escape I confirm color hightlighting is working on my testing platform. ![]() Ben We speak french on http://geeklog.fr |
||||||
|
|||||||
| dwl |
|
||||||
![]() ![]() ![]() ![]() ![]() Junior Status: offline ![]() Registered: 01/05/11 Posts: 25 |
Hi,
As I noticed when writing My post, if you quote code here, you need to double escape with 2 slashes. As for the "Csharp" vs "css", are you saying "Csharp" is in the code by default as coded by you as plug-in author? The instance of "Csharp" in my quoted post's syntax is from the plug-in as installed from the site, not the block of code you sent to me. The question now is, why is your version of the plug-in working and mine is not, at least for css syntax? Quote by: ::Ben
Hi, |
||||||
|
|||||||
| dwl |
|
||||||
![]() ![]() ![]() ![]() ![]() Junior Status: offline ![]() Registered: 01/05/11 Posts: 25 |
Well this is now solved.
|
||||||
|
|||||||
| ::Ben |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member ![]() Status: offline ![]() Registered: 01/14/05 Posts: 1359 |
We speak french on http://geeklog.fr |
||||||
|
|||||||
| Content generated in: 1.49 seconds |
|
|
|