Archive | Wordpress RSS for this section

Syntax highlighting in WordPress.com

I spent the last half hour searching for a solution for this and it turned out to be very easy. You just put your code in sourcecode tag.

For example C# code highlighting:

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
 class Program
 {
 static void Main(string[] args)
 {
 }
 }
}

Apparently this sourcecode highlight feature works for a variety of languages, so you can use it with any of the following:
actionscript3, bash, coldfusion, cpp, csharp, css, delphi, erlang, fsharp, diff, groovy, html, javascript, java, javafx, matlab (keywords only), objc, perl, php, text, powershell, python, r, ruby, scala, sql, vb, xml

Advertisements