原帖地址:http://www.cnzzr.cn/2007/09/wordpress-syntax-highlighting.html
下载地址:http://wordpress.org/extend/plugins/wp-syntax/
安装
- Upload wp-syntax.zip to your Wordpress plugins directory, usually
wp-content/plugins/and unzip the file. It will create awp-content/plugins/wp-syntax/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- 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 »
还没有任何评论。