Showing a code snippet in an HTML page
Like there is a code sample inserter in the stackoverflow's WYSIWYG text editor (see image here)
I want such a formatter to show a code snippet in an html page with colored keywords and strings etc. Pl开发者_JAVA技巧ease help.
Check out google code prettify: http://code.google.com/p/google-code-prettify/
Check http://code.google.com/p/syntaxhighlighter/ it's pretty popular and awesome.
This maybe? http://plugins.jquery.com/plugin-tags/syntax
Geshi is quite awesome too: http://qbnz.com/highlighter/demo.php
精彩评论