iG:Syntax Hiliter is a plugin that I’ve made. It can highlight the HTML, CSS, PHP, JAVA & SQL codes. I know there’s another syntax hilighter plugin. But that didn’t work on my machine, so I made this. π
Here’s a few examples of this plugin.
[php]
/*
Some PHP Code
*/
$var1 = “My Variable is “; // a variable
$var2 = 23;
print($var1.$var2);
[/php]
some candy, eh? How about this?
[css]
body {
color:#330000; font-weight:bold;
}
.class1 {
font-weight:bold; font-style:italic;
}
[/css]
or this ?
[java]
System.out.println(“Hello from Java”);
// been out of touch for quite long
[/java]
or some SQL?
[sql]
SELECT * FROM myFancyTable WHERE id=1;
[/sql]
Seems to work, eh? π Now, all I have to do is write a short manual for it, the installation instructions etc. & it’ll be ready for public release. π
See you in a bit then!! π π
This is very cool. I’ll give it a shot later on today! Thanks for sharing.
Thanks for using my GeSHi script! π
I’ll link to this from GeSHi’s home site as an example of what it can do. More publicity for you π
Don’t forget to get GeSHi 1.0.1 as well: It comes with ADA, ASM and Pascal langauge files among other new ones π
DonΓ’β¬β’t forget to get GeSHi 1.0.1 as well: It comes with ADA, ASM and Pascal langauge files among other new ones
I’m looking forward to the next release of GeSHi but as a matter of fact, I haven’t included all language files that come with GeSHi, in this plugin release. Its just HTML, CSS, PHP, JAVA & SQL. I’ve left out C & QBASIC. But if people want it, I’ll include them in. π
You need to get together with this plugin author and make an (even more) amazing plugin.
http://xmouse.ithium.net/archives/2004/07/19/implementing-a-code-snippet-system
I just noticed this plugin being mentioned in the WP Plugins Support forums. Frankly, I can’t think of a reason as to why I need to get together with that plugin. That plugin pulls code from code files, alright. Now if that code needs to be highlighted, no work around is required. Just install my plugin & use the required tags to wrap the code, it’ll work alright. π
Aye.. Cool I will try that out first thing tomorrow.
I have followed the directions in the manual but am encountering the following error when trying to use the plugin.
Fatal error: Cannot instantiate non-existent class: geshi in (path)/syntax_hilite.php on line 31
Any thoughts?
Please post any bugs & problems at http://wordpress.org/support/10/10533/
great plugin but it doesn’t validate π
Its not validating because of a bug in the GeSHi v1.0 because of which there were 2 quotes(“) to close an attribute value in the <span> tag. This bug has been fixed in GeSHi v1.0.1 & the next release of the plugin will have that fix as well. π
So you can look forward to validation in the next release. π
Yeah, but its been fixed in v1.0.1, so its ok. π
Sorry about that. π It’s funny though – when I was viewing the source in Mozilla it didn’t show the errant quotes, so I thought it was fine! I only picked it up when I was XHTML validating the website…
Hi, I have modified some of your code and now it accepts all languages included in GeSHi 1,04. I reduced some repeated code and also fixed a part of GeSHi core because it doesn’t allow html entities (for example when I have – echo "Hello world"; – echo “Hello World” – the first doesn’t highlight correctly).
I put the modified version in http:///www.buayacorp.com, if you want see the changes I made, you can email me – alex at buayacorp.com
Good thing. I’m interested in what repeated code you reduced!! π And the GeSHi fix as well. π Hope that you’ve notified Nigel(GeSHi developer) of the GeSHi fix. π
As far as I can see, the difference between the two examples above is that one uses " to do the quotes and the other uses “. In which case, GeSHi will correctly interpret " as not being a " and your source will turn to custard π
…unless there’s something else going on? Please post a URL to an example for me π
Hi, sorry for my absence, you can download the modified version in http://test.buayacorp.com, there are some screenshots about HTML entities test.
Comments will be appreciated
Regards
The problem you are getting isn’t there in my test blog. I turned on the option of fixing xHTML & then posted your first block of code at http://test.buayacorp.com/. It’s displayed alright. π
What version of WP are you using? This problem doesn’t come in any of v1.2.x of WP. π
I’m using wordpress 1.2.2, the first block of code, it’s just to see that wordpress(as I said, in my test blog) doesn’t reformat very well.
Did you see the code I’ve modified?
No I haven’t had time to see your code yet, but I’ll over the weekend. But the thing is that I’m not able to re-produce the errors you are getting on v1.2 & v1.2.1 installs. I’ll try them on in v1.2.2 & the latest v1.3 install to check if I get it in any of them. π
It’s a interesting
plugin
thanks for that job