[Go] page code highlighting open Source Tool Syntaxhighlighter (JavaScript-based)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.