Posting source code

I just started to write a post and wanted to include some C#.  I found the solution here.  And here.  And here.  That last has a set of additional parameters you can use, including highlighting.

I include the solution here to save you a click:

[sourcecode language=”csharp” wraplines=”false”]
public class Demo { }

which generates

public class Demo { }

Other languages include:

  • css
  • html
  • javascript
  • text
  • powershell
  • sql
  • vb
  • xml

And there are many more on the aforementioned page.

This page gives a list of codes for including special characters, which I need every time I edit this page because it translates [ into a left square bracket “[” and ] into a right square bracket “]” and reformats what I’m trying to demonstrate as the results, instead of the source!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: