So I am writing this blog to keep track of all my little coding/scripting projects. So, the first thing I need to do is figure out how to add pretty (Syntax Highlighting) to this webpage so that I can show you all my other usefull code.
I did some searching on the web and I found Goole’s Syntax Highlighter. It is amazingly easy to use and I think it looks good.
I think that this code is very easy to use.
1. Download the code.
2. Add this code segment to the <head> section of your webpage:
3. And surround your code with <pre> tags:
**The only troublesome part is that all the code inside the Syntax Highlighter that has an opening triangular bracket <, must be replaced with an HTML equivalent of <
WordPress
Using the Google Syntax Highlighter with WordPress is extremely easy as well.
Just:
1. Download the plugin.
2. Extract it to the /wp-content/plugins directory.
3. Activate the plugin.
4. Add your code the the webpage.
Upgrading to version 2.1
Sadly, once I got the plugin working with my WordPress install, I realized that the plugin is running v1.5 of the Syntax Highlighter code, even though the code has been released up to v2.1.
Since I just did the install, there isn’t much more to change to reap the full benefits of this product.
1. Download the New Code
2. Extract it and update the files in the /wp-content/plugins/google-syntax-highlighter directory.
3. Edit the “google_syntax_highlighter.php” file to:
Well that’s all that I have for today. Thanks for reading this, I hope that it helps with all your source code highlighting needs in the future.