使用syntaxhighlighter在文章中显示代码

Posted by eDWARD at 10:43

  之前一直使用Yahoo UI工具包中自带的syntaxhighlighter作为代码显示工具,但是版本比较低,支持的语言种类也相对较少,这次借着升级wordpress的机会去了SyntaxHighlighter的网站下载并安装了最新的版本。新版本的SyntaxHighlighter支持更多语言种类和别名标记,而且样式也更加美观了。

Supported languages

Here's a list of supported languages and their aliases:

Language Aliases
C++ cpp, c, c++
C# c#, c-sharp, csharp
CSS css
Delphi delphi, pascal
Java java
Java Script js, jscript, javascript
PHP php
Python py, python
Ruby rb, ruby, rails, ror
Sql sql
VB vb, vb.net
XML/HTML xml, html, xhtml, xslt

一段Python代码

Sphere: Related Content

Filed In 学习路上 | Study | Tags: , |

Your Comments.

Leave your own response

7 Responses to “使用syntaxhighlighter在文章中显示代码”

Leave a Reply.

Comment Form.

Fields denoted with a "*" are required. Your comment may require moderation, please be patient.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>




Your Reply.

Use the following link to trackback from your own site:
http://www.zhangzhang.net/articles/2008/01/29/use-syntaxhighlighter/trackback/

Spread the word.

Octopus supports RSS feed for this post RSS 2.0 , and Trackbacks from other blogs.


Technorati

  品位不凡,威严,略显高深,喜爱一切美丽的事物,易怒,固执,有些利己,但关心接近他的人。谦逊,但非常有野心,有才能,刻苦,是不甚令人满意的伴侣,朋友众多,树敌也多,是可以信赖的人。


bloglines
google reader
my yahoo