Syntax Highlighting For Code Snippets On Your Blog
Recently, I thought it would be nice to have a syntax highlighting feature if you present code snippets - you might know this behaviour from your code editor. I found two WordPress plugins, but unfortunately, I did not quite manage to make them work in the right way:
- “Highlight.js”: softwaremaniacs.org/soft/highlight/en/
This solution is based on JavaScript in combination with CSS. There is also a WordPress plugin available, but I somehow didn’t succeed to integrate it into my own stylesheet - it just wouldn’t look right. - “WP-Syntax”: wordpress.org/extend/plugins/wp-syntax/
This WordPress plugin uses GeSHi, the “Generic Syntax Highlighter” which is based on PHP. It works OK when you have the WordPress visual editor deactivated - otherwise, it will replace “<”, “>” and “&” with the HTML-entities which does not look nice in a code snippet.
I must admit: I didn’t try TOO hard, because the amount of code snippets in my blog keeps within reasonable limits.
The post ends here. Wanna leave a response? Have Your Say!
Next post: Hitman - The Movie
Previous post: Tooth Fairy
The above post was initially scribbled on December 12th, 2007 @ 18:46:58 +0100 (CET) and has been last modified on March 31st, 2008. It is filed under the category WordPress Stuff and has been tagged with the terms [code | highlighting | plugin | snippet | syntax | wordpress].
Sorry, still gathering information...
Trackback URI | Comments RSS | Permalink



