WordPress代码高亮插件WP-codebox
WP-codebox基于GeSHi,支持超多语言,支持文件下载,IE下支持“复制到剪贴板”操作,代码框收放及后台默认属性设置。
http://wordpress.org/extend/plugins/wp-codebox/
应amerika要求(可能是土耳其语,但我外语不好.只能用翻译工具简单翻译成英文^_)
WP-codebox based on GeSHi, super multi-language support, support for the file to download, IE under the support of the “copy to the clipboard” operation, code box strengths and background to set the default attributes.
使用格式 Examples
<pre lang="php" line="1" colla="+" file="codebox.php">
class className{
var $var = 1; //注释 Notes
function funcName($param){
return $this->var;
}
}
</pre>
1 2 3 4 5 6 7 | //演示php代码 Php code demo class className{ var $var = 1; //注释 Notes function funcName($param){ return $this->var; } } |
各个属性说明:Various attributes
lang
高亮的语言格式
Highlight of the language format
line
值为”n”时,不显示行号。否则从以该值为行号的起始值。
Value for the “n” does not show line number. Otherwise, from the value of the starting line number.
file
下载文件名
Download file name
colla
可设为”+”或”-”,分别代表代码框展开或收缩
Can be set to “+” or “-” were carried out on behalf of the code box or contraction
line,file,colla为可选属性。
line, file, colla optional attributes.
抄自官方网站:
Basic Usage Wrap code blocks with <pre lang="LANGUAGE" line="1" file="download.txt" colla="+"> and </pre> Possible Parameters: lang="LANGUAGE" - LANGUAGE is a GeSHi supported language syntax. file="download.txt" - The file will create a code downloading attribute. line="N" - The N is the starting line number. colla="+/-" - The +/- will expand/collapse the codebox. line,file,colla is optional.



Is there any information about this subject in other languages?
http://wordpress.org/extend/plugins/wp-codebox/
php代码高亮时,有些符号(比如等)自动转化成空格。不知为什么,难道是可视化编辑模式冲突?
不知道好不好用
嗯,很不错的插件,只是觉得插件的体积有些太大了。
class className{
var $var = 1; //注释 Notes
function funcName($param){
return $this->var;
}
}