When I started my code snippet into my blog, I used <pre></pre> to make it as pre-formated text. However, it is ugly without syntax highlight.

There are many WordPress plugins that can add the syntax highlight to various languages (just to go Plugins-> Add New-> Search for Syntax Highlight, you will find plenty). The one that I picked is called “Prettify GC Syntax Highlighter”. It uses the Google Code style highlight and has various control. Check the developer’s website for more information.

You can check out my previous post for a quick example.

It support a long list of languages.

  • aea
  • agc
  • apollo
  • bsh
  • c
  • cc
  • cl
  • cpp
  • cs
  • csh
  • css-str
  • cv
  • cxx
  • cyc
  • default-markup
  • el
  • fs
  • go
  • hs
  • htm
  • html
  • java
  • js
  • json
  • lisp
  • lua
  • m
  • ml
  • mxml
  • perl
  • pl
  • pm
  • proto
  • py
  • rb
  • scala
  • scm
  • sh
  • sql
  • vhd
  • vhdl
  • wiki
  • xhtml
  • xml
  • xsl
  • yaml
  • yml

What is your favorite syntax highlighter? Let us know.


How To Add Syntax Highlight for Code in WordPress

Please tell us what's in your mind ...

%d bloggers like this: