Syntaxhighlighter is a small open source project that highlights various program source code syntax in a Web page. Supports various programming languages that are currently popular:
C #, CSS, C + +, Delphi, Java, JavaScript, PHP, Python, Ruby, SQL, Visual Basic, xml/html
How to use:
1, assuming that the Web page file test.htm stored in a directory, the Dp.syntaxhighlighter will be extracted to the subdirectory under the directory, assuming that the images
2. Insert the following code between
<type= "Text/css" rel= "stylesheet" href= "Images /styles/syntaxhighlighter.css "></link>
3, in the Web page to display the program source code place to insert the following code (where the class= "JS" means to display the source code in JS syntax, and other settable class values are
C #, CSS, C, Delphi, Java, JS, PHP, Python, Ruby, SQL, VB, XML):
<name= "Code" class= "js" rows= " cols" = "</">textarea>
4. Insert the following code before </body> at the end of the page:
<Scriptclass= "JavaScript"src= "Images/scripts/shcore.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushcsharp.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushphp.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushjscript.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushjava.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushvb.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushsql.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushxml.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushdelphi.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushpython.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushruby.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushcss.js"></Script> <Scriptclass= "JavaScript"src= "Images/scripts/shbrushcpp.js"></Script> <Scriptclass= "JavaScript">DP. Syntaxhighlighter.highlightall ('Code'); </Script>
Transferred from: http://www.jb51.net/article/21981.htm
[Go] page code highlighting open Source Tool Syntaxhighlighter (JavaScript-based)