Google Syntax Highlighter
Often time when I try to post the code to my blog, the admin text editor will screw it up. Either the indent is gone or the xml tag is interpreted. No matter what, I cannot show the code in a nice and decent way. Luckily, I have found a nice plugin named “Google Syntax Highligher” that solves the problem and show consistent view on both IE6 and Firefox. After experiment a little bit, I am surprised to find out that it can display the code nicely with syntax highlighted. It supports many languages:
- C++ (cpp, c, c++)
- C# (c#, c-sharp, csharp)
- CSS (css)
- Delphi (delphi, pascal)
- Java (java)
- Java Script (js, jscript, javascript)
- PHP (php)
- Python (py, python)
- Ruby (rb, ruby, rails, ror)
- Sql (sql)
- VB (vb, vb.net)
- XML/HTML (xml, html, xhtml, xslt)
Below is the demo for my java code:
package com.adconion.command;
/**
* @author rhon
* LoginCommand for Login Controller.
*/
public class LoginCommand {
public LoginCommand(){
}
private String userId;
private String password;
/**
* @return Returns the password.
*/
public String getPassword() {
return password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @return Returns the userId.
*/
public String getUserId() {
return userId;
}
/**
* @param userId The userId to set.
*/
public void setUserId(String userId) {
this.userId = userId;
}
}
Visual Editor Plugin
Another big headache I have is using the tinymce visual editor that comes with the installation of wordpress. Although it has lots of features, I don’t think it does the simple job right. Most of the issues are stemmed from switching between “visual” and “html” editors. Among all the issues, there are 2 main ones that it fails badly.
- Problem formatting paragraph. Often time, we hit enter to put newline to our blog for giving some spaces for our content to make it look nicer. However, after hitting save in tinymce editor, the html output doesn’t honor the changes. Here is the detail.
- Problem when working with Google Syntax Highlighter. I have used <pre> with name and class attribute as stated in the usage guide. However, tinymce will take away the “name” attribute when I switch to visual editor from html editor since name is not compatible to the xhtml standard. To get around that, I tried to use <textarea> but in vain because it doesn’t perserve the code format inside the tag when I switch my editor later. I have spent lots of time but failed to find a way to resolve it. I am very close to look into tinymce code

Finally, with luck, I finally found a better editor named “fckeditor” to replace tinymce and my problems above are resolved!!

Attachment Plugin
Apart from pasting codes to my articles, I also want to attach files to it for users to download. For example, I would like to attach a prototype I found or created to my tutorial article to make it more completed. To do that, I would suggest you to use attachment manager plugin. To demonstrate its capability, I will attach this plugin zip in this article for you to download.
Conclusion
After I spent a bit of time to get myself familiar with some popular wordpress plug-ins, I am totally impressed by the rich framework that gives developers an environment to collaborate and contribute. Everything is organized as plug-ins and functions together as a whole. It is the same “Open Platform” idea that makes Facebook so popular. To further dive into this, I decide to upgrade my wordpress to 2.5 and look into how to have wordpress to power a regular website. I think this article may be a good start. I will keep you update for my next post. ![]()
Attached Files:





































(4.75 out of 5)
(4 out of 5)
1 Comment Received
Pingback & Trackback
Sorry the comment area are closed for non registered users