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!