Code formatting in blog posts
- September 5th, 2008
- By David
- Write comment
Do you like posting source code samples on your blog?
I wasn’t sure how. I just surrounded it with “<pre>” tags. That works in the basic sense. What about the syntax highlighting and line numbers?
A search of the WordPress FAQ’s revealed this how-to on posting code.
Basically it looks like this. Just tell it what language you’re using.
It also revealed Google’s syntax highlighter for when Javascript libraries are doable.
Pretty simple. Thanks Google and WordPress.
