[Wordpess] Show on wordpress code with syntax highlighted – Posting Source Code on wordpress with syntax highlighted

How can you put a code on wordpress? The best solution is that you use Syntax Highlighter to keep the format and it even helps you highlight the key words in each language you write something like this:

#include <stdio.h>

int main() {
	printf("welcome to blog cachhoc.net");
	return 0;
}

With wordpress.com, it was built on a system you use only, but if you are using WordPress on a particular host, you need to install plugin Syntax Highlighter can be used. You just write your code in tags code:

posting source code on wordpress

The language is supported for parameters for properties language:

  1. actionscript3
  2. bash
  3. Clojure
  4. coldfusion
  5. cpp
  1. csharp
  2. css
  3. delphi
  4. erlang
  5. fsharp
  1. diff
  2. groovy
  3. html
  4. javascript
  5. java
  1. javafx
  2. matlab
  3. objc
  4. perl
  5. php
  1. text
  2. powershell
  3. python
  4. r
  5. ruby
  1. scale
  2. sql
  3. etc.
  4. xml

In addition to attribute language, Syntax Highlighter also provide more other attributes:

    AutoLink (true/false) — Do all the links in the code can click. Default is true.
    collapse (true/false) — If set to true, code box will be rolled up, when the user clicks on it will be shown. Default is false
    firstline (number) — Use to change the order of the starting line, The default is 1
    boys (true/false) — If it is false, Code line numbers on the left to hide. Default is true
    highlight (comma-seperated list of numbers) –You can list the line that you want to highlight, example: “4,7,19”.
    html script (true/false) — If it is true, all HTML code, XML will be highlighted. This is useful when you mix the languages ​​together, such as HTML with PHP and it also works with a number of languages.
    light (true/false) — If it is true, the line numbers will be hidden, should be used when you have fewer lines of code.
    padlinenumbers (true/false/integer) — Allows you to set the number of digits in the number of lines, for example, if true, it will perform the default ascending, is false, it does not have the numbers in front buffer, if the 1 integer, the number of lines that will be required to have digits, for example, you set the number 4 the number of lines displayed 0001, 0002,…
    title (string) — Set the title for the code. often used when you want to roll back code

With reference to the article at: en.support.wordpress.com