måndag 5 april 2010

Syntax highlighting code on Blogger

I am going to try out this example:
To add code, paste it into HTML and enclose it as follows:
<pre class="[LANGUAGE]" name="code">
[PUT CODE HERE]
</pre> 
LANGUAGE can be cpp c c++  csharp  css  delphi pascal  java  javascript  php  python  rb ruby rails ror  sql  vb vb.net  xml html xhtml xslt

Here's an example:

def hello(x):
    for i in x:
        if x < 10:
            print i
    return len(x)

1 kommentar:

  1. To convert code with < and & in it, you can use
    http://www.opinionatedgeek.com/dotnet/tools/htmlencode/encode.aspx

    SvaraRadera