I found a useful link hilite.me from Wei Bai’s blog, it provide an elegant way to convert your codes into html format. It doesn’t depend on any CSS or other packages.

Here is an example:

1
print 'hello world!'