Insert the follwing code above </head> or </body>
Code:
<link href='http://alexgorbatchev.com/pub/sh/1.5.1/styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
Samples:
1. Html Code
Code:
<pre name="code" class="html">
<!-- code here -->
</pre>
Result:
2. Python Code
Code:
<pre name="code" class="python">
<!-- code here -->
</pre>
Result:
# code here
3. Java Code
Code:
<pre name="code" class="java">
import java.io.Serializable;
class Dog implements Serializable {
private Collar theCollar;
private int dogSize;
public Dog(Collar collar, int size) {
theCollar = collar;
dogSize = size;
}
public Collar getCollar() { return theCollar; }
}
class Collar implements Serializable {
private int collarSize;
public Collar( int size ) { collarSize = size; }
public int getCollarSize() {return collarSize; }
}
</pre>
Result:
import java.io.Serializable;
class Dog implements Serializable {
private Collar theCollar;
private int dogSize;
public Dog(Collar collar, int size) {
theCollar = collar;
dogSize = size;
}
public Collar getCollar() { return theCollar; }
}
class Collar implements Serializable {
private int collarSize;
public Collar( int size ) { collarSize = size; }
public int getCollarSize() {return collarSize; }
}
For lates information about SyntaxHighlighter, please refer to: http://alexgorbatchev.com/wiki/SyntaxHighlighter
No comments:
Post a Comment