(转)WordPress代码高亮插件WP-Syntax

原帖地址:http://www.cnzzr.cn/2007/09/wordpress-syntax-highlighting.html

下载地址:http://wordpress.org/extend/plugins/wp-syntax/

安装

  1. Upload wp-syntax.zip to your Wordpress plugins directory, usually wp-content/plugins/ and unzip the file. It will create a wp-content/plugins/wp-syntax/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Create a post/page that contains a code snippet following the proper usage syntax.

写文章时,用 <pre> 和 </pre> 将代码包住即可。同时在<pre> 中指定参数 lang=”代码类型” line=”起始行数”。
最后在使用的过程中注意 lang=”” 一定要使用双引号,而不能用单引号。

例如:

var $test;
function test()
{
test();
}

Supported Languages(支持的语言)

The following languages are supported in the lang attribute:

abap, actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt, cpp, csharp, css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gml, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, per, perl, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, z80

(Bold languages just highlight the more popular ones.)

No Response to (转)WordPress代码高亮插件WP-Syntax »

还没有任何评论。

Leave a Reply

Email address is not published

You should say a Chinese word to pass spam check. If you can not input Chinese, just copy 你好 and paste them into comment text box.