At the beginning it was a big deal for me, i want my own blog about programming, then, i’ll need to post several code blocks, but, i don’t knew how to do it…
Finding a little bit on the internet y found out that wordpress.com implements SyntaxHighlighter (http://alexgorbatchev.com/wiki/SyntaxHighlighter)
blablabla, lets talk about what you really want to hear…
HOW POST SOURCE CODE IN YOUR WORDPRESS.COM BLOG?
It’s not a big deal…
Just wrap your code between
[sourcecode language="language"]
your code here
[/sourcecode]
tags, and “language” could be one of the next supported languages
- bash
- cpp
- csharp
- css
- delphi
- html
- java
- jscript
- php
- python
- ruby
- shell
- sql
- vb
- xml
Sample
The input
[sourcecode language="csharp"]
private void ShowRates(DataClassesDataContext bd)
{
var myTable = from table
where table.deleted = false
orderby table.name
select table;
myGrid.DataSource = myTable;
myGrid.DataBind();
}
[/sourcecode]
will produce
private void ShowRates(DataClassesDataContext bd)
{
var myTable = from table
where table.deleted = false
orderby table.name
select table;
myGrid.DataSource = myTable;
myGrid.DataBind();
}
Easy, isn’t?