We get a lot of comments here on the blog and, surprise surprise, many of them include code. You may have noticed that in all of our posts we have nicely formatted and color highlighted code - and now, anyone can use this feature in our comments. This is done simply by using formatting like the following:
GraphicsPath p = new GraphicsPath();
p.StartFigure();
//Top Left Corner
if ((RectangleCorners.TopLeft & corners) == RectangleCorners.TopLeft)
{
p.AddArc(x, y, 2*radius, 2*radius, 180, 90);
}
else
{
p.AddLine(x, y+radius, x, y);
p.AddLine(x, y, x+radius;, y);
}
//Top Edge
p.AddLine(x+radius, y, x+width-radius, y);
[/csharp]
Now this will turn into:
p.StartFigure();
//Top Left Corner
if ((RectangleCorners.TopLeft & corners) == RectangleCorners.TopLeft)
{
p.AddArc(x, y, 2*radius, 2*radius, 180, 90);
}
else
{
p.AddLine(x, y+radius, x, y);
p.AddLine(x, y, x+radius;, y);
}
//Top Edge
p.AddLine(x+radius, y, x+width-radius, y);
Now this technique works for almost any language we use here on the site including:
- csharp
- xml
- mxml
- actionscript
- javascript
- html
- css
- php
For general code you can use "code", so [code]. The syntax highlighting is done using a Wordpress plugin called iG:Syntax Hiliter which uses Geshi for the highlighting. We will at some point in the future be offering up the custom files that we made for mxml and other languages. Hopefully this makes all of our commenter's lives easier.
11/03/2008 - 14:06
can i mail it to U ?
greetings
frederic
11/03/2008 - 14:10
Sure, the email address is located at the bottom of the About page.
Add Comment
[language] [/language]
Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]
See here for supported languages.
Javascript must be enabled to submit anonymous comments - or you can login.