Monday, September 29, 2008

Blogger Source Code Wedget

http://code.google.com/p/syntaxhighlighter/wiki/Configuration
http://fazibear.googlepages.com/blogger.html
http://www.kuribo.info/2008/06/blogger-syntax-highlighter.html

Source code syntax highlight box example:


class first {
}


You can display multiple programming language syntax with this widget.
1. open the following page http://fazibear.googlepages.com/blogger.html, and click "add widget" button to add the widget to your blogger.
2. edit your post make all the source code around with

<pre name="code" class="your language i.e. java">
your source code, but remember to replace all < > to & lt ; & gt ;
<pre>


the following languages are supported.

c
c++
c#
css
delphi
html
java
js
pascal
php
python
ruby
sql
vb
xml


the following options are also available.

nogutter Will display no gutter.
nocontrols Will display no controls at the top.
collapse Will collapse the block by default.
firstline[value] Will begin line count at value. Default value is 1.
showcolumns Will show row columns in the first line.

The options are passed together with the alias and are separated by a colon : character.


<pre name="code" class="html:nocontrols:firstline[10]">
... some code here ...
</pre>

No comments: