Source Code in WordPress



Since this is a technical blog, I like to post source code in various forms from time to time.  But, WordPress.com hasn’t been very easy in that regard.

WordPress.com was rather limited — the only thing I found was the [- sourcecode -] tag.  You can read more on that here.

Now that I am on my own site, I am looking to try to improve source code handling with a plugin.

Of cource, the Source Code post mentions that they use the SyntaxHighlighter plugin for WordPress.com. I found another list of plugins, but that just led me back to a different link to the same SyntaxHighlighter.  It does mention a Visual Code Editor that might be interesting.  Apparently, it will work in conjunction with the SyntaxHighlighter. Now, this list looks much more promising: 12 WordPress Plugins to Display and Highlight Code within your Blog

I did a little more looking into the WordPress version (SyntaxHighlighter Plus).  Here is a list of syntaxes supported.  At the bottom, there is some information about how to create your own syntaxes.

This Developer Formatter plugin looks very promising.  The problem is it didn’t work for me.  It seemed to break the editor.

I ran across this thread that talks about adding Code Mirror to the TinyMCE editor.  If I ever get time, I’ll have to try my hand at writing a plugin.

 

Leave a comment


+ two = 4