This project is read-only.

Creating code examples

Topics: ASP.NET 2.0, Controls
Sep 25, 2007 at 3:25 PM

Just wondering if it is possible to create color coded examples in the new version? How do those who blog about e.g C# create there examples code (without taking screen shots!)?

Sep 25, 2007 at 4:02 PM
I found one! But unfortunately he doesn´t have the css that color/format the code!! Any one know about something else?

He suplies the sourcecode for the converter. Maby someone could implement this into the blogengine? :-)
Sep 25, 2007 at 4:36 PM
Edited Sep 25, 2007 at 4:36 PM
In the never sources, and in 1.2 i believe that is already implemmented, i'm using it on my blog at the moment. use [code:c#][/code] around your examples. Remeber to copy the css from the Standard theme css file to your themes css.
Sep 25, 2007 at 6:35 PM
It is in the 1.2 release for c#, html, xml, javascript, sql and We'll make sure all the themes will have the right CSS before release.
Sep 27, 2007 at 8:53 PM
In the meantime, just copy this code into your theme of choice:

/* code styles for CodeFormatter Extension*/
font-size: 12px;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #F1F1F1;
/white-space: pre;/
.code span{
line-height: 14px;
.code .rem { color: #008000; }
.code .kwrd { color: #0000ff; }
.code .str { color: #006080; }
.code .op { color: #0000c0; }
.code .preproc { color: #cc6633; }
.code .asp { background-color: #ffff00; }
.code .html { color: #800000; }
.code .attr { color: #ff0000; }
.code .alt { background-color: #f4f4f4; }
.code .lnum { color: #606060;}
Mar 17, 2008 at 2:47 AM
I'm trying to use this and it flattens out the code when I use the actual CSS stylesheet by Manoli. Is there a button on the toolbar to use this feature, if so I can't find it.