How to post source code?

Posted by

There is shortcode that you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:

Wrap your code in these tags: [sourcecode language=’css’]…[/sourcecode]

You can replace the language with one of the following language codes:

cpp

csharp

css

delphi

html

java

jscript

php

python

ruby

sql

vb

xml

The language attribute is required! If we don’t have what you need pick the closest.
Code in between the [sourcecode] tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.

Ryan S.

Accuwebhosting.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.