2011年8月20日星期六

wordpress代码高亮插件wp-codebox的使用方法详解

使用说明

<pre lang="LANGUAGE" line="1" file="download.txt" colla="+">
//这里写你的代码
</pre>

可用参数:
* lang="LANGUAGE" - 所用的语言
* file="download.txt" - 将创建一个下载链接.
* line="N" - 开始行号.
* colla="+/-" - The `+/-` 将打开/折叠 codebox.
* line,file,colla是可选的.

lang参数常用的值如下

c cpp php css javascript html4strict xml python perl reg mysql matlab ini java bash dos asp actionscript

示例代码1

<pre lang='cpp'>
#include <iostream>

int main()
{
int a=3;
double b=12.8;
char * m = "a string";

std::cout<<"a = "<<a<<"  b = "<<b<<"   m = "<<m<<std::endl;
}
</pre>

将产生如下输出

#include

int main()
{
int a=3;
double b=12.8;
char * m = "a string";

std::cout<<"a = "<

没有评论:

发表评论